options double crt nwidth=17,signif=9; name glr 'LR and Wald tests for random effects and serial correlation'; ? LR and Wald versions of the LM tests. ? by Clint Cummins 9/04 ? Data Source: Grunfeld (1958) ? Description: Panel Data, 10 U.S. firms over 20 years, 1935-1954. ? Variables: doc FN 'Firm Number'; doc YR 'Year 1935-1954'; doc I 'Annual real gross investment'; doc F 'Real value of the firm (shares outstanding)'; doc K 'Real value of the capital stock'; list vars FN YR I F K; const n,10 t,20 ystart,1935; set nt=n*t; smpl 1,nt; read(file='grunfeld.txt') vars; freq(panel,n=n,t=t,id=FN,time=YR,start=ystart) a; panel(rei) i c f k; set logl_0 = @loglt; set logl_mu = @loglrei; set W_mu = @TREI(4)**2; print W_mu; ar1 i c f k; set logl_rho = @logl; set W_rho = @T(4)**2; print W_rho; ar1(rei) i c f k; set logl_murho = @logl; set W_rhoS = @T(4)**2; set W_muS = @T(5)**2; frml erho rho; frml erhoi rho_i; analyz erho erhoi; set W_murho = @WALD; print W_mu W_muS W_rho W_rhoS W_murho; ? Benchmark ? ? LR statistic p-value ? LR_mu 193.090781907 .000000000 ? LR_mu* 2.251032295 .133525302 ? LR_rho 303.019854961 .000000000 ? LR_rho* 112.180105348 .000000000 ? LR_murho 305.270887256 .000000000 ? ? Logl_0 -1191.802360368 ? Logl_mu -1095.256969414 ? Logl_rho -1040.292432887 ? Logl_murho -1039.166916740 ? ? Wald statistic p-value ? W_mu 50.566219034 .000000000 ? W_mu* 40.739012709 .000000000 ? W_rho 1264.589760379 .000000000 ? W_rho* 131.242837089 .000000000 ? W_murho 239.175118327 .000000000 print logl_0 logl_mu logl_rho logl_murho; title 'LR test for individual random effects'; set LR_mu = 2*(logl_mu - logl_0); set LR_muS = 2*(logl_murho - logl_rho); ? modified version cdf(chisq,df=1) LR_mu %LR_mu; cdf(chisq,df=1) LR_muS %LR_muS; print LR_mu LR_muS %LR_mu %LR_muS; title 'LR test for serial correlation'; set LR_rho = 2*(logl_rho - logl_0); set LR_rhoS = 2*(logl_murho - logl_mu); ? modified version cdf(chisq,df=1) LR_rho %LR_rho; cdf(chisq,df=1) LR_rhoS %LR_rhoS; print LR_rho LR_rhoS %LR_rho %LR_rhoS; title 'joint test for individual random effects and serial correlation'; set LR_murho = 2*(logl_murho - logl_0); cdf(chisq,df=2) LR_murho %LR_murho; print LR_murho %LR_murho; ? Note: the one-sided test for individual random effects ? is not computed, because in TSP's implementation, RHO_I, the ? intraclass correlation coefficient can be (slightly) negative.