Should estimates over a subsample be similar to the full sample when using panel data? I am estimating the effect of $x$ on $y$;  $y$ and $x$ are available both by city and by year.  During the first period, $T_1$, both $x$ and $y$ generally increase.  During the second period, $T_2$, both generally decrease.  I have about 30 cities over 40 years.


*

*How can I use regression to attribute the average effect of $x$ on $y$ to the overall average increase in $y$ during $T_1$ and the same for the decrease in $T_2$?  For example, I want to say something like during period $T_1$, $x$ can explain 5% of the increase in $y$ over $T_1$.  How would I compute $x$?  Normally, I divide the coefficient by the average difference between the last year and the first year, but that approach does not sound sensible if $x$ and $y$ both increase and then decrease.

*I find statistically significant results when I do the regression over the entire time period.  However, if I break it separately to just subperiods, $T_1$ and $T_2$, neither are statistically significant and the coefficients change sign.  Is that simply because the smaller sample makes the standard errors blow up?  Should I find effects of $x$ and $y$ over subsamples of the panel?
 A: I believe you would want to figure out within- and between- regression, which might give different results. Abusing a popular example of an external cause of an apparently spurious correlation between two variables, suppose you have number of students in universities vs. outside temperature, by week, throughout the year, across a large country such as the US. The between-university regression will say that there is no relation between temperature and attendance (unless for some reason the schools in warmer climate are consistently larger or smaller than those in cold climate), while within-university regression will tell you that the warmer it is outside, the fewer students you will find in the audience (hint: the enrollments are generally lower in the summer, the hottest time of the year). These two regressions thus respond to different drivers, and that's what you seem to be interested in.
Wooldridge 2010 is a great book on panel data that I would strongly recommend.
A: When using the full sample, your estimate is a weighted average of the effects in the two periods. Unless the effect is the same in both periods, a regression using the full sample will give different results than regressions for each subsample. I had a concrete example of this in my paper "Broken or Fixed Effects?" with two coauthors, but, unfortunately, it had to be cut. The principles discussed therein, however, are just as applicable to your situation. Your fixed effects would be a time period dummy.
