# R-squared increase dramatically when including "time dummy" (STATA)

Currently running a fixed effect panel using STATA. First, I declare data set as panel: Code: xtset id obs

Where id = 350 firms and obs = 125

Then I run a fixed effect regression:

Code: xtreg y x, fe

The within r-squared of the fixed effect regression is 0.001

However, since I want to control for cross sectional dependence. I run the same regression but with time dummy:

xtreg y x i.obs, fe

The within r-squared increases dramatically to 0.25

The question is why there is a significant increase in r-squared? Is the increase due to higher explanatory power after correcting for cross sectional dependence?

Thanks

• Is obs your time variable? Should I think of obs as $\mathit{obs} \in \{1,\ldots,125\}$? Aug 6, 2017 at 0:08
• @MatthewGunn yes obs is my time variable (1,....,125 observations for each id) Aug 6, 2017 at 0:16

It means that about 25 percent of your within firm variation (i.e. the variation of a firm over time) is explained by your time-series dummies i.obs which pickup the period by period cross-sectional mean.
To phrase it another way, about 25 percent of a firm's variation in $y_{it}$ over time is explained by variation in the aggregate $\bar{y}_t$.