Skip to contents

Performs the KPSS unit root test on annual maximum series data. The null hypothesis is that the time series is trend-stationary with a linear deterministic trend and constant drift. The alternative hypothesis is that the time series has a unit root (also known as a stochastic trend).

Usage

eda_kpss_test(data, alpha = 0.05)

Arguments

data

Numeric vector of observed annual maximum series values. Must be strictly positive, finite, and not missing.

alpha

Numeric scalar in \([0.01, 0.1]\). The significance level for confidence intervals or hypothesis tests. Default is 0.05.

Value

A list containing the test results, including:

  • data: The data argument.

  • alpha: The significance level as specified in the alpha argument.

  • null_hypothesis: A string describing the null hypothesis.

  • alternative_hypothesis: A string describing the alternative hypothesis.

  • statistic: The KPSS test statistic.

  • p_value: The interpolated p-value. See the details for more information.

  • reject: If TRUE, the null hypothesis was rejected at significance alpha.

Details

The implementation of the KPSS test is based on the aTSA package, which interpolates a significance table from Hobijn et al. (2004). Therefore, a result of \(p = 0.01\) implies that \(p \leq 0.01\) and a result of \(p = 0.10\) implies that \(p \geq 0.10\).

References

Hobijn, B., Franses, P.H. and Ooms, M. (2004), Generalizations of the KPSS-test for stationarity. Statistica Neerlandica, 58: 483-502.

Kwiatkowski, D.; Phillips, P. C. B.; Schmidt, P.; Shin, Y. (1992). Testing the null hypothesis of stationarity against the alternative of a unit root. Journal of Econometrics, 54 (1-3): 159-178.

See also

Examples

data <- rnorm(n = 100, mean = 100, sd = 10)
eda_kpss_test(data)
#> $data
#>   [1] 100.12387  98.95186 107.50888  97.77118  93.79625 113.14000 116.23621
#>   [8]  88.10228 101.15881 116.18140  99.90063  92.66700 106.42069 108.95565
#>  [15]  91.35165 100.35780 107.02140 110.87775 110.32847 112.30771  90.03516
#>  [22]  90.82555  94.35715 103.97653  99.42904  94.74145 104.28256  89.53636
#>  [29] 116.11412  90.69241 103.37862 105.22782  82.64148 109.39183 105.45024
#>  [36]  84.75166  94.25823 111.23967  86.69933  97.37938  96.58283 111.08042
#>  [43] 114.25324  99.55259  98.79250 106.57130 110.35033  88.61991  93.08293
#>  [50] 100.83571 104.75665 102.37172  92.25124 103.24165 108.40478 116.61977
#>  [57] 111.01600 108.00191 104.89789 108.15966  75.26442  89.19149 105.21227
#>  [64]  86.71029 118.16608 102.27068  87.32682 106.03875  88.81822 103.22338
#>  [71] 102.98355 114.61274 119.20752  89.24305  93.12479 106.15612  99.96043
#>  [78] 100.60333  97.72133  91.09217  99.29099  87.82165  96.03174 116.78254
#>  [85] 119.72330  98.41525  96.38403  92.93475 108.29597  92.21121  96.49941
#>  [92]  94.03990  95.46888  87.32682  93.65167 106.19333 105.58708  99.05894
#>  [99]  99.19472 100.19550
#> 
#> $alpha
#> [1] 0.05
#> 
#> $null_hypothesis
#> [1] "The time series is trend-stationary."
#> 
#> $alternative_hypothesis
#> [1] "The time series has a unit root (stochastic trend)."
#> 
#> $statistic
#> [1] 0.03306532
#> 
#> $p_value
#> [1] 0.1
#> 
#> $reject
#> [1] FALSE
#>