I am running a regression with panel data and there are some variables that do not change over time (industry,...). As I do not want the time trend to influence my results, I decided to use a time fixed effects model, but I do not plan to include individual fixed effects.

Now I know that normally, time-invariant variables cannot be included in a model with fixed effects. But as fas as I understand literature, this concerns individual fixed effects, not those where the time is fixed.

Am I correct in assuming, that if I use only time fixed effects, time-invariant variables can still be used in the regression model? Unfortunately I was not able to find a solution in my statistic books.

Thank you very much for any help!



You are using the fixed effects model, or also within model. This regression model eliminates the time invariant fixed effects through the within transformation (i.e., subtract the average through time of a variable to each observation on that variable).

And probably you are making confusion between individual and time fixed effects. Time fixed effects change through time, while individual fixed effects change across individuals.

Think of time fixed effects as a series of time specific dummy variables. For example, the dummy variable for year1992 = 1 when t=1992 and 0 when t!=1992. You see immediately that if you take the average of year1992 through time, it will be <1, so this dummy won't be eliminated. So you will get an estimate for the coefficient for the effect of being in 1992.

The thing is different for individual fixed effect. Also in this case, think of individual dummy variables. For example, the dummy for individual j = 1 along the whole time period you are considering. The average of j is exactly 1, you subtract its average through time and sim-sala-bim...it is eliminated by the within transformation. Therefore, you won't get an estimate of the effect of being individual j.


Yes, you are right. Here is a little example where the additional variable timeconstantvariable does not have variation over time but nevertheless has an estimated coefficient when estimating the model with time effects only:

m = 8
n = 12

step = 3
alpha = runif(n,seq(0,step*n,by=step),seq(step,step*n+step,by=step))
beta = -2
y = X = matrix(NA,nrow=m,ncol=n)
for (i in 1:n) {
  X[,i] = runif(m,i,i+1)
  X[,i] = rnorm(m,i)
  y[,i] = alpha[i] + X[,i]*beta + rnorm(m,sd=.75)  
stackX = as.vector(X)
stackY = as.vector(y)

paneldata = data.frame(rep(1:n,each=m),rep(1:m,n),stackY,stackX) # first two columns are for plm to understand the panel structure
paneldata$crosssectionconstantvariable <- 2*paneldata$rep.1.m..n.
paneldata$timeconstantvariable <- 2*paneldata$rep.1.n..each...m.

timeeffects <- plm(stackY~stackX+timeconstantvariable, data = paneldata,  model = "within", effect = "time")


> summary(timeeffects)
Oneway (time) effect Within Model

plm(formula = stackY ~ stackX + timeconstantvariable, data = paneldata, 
    effect = "time", model = "within")

Balanced Panel: n=12, T=8, N=96

Residuals :
   Min. 1st Qu.  Median 3rd Qu.    Max. 
 -2.300  -0.636  -0.037   0.610   1.990 

Coefficients :
                      Estimate Std. Error t-value  Pr(>|t|)    
stackX               -2.022522   0.124605 -16.232 < 2.2e-16 ***
timeconstantvariable  1.514538   0.063207  23.961 < 2.2e-16 ***
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Total Sum of Squares:    1547.4
Residual Sum of Squares: 81.512
R-Squared:      0.94732
Adj. R-Squared: 0.84864
F-statistic: 773.312 on 2 and 86 DF, p-value: < 2.22e-16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.