5
$\begingroup$

In "R - project" I am trying to estimate the panel data lm model with plm function. When I include 3 dummy variables into the regression it doesn't appear in the summary of the model, but when I estimate a simple lm model it appears.

Why is it so? What should I do to estimate the statistics for those dummy variables?

$\endgroup$
6
  • $\begingroup$ Hi there, welcome to the site. Could you post the lm code that you are using - both sets? $\endgroup$
    – Michelle
    Mar 15, 2012 at 6:14
  • $\begingroup$ Hello. the code is : model.FE<- plm(income~area+weight+dproduct+dummy1+dummy2+dummy3,data=panel, model = "within") $\endgroup$
    – Ieva
    Mar 15, 2012 at 6:37
  • 1
    $\begingroup$ Have you tried to specify your dummy variable with all the levels as a factor (use as.factor) and then entered it into plm as factor(mydummy)? That was how Year was entered into the model on p.17 of the package vignette: cran.r-project.org/web/packages/plm/vignettes/plm.pdf $\endgroup$
    – Michelle
    Mar 15, 2012 at 6:45
  • 2
    $\begingroup$ I think these comments would be more appropriate to incorporated into your question. $\endgroup$ Mar 15, 2012 at 8:16
  • 1
    $\begingroup$ @RomanLuštrik I agree, and more information on the variables would be good too. :) $\endgroup$
    – Michelle
    Mar 15, 2012 at 9:27

2 Answers 2

4
$\begingroup$

A possible reason might be that your dummies do not vary over time. In this case, the fixed effects estimator and first differencing will remove such variables from the model. The reason is that these estimators cannot identify variables that do not vary over time because those variables will be eliminated together with the unobserved fixed effects.

As an alternative you can try to use random effects and use a Hausman test to see whether random effects gives significantly different results from fixed effects. If not, you can use random effects. One problem with this approach is that the models are only comparable if they include the same variables. So for the Hausman test you should first exclude the dummies from the random effects model, too.

$\endgroup$
3
$\begingroup$

Another possibility is that the dummy variables are (very close to) co-linear. In this case, plm will automatically exclude the co-linear variables from its output. One way to check this is to run the model, and check the aliased object:

model.FE<- plm(income~area+weight+dproduct+dummy1+dummy2+dummy3,data=pa‌​nel, model = "within")
model.FE$aliased

If model.FE$aliased reports TRUE for any of the dummies, then they are linearly dependent (or very close being so). In that case, go back and check that dummy1,dummy2, and dummy3 are sufficiently different.

$\endgroup$

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.