options double crt nwidth=17,signif=9; name gscore 'Score tests for random effects and serial correlation'; ? Following A.K. Bera, W. Sosa-Escudero and M. Yoon, "Tests for ? the error components model in the presence of misspecification", ? Journal of Econometrics, 3/2001, p.1-24. ? Using the Greene version of the Grunfeld dataset, ? with 5 of the 10 firms. ? by Clint Cummins 5/01 ? added p-values 5/02 const n,5 t,20 ystart,1935; set nt = n*t; smpl 1,nt; read(file='grun5.dat') year firm i f k; ols i c f k; set ssro = @ssr; u = @res; ulag = 0; ? zero for first obs of ulag for each firm select year > ystart; ulag = u(-1); mat upu2T = u'u; ? denominator sum from 2 to T follows Baltagi and Li (1991) select 1; mat upul = u'ulag; set B_1 = upul/ssro; ? apparent calculation from (10) set B = upul/upu2T; ? actual calculation used for Table 1 freq(panel,n=n,t=t,id=firm,time=year,start=ystart) a; panel(noreg,silent) u c; ? to compute mean of U by firm, for A mat sumu = @mean*T; mat A = 1 - (sumu'sumu)/ssro; ? Benchmark - row 2 from Table 1 of Bera, et al (2001) ? ? Bera(2001) TSP 4.5 ? RS_mu 453.822 453.822057293 ? RS_mu* 384.183 384.183227882 ? RS_rho 73.351 73.351322989 ? RS_rho* 3.712 3.712493578 ? RS_murho 457.535 457.534550871 ? RSO_mu 21.303 21.303099711 ? RSO_mu* 19.605 19.600592539 ? ? Notes: ? 1. TSP reproduces the Bera et al results to all reported ? digits, except for the last digit of RSO_mu*, which is apparently ? a typographical error. title 'Breusch-Pagan(1980) test for individual random effects'; set RS_mu = NT*A**2/[2*(T-1)]; set RS_muS = NT*(A+2*B)**2/[2*(T-1)*(1-(2/T))]; ? modified version cdf(chisq,df=1) RS_mu %RS_mu; cdf(chisq,df=1) RS_muS %RS_muS; print RS_mu RS_muS %RS_mu %RS_muS; title 'LM test for serial correlation'; title 'Baltagi and Li (1991, 1995)'; set RS_rho = N*T**2*B**2/[(T-1)]; set RS_rhoS = N*T**2*(B+A/T)**2/[(T-1)*(1-(2/T))]; ? modified version cdf(chisq,df=1) RS_rho %RS_rho; cdf(chisq,df=1) RS_rhoS %RS_rhoS; print RS_rho RS_rhoS %RS_rho %RS_rhoS; title 'joint test for individual random effects and serial correlation'; title 'Baltagi and Li (1991, 1995)'; set RS_murho = N*T**2*(A**2+4*A*B+2*T*B**2)/[2*(T-1)*(T-2)]; cdf(chisq,df=2) RS_murho %RS_murho; print RS_murho %RS_murho; title 'one-sided test for individual random effects'; set RSO_mu = sqrt(RS_mu); set RSO_muS = sqrt(RS_muS); ? modified version - Honda (1985) cdf(normal,uptail) RSO_mu %RSO_mu; cdf(normal,uptail) RSO_muS %RSO_muS; print RSO_mu RSO_muS %RSO_mu %RSO_muS;