options crt limwarn=0 ; supres @covoc ; name usbalgm4 "Testing for exogeneity using GMM Estimation" ; ? ? This run illustrates the use of GMM to estimate a panel data ? model with a single independent variable. Fixed (correlated) ? firm effects are allowed for. This particular version performs ? tests for strong exogeneity and various forms of weak exogeneity ? of the independent variable cl. ? ? The models are estimated in reverse order, since the covariance ? matrix of the orthogonality conditions for the most general model ? must be used as a weighting matrix in GMM for all the models if ? a consistent set of test-statistics is to be computed. ? Chi-squared tests for the additional moment conditions implied ? by various forms of exogeneity are computed. ? input gmmchisq ; ? Fetch gmmchisq PROC. ? input rdusbal ; ? Read data and transform variables. ? ? Define equation for each year; only use the last 3 years, ? for comparison to IV estimates. ? frml ueq86 sl86-beta1*cl86-beta2*cl85-beta3*cl84 ; frml ueq87 sl87-beta1*cl87-beta2*cl86-beta3*cl85 ; frml ueq88 sl88-beta1*cl88-beta2*cl87-beta3*cl86 ; ? ? This differencing transformation allows for time-varying ? coefficients on the fixed effect. (not used in this run). ? frml dueq87 ueq87-(lam87/lam86)*ueq86 ; frml dueq88 ueq88-(lam88/lam87)*ueq87 ; dot 87 88 ; eqsub dueq. ueq86-ueq88 ; enddot ; ? list sl sl86-sl88 ; list cl cl83-cl88 ; list ulist u86-u88 ; list ueqlist ueq86-ueq88 ; list xlist logc83-logc88 logl83-logl88 ; msd sl cl ; ? ? Obtain starting values for maintained model (lag 2 inst). ? The model considered in this run has fixed effects and ? no lags on beta. ? const lam86 1 lam87 1 lam88 1 ; param beta1 ; const beta2 0 beta3 0 ; ? ? =============================================================== title "Fixed Effects - Lag 2 Instruments" ; ? load(nrow=12,ncol=2) m2 ; ? Lag 2 and greater instruments. 1 1 1 1 0 1 0 0 0 0 0 0 ? 83 and 84 for u87-u86. 1 1 1 1 0 1 0 0 0 0 0 0 ? 83-85 for u88-u87. ; gmm (silent,hetero,inst=xlist,mask=m2) dueq87-dueq88 ; gmmchisq trace2 df2 ; ? ? =============================================================== title "Fixed Effects - Lag 1 Instruments" ; ? load(nrow=12,ncol=2) m1 ; ? Lag 1 and greater instruments. 1 1 1 1 1 1 0 1 0 0 0 0 ? 83-85 for u87-u86. 1 1 1 1 1 1 0 1 0 0 0 0 ? 83-86 for u88-u87. ; gmm (silent,noiteru,hetero,inst=xlist,mask=m1) dueq87-dueq88 ; gmmchisq trace1 df1 ; ? title "Test Lag 1 Inst vs. Lag 2 Inst." ; ? set dfr=df1-df2 ; set test = trace1-trace2 ; cdf(df=dfr,chisq) test ; ? ? =============================================================== title "Fixed Effects - Lag 0 Instruments" ; ? load(nrow=12,ncol=2) m0 ; ? Lag 0 and greater instruments. 1 1 1 1 1 1 1 1 0 1 0 0 ? 83-86 for u87-u86. 1 1 1 1 1 1 1 1 0 1 0 0 ? 83-87 for u88-u87. ; gmm (silent,noiteru,hetero,inst=xlist,mask=m0) dueq87-dueq88 ; gmmchisq trace0 df0 ; ? title "Test Lag 0 Inst vs. Lag 1 Inst." ; ? set dfr=df0-df1 ; set test = trace0-trace1 ; cdf(df=dfr,chisq) test ; ? ? =============================================================== title "Fixed Effects - Strong Exogeneity" ; ? ? No mask means all instruments are used for all equations. ? gmm (silent,noiteru,hetero,inst=xlist) dueq87-dueq88 ; gmmchisq traces dfs ; ? title "Test Strong Exogeneity vs. Lag 0" ; ? set dfr=dfs-df0 ; set test = traces-trace0 ; cdf(df=dfr,chisq) test ; ? stop ; end ;