Detailed description
Example
Code: Select all
*
* Greene, Econometric Analysis, 7th Edition
* Example 23.3 and 23.4 from pp 1026-1028
*
open data tablef5-2.txt
calendar(q) 1950
data(format=prn,org=columns) 1950:01 2000:04 year qtr realgdp realcons $
realinvs realgovt realdpi cpi_u m1 tbilrate unemp pop infl realint
*
set loggdp = log(realgdp)
*
* ADFAutoSelect does a sequence of DF tests and displays a table of
* criteria which can be used to select the lag length. The final column
* has the test statistic. This differs from the one in the stand-alone
* DFUNIT because ADFAutoSelect uses only the data points allowed when 14
* lags are included, while DFUNIT (by default), uses the maximum range
* allowed with the number of lags used on it.
*
@adfautoselect(maxlags=14,det=trend,print) loggdp
@dfunit(lags=1,det=trend) loggdp
*
@ppunit(lags=4,det=trend) loggdp
*
* KPSS test (example 22.4)
*
@kpss(lags=10,det=constant) loggdp
@kpss(lags=10,det=trend) loggdpCode: Select all
KPSS Test for Stationarity about Trend, Series LOGGDP
From 1950:01 to 2000:04
Observations 204
Sig Level Crit Value
1%(**) 0.216000
2.5% 0.176000
5%(*) 0.146000
10% 0.119000
Lags TestStat
10 0.311579**