unirootTest {dlsem} | R Documentation |
Unit root test
Description
Unit root test is performed on a set of quantitative variables. A single group factor may be taken into account.
Usage
unirootTest(x = NULL, group = NULL, time = NULL, data, test = NULL, log = FALSE)
Arguments
x |
A vector including the name of the quantitative variables to be tested.
If |
group |
The name of the group factor (optional). If |
time |
The name of the time factor (optional). This variable must be either a numeric identificative or a date in format '%Y/%m/%d','%d/%m/%Y', or '%Y-%m-%d'. If |
data |
An object of class |
test |
The test to apply, that may be either |
log |
Logical. If |
Value
An object of class unirootTest
, consisting of a list with one component for each variable tested. Each list contains the following components:
statistic |
The value of the test statistic. |
lag.order |
The lag order at which the test statistic is computed. It is automatically selected according to the precedure by Ng \& Perron (2001). |
n |
The total number of observations if |
z.value |
The z-value of the test. |
p.value |
The p-value of the test. |
Note
The null hypothesis of the ADF test is the presence of a unit root. The lag order to calculate the statistic of the ADF test is automatically selected according to the precedure by Ng \& Perron (2001).
The null hypothesis of the KPSS test is stationarity. The statistic of the KPSS test is calculated at the lag order 4*(n/100)^0.25.
If the group factor is specified, p-values of each group are combined using the method proposed by Demetrescu (2006).
References
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.
S. Ng, and W. P. Perron (2001). Lag Length Selection and the Construction of Unit Root Tests with Good Size and Power. Econometrica, 60: 1519-1554. DOI: 10.1111/1468-0262.00256.
Examples
data(industry)
indus.urt <- unirootTest(c("Job","Consum","Population","GDP"),
group="Region",time="Year",data=industry,log=TRUE)
indus.urt ## p-values
indus.urt$Job ## details for variable 'Job'