@KPSS( options ) series start end
Options
DET=[CONSTANT]/TREND
The component around which the null of stationarity is assumed.
LMAX=maximum number of lags in window [not used]
LAGS=specific number of lags to use [4]
The KPSS test requires an estimate of the long-run variance, which is computed using a Bartlett (Newey-West) window. The value of the test statistic will change based upon the number used. If you use the LMAX option, the procedure will show the test statistic for the range of lags up to LMAX. Otherwise, it will do only the test with the number of lags chosen.
[PRINT]/NOPRINT
TITLE=title for report ["KPSS Test for Stationarity"]
Variables Defined
| %NOBS | number of observations |
| %CDSTAT | test statistic (using highest lag) |
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) loggdp
Sample Output
- Code: 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**
Because the null is that the series is trend-stationary, this rejects that in favor of a unit root.
