Learn R Programming

dlsem (version 1.5)

unirootTest: Unit root test

Description

Perform unit root test on a quantitative variable. A single group factor may 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 Said and Dickey, 1984; Banerjee et al., 1993) 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

References

A. Banerjee, J. J. Dolado, J. W. Galbraith, and D. F. Hendry (1993). Cointegration, Error Correction, and the Econometric Analysis of Non-Stationary Data. Oxford University Press, Oxford, UK. I. Choi (2001). Unit Root Tests for Panel Data. Journal of International Money and Finance, 20, 249-272. 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. D. Kwiatkowski, P. C. B. Phillips, P. Schmidt, Y. Shin (1992). Testing the Null Hypothesis of Stationarity against the Alternative of a Unit Root. Journal of Econometrics, 54 (1-3): 159-178. S. E. Said, and D. A. Dickey (1984). Testing for Unit Roots in Autoregressive-Moving Average Models of Unknown Order. Biometrika, 71, 599-607.

See Also

applyDiff, EM.imputation

Examples

Run this code
data(industry)
unirootTest("Job",group="Region",data=industry,k=1)

Run the code above in your browser using DataLab