1
$\begingroup$

I'm using panel data in my study.

So far, already done the analysis with xtreg, for re and fe, and Hausman test yielded that I should use re.

However, when I wanted to test for Heteroscedasticity, I could not find a command specified for re.

$\endgroup$
4
  • $\begingroup$ Did you look at the residuals from the xtreg model? Are they showing any signs of heteroskedasticity? You can always get standard errors that are robust to heteroskedasticity using the robust option in your xtreg model statement. $\endgroup$
    – Erik Ruzek
    Commented Apr 6, 2020 at 14:18
  • $\begingroup$ Thanks for your replay. Do you mean the command xtreg y x, re, can show heteroskedasticity? For fixed effect, the command is xttest3, but it can not be applied for random effect. This is why I was confused, as I failed to find a command that suits RE. $\endgroup$
    – Joseph
    Commented Apr 6, 2020 at 15:37
  • $\begingroup$ @ErikRuzek, can you please look into this stats.stackexchange.com/questions/458826/… $\endgroup$
    – Joseph
    Commented Apr 6, 2020 at 17:27
  • $\begingroup$ I am not familiar with tests for this. I was referring to a visual inspection. I'll post some Stata code as an answer. $\endgroup$
    – Erik Ruzek
    Commented Apr 6, 2020 at 18:33

1 Answer 1

1
$\begingroup$

Welcome to the site, Joseph. I have not personally used tests for heteroskedasticity in the residual errors, however, you can get a read of whether you have any problems by looking at a couple of plots of your residual values. One common plot is a residual vs. fitted values plot, which you generally like to see having a nebulous cloud pattern. If you switch from xtreg to mixed, below I've pasted code to pull the residuals and fitted values from your model and then plot it:

mixed dv iv || clusterID: 
predict sresid, rstandard // standardized level 1 residuals
predict predval, xb // predicted outcome value
scatter sresid predval // cloud graph – hopefully no pattern

You can also examine the normality of your residuals using a Q-Q plot, which plots the residuals as a function of a normal distribution, but stretched out along a line. Major deviations of residual points from the normal line are a problem.

*Level 1 residuals vs. normal scores graph
qnorm sresid // residuals should fall along the line

Although not all Stata-specific, there are many good resources for diagnosing any abnormality in your residuals.

$\endgroup$
0

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