# kpsstest

KPSS test for stationarity

## Syntax

## Description

returns rejection decision from conducting the Kwiatkowski, Phillips, Schmidt, and Shin (KPSS) test
for a unit root in the input univariate time series.`h`

= kpsstest(`y`

)

returns a table containing variables for the test results,
statistics, and settings from conducting the KPSS test for a unit
root in the last variable of the input table or timetable
`StatTbl`

= kpsstest(`Tbl`

)`Tbl`

. To select a different variable in
`Tbl`

to test, use the
`DataVariable`

name-value
argument.

`[___] = kpsstest(___,`

specifies options using one or more name-value arguments in
addition to any of the input argument combinations in previous syntaxes.
`Name=Value`

)`kpsstest`

returns the output argument combination for the
corresponding input arguments.

Some options control the number of tests to conduct. The following
conditions apply when `kpsstest`

conducts
multiple tests:

For example,
```
kpsstest(Tbl,DataVariable="GDP",Alpha=0.025,Lags=[0
1])
```

conducts two tests, at a level of significance
of 0.025, for the presence of a unit root in the variable
`GDP`

of the table `Tbl`

.
The first test includes `0`

autocovariance lags in
the Newey-West estimator of the long-run variance and the second
test includes `1`

autocovariance lag.

## Examples

## Input Arguments

## Output Arguments

## More About

## Tips

To draw valid inferences from a KPSS test, you must determine a suitable value for the

`Lags`

argument. The following methods can determine a suitable number of lags:Begin with a small number of lags, and then evaluate the sensitivity of the results by adding more lags.

Kwiatkowski et al. [2] suggest that a number of lags on the order of $$\sqrt{T}$$, where

*T*is the effective sample size, is often satisfactory under both the null and the alternative.

For consistency of the Newey-West estimator, the number of lags must approach infinity as the sample size increases.

With a specific testing strategy in mind, determine the value of the

`Trend`

argument by the growth characteristics of the input time series.If the input series grows, include a trend term by setting

`Trend`

to`true`

(default). This setting provides a reasonable comparison of a trend stationary null and a unit root process with drift.If a series does not exhibit long-term growth characteristics, exclude a trend term by setting

`Trend`

to`false`

.

## Algorithms

Test statistics follow nonstandard distributions under the null, even asymptotically. Kwiatkowski et al. [2] use Monte Carlo simulations, for models with and without a trend, to tabulate asymptotic critical values for a standard set of significance levels between 0.01 and 0.1.

`kpsstest`

interpolates critical values and*p*-values from these tables.

## References

[1] Hamilton, James D. *Time Series Analysis*. Princeton, NJ: Princeton University Press, 1994.

[2] Kwiatkowski, D., P. C.
B. Phillips, P. Schmidt, and Y. Shin. “Testing the Null Hypothesis of Stationarity against the
Alternative of a Unit Root.” *Journal of Econometrics*. Vol. 54, 1992, pp.
159–178.

## Version History

**Introduced in R2009b**