Learn R Programming

PSTR (version 2.0.0)

LinTest: Linearity (homogeneity) tests for PSTR models

Description

These functions conduct linearity (homogeneity) tests against the alternative of a logistic smooth transition component in a Panel Smooth Transition Regression (PSTR) model.

Usage

LinTest(use)

WCB_LinTest(use, iB = 100, parallel = FALSE, cpus = 2)

Value

Both functions return use invisibly, after adding the following components:

test

List. Asymptotic linearity test results for each transition variable and \(m\).

sqtest

List. Asymptotic sequence test results for each transition variable and \(m\).

wcb_test

List (only for WCB_LinTest). WB and WCB p-values for the linearity tests.

wcb_sqtest

List (only for WCB_LinTest). WB and WCB p-values for the sequence tests.

Arguments

use

An object of class "PSTR" created by NewPSTR.

iB

Integer. Number of bootstrap repetitions. Default is 100.

parallel

Logical. Whether to use parallel computation in bootstrap routines.

cpus

Integer. Number of CPU cores to use when parallel = TRUE. Ignored otherwise.

Details

Two equivalent interfaces are available:

  1. Wrapper functions: LinTest(use = obj) and WCB_LinTest(use = obj, ...).

  2. 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:

(i) Linearity tests for each \(m\)

For a fixed \(m\), the null hypothesis is $$H_0^i: \beta_{i} = \beta_{i-1} = \cdots = \beta_{1} = 0, \qquad i = 1, \ldots, m.$$

(ii) Sequence tests for selecting \(m\)

These 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).

See Also

NewPSTR, EstPSTR, EvalTest.

Examples

Run this code
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")

# \donttest{
# 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")
# }

Run the code above in your browser using DataLab