# Testing for heteroskedasticity in panel data vs time series?

I watched this video on how to check for heteroskedasticity using Stata, and it helped me a lot. But the data example in the video was time series data.

He used the Bruesh-Pagan test.

hettest dependntvar1 dependvar2 dependvar3 ... dv6


And the output was like

Breusch-Pagan / Cook-Weisberg test for heteroskedasticity
Ho: Constant variance
Variables: dependntvar1 dependvar2 dependvar3 ... dv6

chi2(6)     =  86.56
Prob > chi2  =   0.0000


The Ho had a p-value of 0.0000 so it had heteroskedasticity.

Does it work the same for panel data?

If not, how do I test for heteroskedasticity on panel data?

• In stata, you can test for heteroskedasticity of panel data specifically. The following link may help. stata.com/support/faqs/statistics/… Mar 25, 2016 at 13:03
• @DornerA, yeah that was very helpful, thank you. But a little too technical for me to fully digest it. Is there dumbed-down explanation somewhere? Or one with pictures/graphs? maybe that would help even more.
– user4207
Mar 26, 2016 at 0:28

You can regress residual squares (from RE or FE depending on your estimation) on $X_{it} \hat\beta$ and its square using the clustered standard errors (the vce(cl id) option), and read the F statistic and the associated p value. This is basically the same as Het test for cross sectional models (White's simplified test).

xtreg y x1 x2, re
predict uhat, ue
predict xb, xb
gen uhatsq = uhat^2
reg uhatsq c.xb##c.xb, vce(cl id)
testparm c.xb##c.xb


Another test is for groupwise heteroskedasticity proposed by Greene (2000). This test assumes that the variance of the error term is $\sigma_i^2$ (no heteroskedasticity over $t$) and then test whether $\sigma_i^2$ is the same for all $i$. You can do it using the xttest3 module. The xttest3 manual says:

In terms of small sample properties, simulations of the test statistic have shown that its power is very low in the context of fixed effects with "large N, small T" panels. In that circumstance, the test should be used with caution.