/************************************************************************* Augument Dickey-Fuller Test for Stationarity Here is a program function that you can call in your program dftest will automatically perform Dickey-Fullter tests until maximum lags you defined in previous setting. Syntax: dftest dftest rgdp 6 dftest D1.rgdp 6 **************************************************************************/ program dftest display "ADF Test Results " display "---------------------------------------------------" display " Lag Zt P-value " display "---------------------------------------------------" display " with Drift" forval l=0/`2' { quietly dfuller `1', lags(`l') drift display " " r(lags) " " %12.4f `r(Zt)' " " %12.4f `r(p)' } display " with trend" forval l=0/`2' { quietly dfuller `1', lags(`l') trend display " " r(lags) " " %12.4f `r(Zt)' " " %12.4f `r(p)' } display "---------------------------------------------------" end /**************************************************************** ECO376 ACF and PACF Test Program for ac and pac tests for the input variable Syntax: ac_pac ac_pac rgdp ---------------------------------------------------------------*/ program ac_pac ac `1', name(ac1) $goption pac `1', name(pac1) $goption graph combine ac1 pac1, graphregion(color(white)) ycommon graph drop ac1 pac1 end /*-----------------------------------------------------------*/ /*************************************************************************** Optional Command ----------------------------------------------------------------------------*/ /* Here are some graph options to make STATA graph looks better */ global gopt1 graphregion(color(white)) legend(size(small)) legend(region(lwidth(none))) global gopt2 graphregion(color(white)) bgcolor(white) mlabsize(tiny) global gsize ylabel(,labsize(small)) xlabel(,labsize(small)) xtitle("") ytitle(,size(small)) xsize(13) ysize(15)