* * Chapter 5 example, pp 358-363 * allocate 125 * * Read data file open data sum_hes.xls data(org=columns,format=xls) / $ ID COM OPEC $ POP60 Y60 SRATE60 $ POP61 Y61 SRATE61 $ POP62 Y62 SRATE62 $ POP63 Y63 SRATE63 $ POP64 Y64 SRATE64 $ POP65 Y65 SRATE65 $ POP66 Y66 SRATE66 $ POP67 Y67 SRATE67 $ POP68 Y68 SRATE68 $ POP69 Y69 SRATE69 $ POP70 Y70 SRATE70 $ POP71 Y71 SRATE71 $ POP72 Y72 SRATE72 $ POP73 Y73 SRATE73 $ POP74 Y74 SRATE74 $ POP75 Y75 SRATE75 $ POP76 Y76 SRATE76 $ POP77 Y77 SRATE77 $ POP78 Y78 SRATE78 $ POP79 Y79 SRATE79 $ POP80 Y80 SRATE80 $ POP81 Y81 SRATE81 $ POP82 Y82 SRATE82 $ POP83 Y83 SRATE83 $ POP84 Y84 SRATE84 $ POP85 Y85 SRATE85 * * Generate needed variables * set n = (POP85/POP60)**(0.04)-1 set srate = ( $ srate60+ $ srate61+ $ srate62+ $ srate63+ $ srate64+ $ srate65+ $ srate66+ $ srate67+ $ srate68+ $ srate69+ $ srate70+ $ srate71+ $ srate72+ $ srate73+ $ srate74+ $ srate75+ $ srate76+ $ srate77+ $ srate78+ $ srate79+ $ srate80+ $ srate81+ $ srate82+ $ srate83+ $ srate84+ $ srate85 $ )/26 * * Sneakier way to do this. %s(string) refers to the series with the name * "string". "srate"+yr will be the string formed by concatenating the string for * the counter yr to srate, thus srate60, srate61, etc. * set srate = 0 do yr=60,85 set srate = srate+%s("srate"+yr) end do yr set srate = srate/26 * set growth = log(y85)-log(y60) set base = log(y60) set lngd = log(0.05+n) set lsrate = log(srate) table / growth lsrate n lngd pop85 pop60 * scatter(footer="Growth over 1960-1985 vs GDP/Capita in 1960",$ hlabel="1960 GDP/Cap",vlabel="Cumulative Growth") # base growth * * (a) Conditional Convergence * linreg growth;# constant base linreg growth;# constant base lsrate lngd com opec * compute rho=1+%beta(2) compute lambda=-log(rho)/25 compute lambdasd=%stderrs(2)/(25*rho) disp "Estimate of lambda" lambda "(" lambdasd ")" * * (c) (Part (b) is below, as it requires a different arrangement * of the data set * compute nper=24 dec vect[frml] system(nper) dec vect[series] ydiff(nper) ydiffl(nper) slag(nper) dec vect mu(nper) nonlin mu rho * do i=1,nper set ydiff(i) = log(%s("y"+(61+i)))-log(%s("y"+(60+i))) set ydiffl(i) = log(%s("y"+(60+i)))-log(%s("y"+(59+i))) set slag(i) = %s("srate"+(59+i)) end do i * instruments slag constant dec rect imask(nper+1,nper) ewise imask(i,j)=(i==j.or.i==nper+1) do i=1,nper frml system(i) ydiff(i) = mu(&i)+rho*ydiffl(&i) end do i nlsystem(instruments,mask=imask) / system * * (b) fixed-effects estimation. Since version 5, RATS has had a built-in * instruction for fixed effects estimation. This is PREGRESS. The options for * fixed effects with individual effects and time effects are * method=fixed,effects=both. * end(reset) * calendar(panelobs=25) allocate 125//25 open data fixed.asc data(org=columns,format=free) / id com opec year rgdp rgdpl * set y = log(rgdp) set ylag = log(rgdpl) * preg(method=fixed,effects=both) y # ylag