options memory=80 crt limwarn=0 ; ? ? ========================= SIMLSDV =============================== ? ? One Variable Time Series Process Using Panel Data. ? Use simulated data to investigate testing methodology. ? Investigate the difference between estimation using conventional ? Panel methods and GMM. ? This version is stacked OLS and IV. AR1 Model. ? Within estimation. ? DGPs are homoskedastic, and look like the US R&D series. ? ? Bronwyn H. Hall - Hall and Mairesse 2002 (for TJR Conf). ? supres @covoc @smpl ; const nob 200 t 12 ndraw 1000 ; set nobt = nob*t ; set t1 = t-1 ; smpl 1 nobt ; random (seedin=29345) e ; ? Initialize seed. ? ? Set up id and trend. ? trend(pstart=1,period=t) trend ; select trend=1 ; trend id ; select trend>1 ; id = id(-1) ; dummy trend dyrdum ; select trend>0 ; dummy trend yrdum ; list dylist dy79-dy89 ; ? List of differenced series. ? ? Initialize result storage ? dot ols iv ; mform(nrow=ndraw,ncol=1) coef.; mform(nrow=ndraw,ncol=1) sumb. ; mform(nrow=ndraw,ncol=1) s. ; mform(nrow=ndraw,ncol=1) rsq. ; mform(nrow=ndraw,ncol=1) sb. ; mform(nrow=ndraw,ncol=1) tb. ; enddot ; ? Program to simulate data according to 8 panel time series ? processes. The parameters of the processes are determined ? from the first and second moments of the R&D series for the ? United States. The models are the following: ? ? 1. Random walk with drift ? 2. Fixed effect with trend ? 3. AR(1) with no effect, rho=0.3 ? 4. AR(1) with no effect, rho=0.9 ? 5. AR(1) with no effect, rho=0.99 ? 6. AR(1) with fixed effect, rho=0.3 ? 7. AR(1) with fixed effect, rho=0.9 ? 8. AR(1) with fixed effect, rho=0.99 const meany 2.50 ; const vary 4.599 ; const meandy .085 ; const vardy .0672 ; do imod = 1 to 8 ; ? Simulate all 8 models (see labels below). date startime ; do n = 1 to ndraw ; smpl 1 nobt ; if imod=1 ; then ; do ; param rho .99 var .01 ; simrw nob t meany vary meandy vardy trend y ; if n=1 ; then ; title "Random Walk Process" ; enddo ; if imod=2 ; then ; do ; param rho 0 var .05 ; simarfe nob t rho meany vary meandy vardy trend y ; if n=1 ; then ; title "Fixed Effect" ; enddo ; if imod=3 ; then ; do ; param rho .3 var 4 ; simar1 nob t rho meany vary meandy vardy trend y ; if n=1 ; then ; title "AR(1) Process with rho=0.3" ; enddo ; if imod=4 ; then ; do ; param rho .9 var .87 ; simar1 nob t rho meany vary meandy vardy trend y ; if n=1 ; then ; title "AR(1) Process with rho=0.9" ; enddo ; if imod=5 ; then ; do ; param rho .99 var .09 ; simar1 nob t rho meany vary meandy vardy trend y ; if n=1 ; then ; title "AR(1) Process with rho=0.99" ; enddo ; if imod=6 ; then ; do ; param rho .3 var 2.4 ; simarfe nob t rho meany vary meandy vardy trend y ; if n=1 ; then ; title "AR(1) Process with F.E., rho=0.3" ; enddo ; if imod=7 ; then ; do ; param rho .9 var 4 ; simarfe nob t rho meany vary meandy vardy trend y ; if n=1 ; then ; title "AR(1) Process with F.E., rho=0.9" ; enddo ; if imod=8 ; then ; do ; param rho .99 var 4.6 ; simarfe nob t rho meany vary meandy vardy trend y ; if n=1 ; then ; title "AR(1) Process with F.E., rho=0.99" ; enddo ; ? ? Estimation by linear methods. ? select trend>1 ; panel (id=id,silent,within,nototal,nobetween) y trend y(-1) ; unmake @coefw delta b1 ; unmake @sesw sdel sb ; unmake @tw td tb ; set sumbols(n) = b1 ; set sbols(n) = sb ; set tbols(n) = abs((b1-1)/sb)>1.96 ; enddo ; smpl 1 ndraw ; dot ols ; unmake sumb. sumb. ; unmake sb. sb. ; unmake tb. tb. ; msd sumb. sb. tb.; enddot ; date endtime ; set time = (endtime-startime)/60 ; print (format="(' Elapsed time in minutes=',f8.2)") time ; enddo ;