| xtrec | R Documentation |
Implements the t-REC and t-RREC panel unit root tests of Westerlund (2015). The t-REC assumes iid errors; the robust t-RREC accounts for serial correlation, cross-sectional dependence, and heteroskedasticity.
xtrec(data, var, panel_id, time_id, trend = 0L,
robust = FALSE, maxlag = -1L)
data |
A data frame in long format. |
var |
Character. Name of the variable to test. |
panel_id |
Character. Name of the panel identifier variable. |
time_id |
Character. Name of the time variable. |
trend |
Integer. Polynomial trend degree: |
robust |
Logical. If |
maxlag |
Integer. Maximum lag for BIC selection (-1 for automatic). |
An object of class "xtrec" containing the test statistic, p-value,
and panel summary statistics.
Westerlund, J. (2015). The effect of recursive detrending on panel unit root tests. Journal of Econometrics, 185(2), 453-467. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jeconom.2014.09.013")}
dat <- grunfeld_data()
res <- xtrec(dat, var = "invest", panel_id = "firm",
time_id = "year", trend = 0L, robust = FALSE)
print(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.