options double crt nwidth=17,signif=9; name grfere 'Grunfeld data - Fixed and Random Effects'; ? Static Panel Model, balanced (stacked) data: ? Pooled OLS, Fixed Individual Effects, Random Individual Effects (ML), ? Fixed Time Effects, Fixed Time & Individual Effects, ? Random Time Effects, Random Time & Individual Effects. ? Follows: ? Nerlove, Marc, "Likelihood Inference in Econometrics," ? Academic Press, forthcoming 2000. ? Baltagi, Badi, "Econometric Analysis of Panel Data", New York: Wiley, 1995 ? (the second edition has the same results, with fewer reported digits) ? by Clint Cummins 11/1999, updated 8/2002 const n,10 t,20 ystart,1935; ? We do not use FREQ PANEL here, because later in the run, ? we sort by year instead of by firm, to get the means by ? year for the 2-way random effects. ?freq(panel,n=n,t=t,id=firm,time=year,start=ystart) a; set nt = n*t; smpl 1,nt; ? Data for all 10 firms, 20 years, in Boot and de Wit, IER (1960); ? downloaded from Springer-Verlag web page: ? http://www.springer.de/economics/samsup/baltagi , 10/99 ? Data also printed in Maddala, Econometrics, 1977, p.214-215. ? ? The firm names (roughly in order by size) are G.M., U.S. Steel, G.E., ? Chrysler, Atlantic Richfield (or Refining), I.B.M., Union Oil, ? Westinghouse, Goodyear, and Diamond Match. This ordering may not ? match the data file used here. ? The years are 1935-1954. ? Variables are: ? I = gross investment ? F = value of the firm, lagged by one year ? K = value of firm capital stock (plant and equipment), lagged by one year ? ? There is an error in what Maddala used for I for Atlantic Richfield, ? 1953 -- the correct number, according to Boot and de Wit is 91.90 ? (this was the one also used by Baltagi), while Maddala used 81.90 . ? The data was verified by running the regressions by firm, on p.216 ? of Maddala; all are replicated except for Atlantic Richfield, due ? to the data error. ? read(file='grunfeld.dat') firm year i f k; title 'plot the data, to see how firm sizes vary'; options display=svga; freq(panel,n=n,t=t,id=firm,time=year,start=ystart) a; plot(preview) i; ? panel graphics in TSP 4.5, 5/2001 ?plot(preview) i(-1); ? to make separate lines for each company freq n; list yx i f k; trend obs; title 'fixed individual effects'; ? Benchmarks: Baltagi(1995), p.20 ? ? 1. Pooled OLS / Total ? Baltagi TSP ? F .11556 .1155621564 ? (SEdf) (.00584) (.005835709557) ? K .23068 .2306784887 ? (.02548) (.0254758015) ? Constant ? -42.71436944 ? ? (9.511676031) ? LogL ? -1191.802360368 ? SBIC ? 1199.749836418 ? dfk 3 ? ? 2. Fixed Individual Effects / Within Firm ? Baltagi TSP ? F .11012 .1101238041 ? (SEdf) (.01186) (.0118566942) ? K .31007 .3100653413 ? (.01735) (.0173545028) ? LogL ? -1070.781026499 ? SBIC ? 1102.570930698 ? dfk 12 ? Notes: ? 1. The SBIC was computed as -LogL + dfk*log(NT)/2, where dfk ? is the number of estimated parameters, not counting sigma**2. ? 2. (SEdf) is the Standard Error, computed with the usual ? degrees of freedom correction for t-statistics in OLS. panel(nobet,t=t) yx; title 'Log Likelihood for the different models'; clogl @ssrt logl_pooled 3; clogl @ssrw logl_within_firm 12; Proc clogl ssr logl dfk; set logl = -(@nob/2)*(log(ssr/@nob) + 2.837877066409345); set sbic = -logl + dfk*log(@nob)/2; print logl sbic; endproc; Proc csbic logl dfk nobneq; set sbic = -logl + dfk*log(nobneq)/2; print sbic; endproc; title 'plot fitted values for pooled and fixed effects'; ? This plot shows that the first (largest) firm dominates ? the fit, and the 4th firm also fits well. The 2nd, 3rd, ? and 5th firms are not fit very well, especially by pooled OLS. ipool = i - @rest; ifixed = i - @resw; freq(panel,n=n,t=t,id=firm,time=year,start=ystart) a; plot(preview,title='fitted values for pooled and fixed effects') i ipool ifixed; ? panel graphics in TSP 4.5, 5/2001 ?plot(preview,title='fitted values for pooled and fixed effects') ? i(-1) ipool(-1) ifixed(-1); ? the lag is used to separate the lines by firm freq n; title 'ML random individual effects'; ? Benchmark: Baltagi(1995), p.20, Nerlove(2000), Chapter 19, Table 3.1 ? ? 3. Random Individual Effects (1-way; 2 variance components) ? Baltagi Nerlove TSP ? F .10976 .109763 .1097626545 ? (SEasy) (.01042) (.0103388) (.0103389314) ? K .30794 .307942 .3079419742 ? (.01720) (.0171007) (.0171007171) ? Constant ? ? -57.76720491 ? ? ? (27.70005214) ? RHO .700 .700595 .7005942569 ? ? (.0985193) (.0985227059) ? SIGMA2 ? ? 9203.121800 ? ? ? (2963.311856) ? LogL ? ? -1095.256969 ? SBIC ? ? 1105.853604147 ? dfk 4 ? Notes: ? 1. The Constant (intercept, or alpha) was eliminated by Nerlove, ? by removing the overall means. ? 2. RHO = sigma_mu**2/sigma**2, the intra-class correlation coefficient. ? For Baltagi's results RHO is computed from theta = .855 . ? 3. (SEasy) is the asymptotic Standard Error, computed without any ? degrees of freedom correction. Standard errors in TSP are from ? analytic second derivatives. TSP uses the unconcentrated Log ? likelihood, parameterized with sigma**2. This can affect the ? value of the standard error of RHO. ? 4. The SBIC was computed as -LogL + dfk*log(NT)/2, where dfk ? is the number of estimated parameters, not counting sigma**2. ? starting values from pooled OLS unmake @coeft beta1 beta2 beta0; set sigma2 = @s2t; param beta0 beta1 beta2 sigma2 rho,.5; ? replicate individual means across all time periods select year=ystart; unmake @mean iibar fibar kibar; select year>ystart; dot yx; .ibar = .ibar(-1); frml .star (. - .ibar)/sqrt(eta) + .ibar/sqrt(xi); enddot; select 1; ? Use Nerlove(2000) formulation and parameterization of the log likelihood frml rei logl = -log(sigma2)/2 + lnorm(e/sqrt(sigma2)) -log(xi)/(2*T) - log(eta)*((T-1)/(2*T)); frml xi 1 + rho*T - rho; frml eta 1 - rho; frml e istar - beta1*fstar - beta2*kstar - beta0/sqrt(xi); eqsub rei e istar fstar kstar xi eta; ML(hiter=n,hcov=nbw,tol=1e-11) rei; csbic @logl 4 @nob; ? computation for RHO from Baltagi(1995) const theta,.855; set a1 = (1-theta)**2; set b1 = (1-a1)/(a1*T); set rho_b = b1/(b1+1); print rho_b; title 'fixed time effects'; ? Benchmarks: Nerlove(2000), Chapter 19, Table 3.1, draft ? ? 4. Fixed Time Effects / Within Year ? Nerlove TSP ? F .0992524 .1167977921 ? (SEdf) (.006331302428) ? (SEasy) (.00586072) ? K .260214 .2197065785 ? (SEdf) (.0322961073) ? (SEasy) (.00716519) ? LogL ? -1189.329998128 ? SBIC ? 1247.611489160 ? dfk 22 ? ? 5. Fixed Individual & Time Effects / Within Firm & Year ? Nerlove TSP ? F .117716 .1177158551 ? (SEdf) (.0137512830) ? (SEasy) (.0126407) ? K .357916 .3579162731 ? (SEdf) (.0227190109) ? (SEasy) (.0208842) ? LogL ? -1056.132248270 ? SBIC ? 1138.256167451 ? dfk 31 ? Notes: ? 1. The plain fixed time effects results (4.) for TSP were ? also checked by running OLS with a full set of dummies, ? so apparently there is an error in the Nerlove results ? for the plain fixed time effects. dummy(exclude) year dyears; panel(nobet,novarc,t=t) yx dyears; clogl @ssrt logl_within_year 22; clogl @ssrw logl_within_firm_year 31; title 'ML random time effects'; ? Benchmark: Nerlove(2000), Chapter 19, Table 3.1, draft ? ? 6. Random Time Effects (1-way; 2 variance components) ? Nerlove TSP ? F .114684 .1135407070 ? (SEasy) (.00572115) (.005634288498) ? K .237154 .2433613350 ? (.0220455) (.0178575875) ? Constant ? -44.02848896 ? ? (6.714864755) ? OMEGA -.0582145 -.0859296079 ? (.0235143) (.008294026709) ? SIGMA2 ? 8790.919802 ? ? (908.4590128) ? LogL -1190.8 -1184.510236 ? SBIC ? 1195.106870456 ? dfk 4 ? Notes: ? 1. OMEGA = sigma_t**2/sigma**2, the intra-year correlation coefficient. ? resort data by year, and run PANEL by year instead of by individual const fstart,1; isort = year*100 + firm; sort(all) isort; panel(nobet,novarc,t=n) yx; clogl @ssrw logl_within_year 22; ? replicate time means across all individuals select firm=fstart; unmake @mean itbar ftbar ktbar; select firm>fstart; dot yx; .tbar = .tbar(-1); frml .dt (. - .tbar)/sqrt(gamma24) + .tbar/sqrt(gamma13); enddot; select 1; frml ret logl = -log(sigma2)/2 + lnorm(edt/sqrt(sigma2)) -log(gamma13)/(2*N) - log(gamma24)*((N-1)/(2*N)); frml gamma13 1 + omega*N - omega; frml gamma24 1 - omega; frml edt idt - beta1*fdt - beta2*kdt - beta0/sqrt(gamma13); eqsub ret edt idt fdt kdt gamma13 gamma24; param omega,.5; ML(hiter=n,hcov=nbw,tol=1e-11) ret; csbic @logl 4 @nob; title '3 component case'; ? Benchmark: Baltagi(1995) ? ? 7. Random Individual & Time Effects (2-way; 3 variance components) ? Baltagi TSP ? F .10990 .1099012904 ? (SEasy) (.01046) (.0104332146) ? K .30923 .3092293588 ? (.01735) (.0199083050) ? Constant ? -58.27250500 ? ? (28.03795073) ? RHO .701 .7012154144 ? ? (.0985004983) ? OMEGA .00161 .001620361060 ? ? (.0127835612) ? SIGMA2 ? 9221.265249 ? ? (2975.101179) ? LogL -1341.293 -1095.248524 ? SBIC 1108.494317103 ? dfk 5 ? Notes: ? 1. RHO and OMEGA for Baltagi are computed from his theta1, theta2. ? 2. The LogL from Baltagi must be using some normalization, ? because it should be higher than the LogL for the one-way ? effects reported in other benchmarks above. The TSP LogL ? has also been reproduced with the methods of Davis, Journal ? of Econometrics, January 2002. ? overall means msd(noprint) yx; dot(index=j) yx; .bar = @mean(j); frml .d3 .bar/sqrt(gamma1) + (.ibar - .bar)/sqrt(gamma2) + (.tbar - .bar)/sqrt(gamma3) + (. - .ibar - .tbar + .bar)/sqrt(gamma4) ; enddot; frml re3 logl = -log(sigma2)/2 + lnorm(ed3/sqrt(sigma2)) -( log(gamma1) + log(gamma2)*(N-1) + log(gamma3)*(T-1) + log(gamma4)*(N-1)*(T-1) )/(2*N*T); frml gamma1 1-rho-omega + T*rho + N*omega; frml gamma2 1-rho-omega + T*rho; frml gamma3 1-rho-omega + N*omega; frml gamma4 1-rho-omega; frml ed3 id3 - beta1*fd3 - beta2*kd3 - beta0/sqrt(gamma1); eqsub re3 ed3 id3 fd3 kd3 gamma1-gamma4; param rho,0; ML(hiter=n,hcov=nbw,tol=1e-11) re3; csbic @logl 5 @nob; ? computation for RHO, OMEGA from Baltagi(1995) const theta1,.856 theta2,.026; set a1 = (1-theta1)**2; ? a1 = sigma_v**2/lambda_2 set a2 = (1-theta2)**2; ? a2 = sigma_v**2/lambda_3 set b1 = (1-a1)/(a1*T); ? b1 = sigma_mu**2/sigma_v**2 set b2 = (1-a2)/(a2*N); ? b2 = sigma_lambda**2/sigma_v**2 set rho_b = b1/(b1+b2+1); set omega_b = b2/(b1+b2+1); print rho_b,omega_b; title 'reproduce firm-only effects'; const omega,0; param rho,.5; ML(hiter=n,hcov=nbw,tol=1e-11) re3; title 'reproduce time-only effects'; const rho,0; param omega,.5; ML(hiter=n,hcov=nbw,tol=1e-11) re3;