options crt limwarn=0 ; name usbalpim "Chamberlain's PI Matrix with Measurement Error" ; ? ? This run illustrates the use of Chamberlain's PI Matrix ? methodology to estimate a panel data model with a single ? indepedent variable which is measured with error (serially ? uncorrelated). Fixed (correlated) firm effects whose ? coefficient may change over time are allowed for. There ? are 3 basic models, each estimated with and without meas. ? error: ? 1) No fixed effects, just y(t) = b*x(t) + u(t) ? 2) Fixed effects, the projection of alpha(i) on the ? x's from all 6 years (1983-1988). ? 3) Fixed effects with time-varying coefficients ? lambda(t). ? ? Chi-squared tests for the presence of measurement error ? are computed after estimating each pair of models. ? ? References are Chamberlain, Journal of Econometrics (1982) ? and the chapter on Panel Data, Handbook of Econometrics, ? North-Holland. ? input fitest ; ? Fetch fitest PROC. ? input rdusbal ; ? Reads in data and makes variables. ? ? Define equation for each year; only use the last 3 years ? of data, as an example. ? dot 86-88 ; frml pieq. sl.= pi.83*cl83+pi.84*cl84+pi.85*cl85 + pi.86*cl86+pi.87*cl87+pi.88*cl88 ; param pi.83-pi.88 .1 ; enddot ; list sl sl86-sl88 ; list cl cl83-cl88 ; list ulist u86-u88 ; list pieqs pieq86-pieq88 ; ? ? Estimate the covariance matrix of the Xs for the measurement ? error model. Elements from X'X (-1) will be put into the PI ? equations as constants. ? cova cl86-cl88 ; mat covai = @cova" ; mform(type=gen) covai ; list xxi x8686-x8688 x8786-x8788 x8886-x8888 ; unmake covai xxi ; const xxi ; print xxi ; ? ? Calculate the PI matrix estimates using SUR. The robust ? covariance matrix of the estimates is an estimate of OMEGA ? in Chamberlain's notation. ? sur(noprint,hcov=r) pieqs ; list pilist pi8683-pi8688 pi8783-pi8788 pi8883-pi8888 ; list pieqlist pieq8683-pieq8688 pieq8783-pieq8788 pieq8883-pieq8888 ; copy @vcov omega ; ? ? Make the PIs into series. ? smpl 1 1 ; dot pilist ; genr s. = . ; enddot ; ? ? This model is the one discussed by Chamberlain under strict ? exogeneity, with the addition of serially uncorrelated ? measurement error. ? dot 83-85 ; frml pieq86. spi86. = lam86*gam. ; frml pieq87. spi87. = lam87*gam. ; frml pieq88. spi88. = lam88*gam. ; enddot ; frml pieq8686 spi8686 = lam86*gam86 + beta1*(1-sigw1*x8686) ; frml pieq8687 spi8687 = lam86*gam87 - beta1*sigw1*x8687 ; frml pieq8688 spi8688 = lam86*gam88 - beta1*sigw1*x8688 ; frml pieq8786 spi8786 = lam87*gam86 - beta1*sigw2*x8786 ; frml pieq8787 spi8787 = lam87*gam87 + beta1*(1-sigw2*x8787) ; frml pieq8788 spi8788 = lam87*gam88 - beta1*sigw2*x8788 ; frml pieq8886 spi8886 = lam88*gam86 - beta1*sigw3*x8886 ; frml pieq8887 spi8887 = lam88*gam87 - beta1*sigw3*x8887 ; frml pieq8888 spi8888 = lam88*gam88 + beta1*(1-sigw3*x8888) ; ? title "No Effects - No Lags - Meas. Error" ; ? const lam86 0 lam87 0 lam88 0 beta2 0 beta3 0 ; const gam83-gam88 ; param beta1 .357 sigw1 .1 sigw2 .1 sigw3 .1 ; sur(silent,wname=omega) pieqlist ; fitest traceu dfu ; ? title "No Effects - No Lags - No Meas. Error" ; ? const sigw1 0 sigw2 0 sigw3 0 ; sur(silent,wname=omega) pieqlist ; fitest tracec dfc ; ? title "Test for Measurement Error" ; ? set chisqme = tracec-traceu ; set ndf = dfc-dfu ; cdf (chisq,df=ndf) chisqme ; ? ? Impose random (correlated) effects assumptions. The trace ? reported by TSP is distributed chi-squared with degrees of ? freedom = #constraints = M*K-#params under the null (constrained) ? hypothesis. In the FE case, that means DF = 3*6-1-6 = 11. ? title "Fixed Effects - No Lags - Meas. Error" ; ? const lam86 1 lam87 1 lam88 1 beta2 0 beta3 0 ; param beta1 .279 ; param sigw1 .1 sigw2 .1 sigw3 .1 ; param gam83-gam88 ; sur(silent,wname=omega) pieqlist ; fitest traceu dfu ; ? title "Fixed Effects - No Lags - No Meas. Error" ; ? const sigw1 0 sigw2 0 sigw3 0 ; sur(silent,wname=omega) pieqlist ; fitest tracec dfc ; ? title "Test for Measurement Error" ; ? set chisqme = tracec-traceu ; set ndf = dfc-dfu ; cdf (chisq,df=ndf) chisqme ; ? ? Now try the correlated effects version without lags, but ? with a different coefficient on the effect in each eq. ? title "Fixed Effects - Lambda Free - Meas. Error" ; ? const lam86 1 ; param lam87 1.17 lam88 1.42 ; param beta1 .246 ; const beta2 0 beta3 0 ; param sigw1 .1 sigw2 .1 sigw3 .1 ; param gam83-gam88 ; sur (silent,wname=omega) pieqlist ; fitest traceu dfu ; ? title "Fixed Effects - Lambda Free - No Meas. Error" ; ? const sigw1 0 sigw2 0 sigw3 0 ; sur(silent,wname=omega) pieqlist ; fitest tracec dfc ; ? title "Test for Measurement Error" ; ? set chisqme = tracec-traceu ; set ndf = dfc-dfu ; cdf (chisq,df=ndf) chisqme ; ? stop ; end ;