Value

An integer indicating the number of differences required for stationarity.

Details

ndiffs uses a unit root test to determine the number of differences
required for time series x to be made stationary. If
test="kpss", the KPSS test is used with the null hypothesis that
x has a stationary root against a unit-root alternative. Then the
test returns the least number of differences required to pass the test at
the level alpha. If test="adf", the Augmented Dickey-Fuller
test is used and if test="pp" the Phillips-Perron test is used. In
both of these cases, the null hypothesis is that x has a unit root
against a stationary root alternative. Then the test returns the least
number of differences required to fail the test at the level alpha.

References

Dickey DA and Fuller WA (1979), "Distribution of the Estimators for
Autoregressive Time Series with a Unit Root", Journal of the American
Statistical Association74:427-431.

Kwiatkowski D, Phillips PCB, Schmidt P and Shin Y (1992) "Testing the Null
Hypothesis of Stationarity against the Alternative of a Unit Root",
Journal of Econometrics54:159-178.