Many applications in econometrics involve controlling for so called fixed effects (FE). That is, including a dummy variable for each e.g state, year, firm e.t.c. The reason for including FE’s are many and varies depending on the context but what it does is broadly controlling for things that are omitted and in the case of “entity fixed effects” (which I will focus on here) these are omitted variabels that can vary over time but not within entity. For example, say that you are trying to explain voting behavior across states with income. Regressing a dummy of republican/democratic governance on income (with the dummy being equal to unity if republican governance) one omitted variable might be culture. If culture varies by state and roughly constant over time you can control for that by including state fixed effects. That is the simple explanation with a highly stylized example. Rather, in most cases the reason for including FE’s can be pretty vague and difficult to grasp what they are actually doing in practice. Hence, I have decided to try to make an intuitive graphical explanation of FE’s.
Consider the case that you would like to know the (casual) relationship between wage and tenure. You have collected data from three firms and drawn a sample of 30 individuals in each. I have generated this example data such that mean wage is firm specific so,
with and . The graph below depicts the relationship between wage and tenure with a highly significant OLS estimate of 640.47 running the regression where is individual and firm. Hence there is a clear correlation(!) between wage and tenure.
But there is something fishy with this estimate. It is not a causal estimate of the effect of tenure on wage. Rather, if we look at the data above, it appears as if it is all driven by which firm you work at! This is an omitted variable that can be dealt with using firm FE’s. In fact, I constructed the data so that there should be no causal effect of tenure on wage. Let’s look at the regressions within firms depicted in the figure below,
As you can see, there is no clear positive pattern and each separate firm regression has not significantly different from zero. But we don’t want to run three separate regressions. Rather we want to control for the effects on wage caused by the firm itself. What we do is we run the same regression as above but include firm FE’s (i.e. a dummy variable for each firm),
What this effectively does is estimating the relationship between wage and tenure within(!) each firm and weights the coefficients into one which controls for the effect on wage coming from the firm specific component. delivers the weighted average effect of tenure on wage holding constant which firm an individual is working in. The graph below depicts the residualized wage and the linear fit has the slope of . Note how residualizing wage from firm FE’s demeans everything and “levels out” the playing field.
One interesting feature which I cannot explain is why the average of the estimates from the firm specific regressions . My prior was that the single FE estimate would be the plain average of these three coefficients as there are equal number of observations in each firm but it turns out it isn’t. If somebody knows why this is drop a comment or email me. Or I might make a new post out of it once I figure it out.