* * Example from section 15.4.3, starting page 396 * open data nls_panel.dat calendar(panelobs=5) all 716//5 data(format=free,org=columns) 1//1 716//5 id year lwage hours age educ collgrad msp nev_mar $ not_smsa c_city south black union exper exper2 tenure tenure2 * preg(method=fixed) lwage # constant exper exper2 tenure tenure2 south union * linreg lwage # constant educ exper exper2 tenure tenure2 black south union mcov(cluster=%indiv(t)) / %resids # constant compute num=%cmom(1,1) mcov / %resids # constant compute den=%cmom(1,1) compute lm=.5*%nobs/(5-1)*((num/den-1.0))^2 cdf(title="Breusch-Pagan test") chisqr lm 1 * preg(method=random) lwage # constant educ exper exper2 tenure tenure2 black south union preg(method=random,vrandom=.1951^2,vindiv=.3291^2) lwage # constant educ exper exper2 tenure tenure2 black south union