I have a short panel dataset that I want to analyze. It contains panel data of multiple individuals. Each individual is assigned to 1 of 4 treatment groups and I am interested in the effect of these treatments. Basically I want to run this regression:

Y = X + Z + Condition (X, Z vary over time; Condition is a dummy variable and time-constant)

I can't use the fixed effects "within" model, because the variable I'm interested in will drop out - since it is time-invariant.

  • reformulated: I think the proper way to analyze this dataset regarding my variable of interest (Condition) is random effects.

However, I am not sure - is there a better way?

  • 1
    $\begingroup$ Questions solely about how software works are off-topic here, but you may have a real statistical question buried here. You may want to edit your question to clarify the underlying statistical issue. You may find that when you understand the statistical concepts involved, the software-specific elements are self-evident or at least easy to get from the documentation. $\endgroup$ Commented Jul 28, 2016 at 20:36
  • $\begingroup$ @newbie Is treatment random? $\endgroup$
    – dimitriy
    Commented Jul 30, 2016 at 4:24
  • $\begingroup$ yes, individuals are assigned to treatment conditions randomly $\endgroup$
    – newbie
    Commented Aug 1, 2016 at 13:37

2 Answers 2


You are correct. You can't use a fixed effects model to analyze the effect of a treatment that is assigned at the "group" level. In your case the "groups" are people and the individual observations are time points, "nested" within people.

The reason for this is including person fixed effects accounts for ALL possible between-person variation. This is great for when you are really interested in within-person variation, because you don't have to worry about ANY person level confounders. But in your case one of those person level differences is what treatment they got! So as you note trying to include a treatment variable along side person fixed effects will cause perfect multicollinearity and lead to the treatment variable being dropped.

So as you say, you need to use a random effects model. This in turn means that if you are worried about other person-level confounders (for example if older people were more likely to get treatment A) you also need to include variables for those confounders in your model.


I'm not familiar with plm, but I would assume that the between option runs your model on the group means such that you are only explaining between group variance in your outcome. That may be appropriate if that is the only variance of interest, but many people are interested in explaining both within and between outcome variance, and therefore use random effects models. You can always group mean center your within variables and add the group means of the predictors to your random effects model to get the best of both worlds!

  • $\begingroup$ Thanks a lot. is someone familiar with plm? $\endgroup$
    – newbie
    Commented Jul 28, 2016 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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