4

Is it possible to use xttest0 in Stata with unbalanced panel data? I want to test whether the I should use pooled OLS or random effects estimation.

What does this test actually do?

Andy
  • 18,070
  • 20
  • 77
  • 100
daja
  • 377
  • 1
  • 5
  • 12
  • from your profile I saw that you have asked 14 questions but you never accepted any answers nor voted up any answers. This is not how the site works. If you are happy with answers please consider accepting/up-voting them. You can do so by ticking the check mark underneath the vote buttons. Voting and accepting answers is a small appreciation for those who spend their free time in order to help you. Writing a good answer takes about 15-20 minutes. Upvoting/accepting takes only one or two clicks with the mouse :-) – Andy Jul 02 '14 at 09:21
  • Ok did not know that. – daja Jul 04 '14 at 08:13

2 Answers2

6

The null hypothesis in Stata's xttest0 command is that the variance of the unobserved fixed effects is zero, i.e. var(u) = 0. Rejecting this hypothesis means that pooled OLS might not be the appropriate model given that it assumes an error structure $\sigma^2 I_{NT}$. If you have unbalanced panel data you can perform the Breusch-Pagan LM test with the xttest1 command. For a description and more information on this command type

net install sg164_1.pkg
help xttest1

If you want to test whether you should use fixed effects or random effects, you will have to check this with the Hausman test. You can perform this test with the hausman command or, if you have used robust or cluster robust errors, with xtoverid. For the latter command see the help file which includes at the bottom an example of how to test fixed versus random effects.

Andy
  • 18,070
  • 20
  • 77
  • 100
  • Thanks for the answer. It is not possible for me to install xttest1? After writing this question I found one note saying that xttest0 has been modified and can be used for unblanced panels too? – daja Jul 04 '14 at 08:19
  • http://www.stata.com/manuals13/xtxtregpostestimation.pdf – daja Jul 04 '14 at 08:20
0
lm[code,t] = Xb + u[code] + e[code,t]

Estimated results:
                 |       Var     sd = sqrt(Var)
        ---------+-----------------------------
              lm |   .4200004       .6480744
               e |   .0110228       .1049893
               u |   .2056455       .4534815

Test:   Var(u) = 0
                      chi2(1) =   348.01
                  Prob > chi2 =     0.0000
gung - Reinstate Monica
  • 132,789
  • 81
  • 357
  • 650