View source: R/specification.R
| LinTest | R Documentation |
These functions conduct linearity (homogeneity) tests against the alternative of a logistic smooth transition component in a Panel Smooth Transition Regression (PSTR) model.
LinTest(use)
WCB_LinTest(use, iB = 100, parallel = FALSE, cpus = 2)
use |
An object of class |
iB |
Integer. Number of bootstrap repetitions. Default is |
parallel |
Logical. Whether to use parallel computation in bootstrap routines. |
cpus |
Integer. Number of CPU cores to use when |
Two equivalent interfaces are available:
Wrapper functions: LinTest(use = obj) and WCB_LinTest(use = obj, ...).
R6 methods: obj$LinTest() and obj$WCB_LinTest(...).
The wrapper functions call the corresponding R6 methods and return the (mutated) object invisibly.
The tests are carried out for each potential transition variable specified in tvars
when creating the model via NewPSTR. For each transition variable, tests are computed
for the number of switches m = 1, \ldots, im, where im is the maximal number of switches.
The procedures produce two families of tests:
mFor a fixed m, the null hypothesis is
H_0^i: \beta_{i} = \beta_{i-1} = \cdots = \beta_{1} = 0, \qquad i = 1, \ldots, m.
mThese are conditional tests with null
H_0^i: \beta_{i} = 0 \mid \beta_{i+1} = \cdots = \beta_{m} = 0, \qquad i = 1, \ldots, m.
For each hypothesis, four asymptotic LM-type tests are reported:
\chi^2-version LM test.
F-version LM test.
\chi^2-version HAC LM test (heteroskedasticity and autocorrelation consistent).
F-version HAC LM test.
WCB_LinTest additionally reports wild bootstrap (WB) and wild cluster bootstrap (WCB) p-values.
WB is robust to heteroskedasticity, while WCB is robust to both heteroskedasticity and within-individual
dependence (cluster dependence). The bootstrap routines can be computationally expensive; parallel execution
can be enabled via parallel = TRUE.
Results are stored in the returned object (see Value).
Both functions return use invisibly, after adding the following components:
testList. Asymptotic linearity test results for each transition variable and m.
sqtestList. Asymptotic sequence test results for each transition variable and m.
wcb_testList (only for WCB_LinTest). WB and WCB p-values for the linearity tests.
wcb_sqtestList (only for WCB_LinTest). WB and WCB p-values for the sequence tests.
NewPSTR, EstPSTR, EvalTest.
pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20,
indep_k = c("vala","debta","cfa","sales"),
tvars = c("vala"), iT = 14)
# R6 method interface
pstr$LinTest()
# Wrapper interface (equivalent)
pstr <- LinTest(pstr)
# Show results
print(pstr, mode = "tests")
# Bootstrap tests (can be slow)
pstr$WCB_LinTest(iB = 200, parallel = TRUE, cpus = 2)
# or
pstr <- WCB_LinTest(use = pstr, iB = 200, parallel = TRUE, cpus = 2)
print(pstr, mode = "tests")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.