# Does it make sense to add random coefficients to a fixed effects (fixed-intercepts) model?

If you have panel data, and you fit a model like $$y_{it} = \alpha_i + X_{it}'\beta + \epsilon_{it}$$ then you have $E[\hat\beta] = \beta$ if you can make an argument that $E[\epsilon]=0$. This is the assumption of "common trends" -- causal inference when controlling for all stable covariates, if time-varying shocks are balanced. This is distinct from random effects, which do not control for all time-invariant heterogeneity because random effects are basically the same thing as penalized fixed effects -- higher bias/lower variance.

Now, I'm interested in heterogeneity in response to $X$. Is it completely nonsensical to fit $$y_{it} = \alpha_i + X_{it}'\left(\beta+\beta_i\right) + \epsilon_{it}$$ where $\beta_i$ is $\mathcal{N}(0,\sigma_\beta)$?

This can also be viewed as a smoothing of a purely fixed varying coefficients model -- accepting bias to lower variance.

Given that we're assuming that the $\alpha$ IS correlated with $X$, are not these random coefficients basically biased, and thereby useless? If I were to accept bias, would I not want to specify the intercepts as random as well?

It sounds like it would be useful to think a little bit more carefully over why you want to include the random slopes $\beta_i$. I can think of two good reasons, and one bad reason.

Good reason 1. You are interested in the average heterogeneity in the time coefficient. Then $\sigma_\beta$ gives you just that--and you can get asymptotic confidence intervals, etc, if you so desire.

Good reason 2. You desire valid inference (standard errors or confidence intervals) on $\beta$ or $\alpha$ and you suspect temporal correlation ($Cov(\epsilon_{it_1}, \epsilon_{it_2}) \neq 0$) of a form that can be modeled with a random slope. You point out that if $E(\epsilon)=0$, then $E(\hat \beta) = \beta$, but your standard errors on $\beta$ will be invalid if there's unmodeled correlation in your data.

Bad reason 1. You want a way to sorta, kinda estimate the individual slopes $\beta_i$ but don't want to pay the cost of that many degrees of freedom.

The last motivation is probably a bad reason because the random effect model has that $\beta_i \perp \epsilon_i$ by construction--so leads to an uninterpretable mess if there is any sort of confounding, and by the very nature of caring about specific values of $\beta_i$ suggests that you think that some units might be special, hence confounded with $\epsilon_i$. For example, your coefficients will no longer maintain the interpretation of unit changes in the average of $y$ per unit changes in $x$, with all else held constant.

As far as the bias/variance tradeoff goes, you'd only accept that tradeoff if it leads to a smaller mean square error in estimating $\beta_i$, and it's not obvious to me that it always does with random effects models under confounding. The amount of shrinkage under random-effects is data-dependent, so perhaps you end up shrinking too much, or not enough. If you want lower MSE, you probably should just use ridge regression and tune with cross-validation. You might also play around with some simulations under your assumed data-generating model to see how the different models behave.

• Thanks. I was going for the bad reason, and it occurred to me that it might indeed be fatally flawed, after more work than I care to admit to. Your answer confirms my suspicions, and also gave me a couple of ideas that I hadn't seen before. – user57226 Oct 9 '14 at 0:17
• Actually, I've got a question for you: what if $\beta_i$ is correlated with time-invariant unobservables, but uncorrelated with time-varying observables, and I control for individual-level dummies (fixed effects)? I think that each individual has their own time-invariant slope, which is completely correlated with unmodeled factors $\alpha_i$, which I control for indirectly. But not correlated with time-varying shocks. Which is to say that $\beta_i \perp \epsilon_{it}|\alpha_i$. Does that work? Would there be some sort of Hausman test for this? – user57226 Oct 9 '14 at 0:52
• Again, I would suggest that it makes more sense to think of random effects as being ways to model residual correlation in your data after fitting the fixed effects of interest, rather than ways to identify fixed effects. For example, with a random intercept, you are assuming compound symmetric correlation structure, while a random slope implies a somewhat odd form of temporal dependence. As far as your particular question,you'd need to write down the equation of the model in question for there to be any hope to answer that. – Andrew M Oct 9 '14 at 17:19