Perform a seasonal unit root test to check seasonality in a linear stochastic process
seasonal.test(y, seasonal = c("ocsb","ch","hegy"), alpha = 0.05)
A list with class "h.test"
containing the following components:
the test statistic.
the test degrees freedoms.
the p-value for the test.
a character string describing the alternative hypothesis.
a character string with the test name.
a character string giving the name of the data.
a numeric vector or an object of the ts
class containing a stationary time series.
A character string naming the desired seasonal unit root test for checking seasonality.
Valid values are "ocsb"
for the Osborn, Chui, Smith, and Birchenhall, "ch"
for the
Canova and Hansen, and "hegy"
for Hylleberg, Engle, Granger, and Yoo. The default value is
"ocsb"
for the Osborn, Chui, Smith, and Birchenhall test.
Level of the test, possible values range from 0.01 to 0.1. By default alpha = 0.05
is used
Asael Alonzo Matamoros
Several different tests are available:
In the kpss
test, the null hypothesis that y
has a stationary root
against a unit-root alternative. In the two remaining tests, the null hypothesis
is that y
has a unit root against a stationary root alternative. By default,
alpha = 0.05
is used to select the more likely hypothesis.
Osborn, D., Chui, A., Smith, J., & Birchenhall, C. (1988). Seasonality and the order of integration for consumption. Oxford Bulletin of Economics and Statistics. 50(4), 361-377.
Canova, F. & Hansen, B. (1995). Are Seasonal Patterns Constant over Time? A Test for Seasonal Stability. Journal of Business and Economic Statistics. 13(3), 237-252.
Hylleberg, S., Engle, R., Granger, C. & Yoo, B. (1990). Seasonal integration and cointegration. Journal of Econometrics 44(1), 215-238.
normal.test
, uroot.test
# stationary ar process
y = ts(rnorm(100),frequency = 6)
seasonal.test(y)
Run the code above in your browser using DataLab