Learn R Programming

dlsem (version 2.0)

unirootTest: Unit root test

Description

Perform unit root test on one quantitative variable. A single group factor can be taken into account.

Usage

unirootTest(x, group = NULL, time = NULL, data, test = "adf", combine = "choi",
  k = 0, lshort = TRUE)

Arguments

x

The name of the quantitative variable to be tested.

group

The name of a group factor (optional). If NULL, no groups are considered.

time

The name of a time factor (optional). If NULL and group is not NULL, data are assumed temporally ordered within each group. If both group and time are NULL, data are assumed temporally ordered.

data

An object of class data.frame containing the variables to be differenced, the group factor if group is not NULL, and the time factor if time is not NULL.

test

The test to use, that can be either "adf" (Augmented Dickey-Fuller, see Dickey and Fuller, 1981) or "kpss" (KPSS, see Kwiatkowski et al., 1992). Default is "adf".

combine

The method to combine p-values of different groups, that can be either "choi" (Choi, 2001) or "demetrescu" (Demetrescu, 2006). Ignored if group is NULL. Default is "choi".

k

The lag order to calculate the statistic of the Augmented Dickey-Fuller test. Ignored if test="kpss". Default is 0.

lshort

Logical. If TRUE, the short version of the truncation lag parameter is used in the KPSS test. Ignored if test="adf". Default is TRUE.

Value

A list containing the following components:

statistic

The value of the test statistic.

alternative

The alternative hypothesis.

z.value

The z-value of the test.

p.value

The p-value of the test.

test

The test used.

combine

The method used to combine p-values of different groups. NULL if group is NULL.

n

The number of observations per group.

References

I. Choi (2001). Unit Root Tests for Panel Data. Journal of International Money and Finance, 20, 249-272. DOI: 10.1016/S0261-5606(00)00048-6

M. Demetrescu, U. Hassler, and A. Tarcolea (2006). Combining Significance of Correlated Statistics with Application to Panel Data. Oxford Bulletin of Economics and Statistics, 68(5), 647-663. DOI: 10.1111/j.1468-0084.2006.00181.x

D. A. Dickey, and W. A. Fuller (1981). Likelihood Ratio Statistics for Autoregressive Time Series with a Unit Root. Econometrica, 49: 1057-1072. DOI: 10.2307/1912517

D. Kwiatkowski, P. C. B. Phillips, P. Schmidt, and Y. Shin (1992). Testing the Null Hypothesis of Stationarity against the Alternative of a Unit Root. Journal of Econometrics, 54 (1-3): 159-178. DOI: 10.1016/0304-4076(92)90104-Y

Examples

Run this code
# NOT RUN {
data(industry)
unirootTest("Job",group="Region",data=industry,k=1)
# }

Run the code above in your browser using DataLab