| Title: | Panel Smooth Transition Regression Modelling |
|---|---|
| Description: | Implements the Panel Smooth Transition Regression (PSTR) framework for nonlinear panel data modelling. The modelling procedure consists of three stages: Specification, Estimation and Evaluation. The package provides tools for model specification testing, to do PSTR model estimation, and to do model evaluation. The implemented tests allow for cluster dependence and are heteroskedasticity-consistent. The wild bootstrap and wild cluster bootstrap tests are also implemented. Parallel computation (optional) is supported for computationally intensive routines such as bootstrap tests. |
| Authors: | Yukai Yang [aut, cre] (ORCID: <https://orcid.org/0000-0002-2623-8549>) |
| Maintainer: | Yukai Yang <[email protected]> |
| License: | GPL-3 |
| Version: | 2.1.0 |
| Built: | 2026-06-06 06:33:59 UTC |
| Source: | https://github.com/yukai-yang/pstr |
EstPSTR estimates either a nonlinear PSTR model (when iq is provided) or a
linear fixed-effects panel regression (when iq = NULL).
EstPSTR( use, im = 1, iq = NULL, par = NULL, useDelta = FALSE, vLower = 2, vUpper = 2, method = "L-BFGS-B" )EstPSTR( use, im = 1, iq = NULL, par = NULL, useDelta = FALSE, vLower = 2, vUpper = 2, method = "L-BFGS-B" )
use |
An object of class |
im |
Integer. Number of switches |
iq |
Either an integer index (column number in the transition-variable matrix) or a
character string (transition-variable name) specifying which transition variable to use.
If |
par |
Numeric vector of length |
useDelta |
Logical. If |
vLower |
Numeric scalar or vector. Lower offsets defining the lower bounds in the optimiser.
Bounds are applied to the internal parameter vector used in optimisation (with the first
element being |
vUpper |
Numeric scalar or vector. Upper offsets defining the upper bounds in the optimiser.
Bounds are applied to the internal parameter vector used in optimisation (with the first
element being |
method |
Character. Optimisation method passed to |
Two equivalent interfaces are available:
Wrapper function: EstPSTR(use = obj, ...).
R6 method: obj$EstPSTR(...).
The wrapper calls the corresponding R6 method and returns use invisibly.
The transition function is logistic and depends on a transition variable and
nonlinear parameters and switching locations :
The smoothness parameter is internally reparametrised as , where
. The optimisation is always carried out in and .
If par = NULL, the function constructs default initial values from quantiles of the
selected transition variable and treats the first element as .
Invisibly returns use with estimation results added. In particular, for a
nonlinear PSTR model (iq not NULL), the object contains (among others):
deltaEstimate of .
gammaEstimate of .
cEstimates of .
vgEstimated transition-function values .
betaEstimated coefficients (named as var_0 for linear-part coefficients and var_1 for nonlinear-part coefficients).
vUResiduals.
vMEstimated individual effects.
s2Estimated residual variance.
covCluster-robust and heteroskedasticity-consistent covariance matrix of all estimates.
seStandard errors corresponding to est.
estVector of all estimates (coefficients followed by nonlinear parameters).
mbetaEstimates of coefficients in the second extreme regime (when available).
mseStandard errors for mbeta (when available).
For a linear fixed-effects model (iq = NULL), the object contains beta, vU,
vM, s2, cov, se, and est.
NewPSTR, LinTest, WCB_LinTest,
EvalTest, stats::optim.
pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20, indep_k = c("vala","debta","cfa","sales"), tvars = c("vala"), iT = 14) # 1) Linear fixed-effects model pstr <- EstPSTR(use = pstr) print(pstr, mode = "estimates", digits = 6) # 2) Nonlinear PSTR model pstr <- EstPSTR(use = pstr, im = 1, iq = 1, useDelta = TRUE, par = c(.63, 0), vLower = 4, vUpper = 4) print(pstr, mode = "estimates", digits = 6) # R6 method interface (equivalent) pstr$EstPSTR(im = 1, iq = 1, useDelta = TRUE, par = c(.63, 0), method = "CG")pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20, indep_k = c("vala","debta","cfa","sales"), tvars = c("vala"), iT = 14) # 1) Linear fixed-effects model pstr <- EstPSTR(use = pstr) print(pstr, mode = "estimates", digits = 6) # 2) Nonlinear PSTR model pstr <- EstPSTR(use = pstr, im = 1, iq = 1, useDelta = TRUE, par = c(.63, 0), vLower = 4, vUpper = 4) print(pstr, mode = "estimates", digits = 6) # R6 method interface (equivalent) pstr$EstPSTR(im = 1, iq = 1, useDelta = TRUE, par = c(.63, 0), method = "CG")
EvalTest provides post-estimation evaluation tests for an estimated PSTR model.
It supports two null hypotheses:
No time variation in parameters (labelled "time-varying").
No remaining nonlinearity/heterogeneity given a candidate transition variable (labelled "heterogeneity").
EvalTest(use, type = c("time-varying", "heterogeneity"), vq = NULL) WCB_TVTest(use, iB = 100, parallel = FALSE, cpus = 4) WCB_HETest(use, vq, iB = 100, parallel = FALSE, cpus = 4)EvalTest(use, type = c("time-varying", "heterogeneity"), vq = NULL) WCB_TVTest(use, iB = 100, parallel = FALSE, cpus = 4) WCB_HETest(use, vq, iB = 100, parallel = FALSE, cpus = 4)
use |
An object of class |
type |
Character vector. Which evaluation tests to run in |
vq |
Numeric vector. Candidate transition variable used by the no remaining nonlinearity
test. Required if |
iB |
Integer. Number of bootstrap replications. Default is |
parallel |
Logical. Whether to use parallel computation (via the future/future.apply backend). |
cpus |
Integer. Number of CPU cores used if |
Wild bootstrap (WB) and wild cluster bootstrap (WCB) versions are available via
WCB_TVTest (parameter constancy) and WCB_HETest (no remaining nonlinearity).
Two equivalent interfaces are available for each test:
Wrapper function, for example EvalTest(use = obj, ...).
R6 method, for example obj$EvalTest(...).
Each wrapper calls the corresponding R6 method and returns use invisibly.
The bootstrap variants are computationally intensive. WB is robust to heteroskedasticity,
while WCB is additionally robust to within-individual dependence (cluster dependence).
Parallel execution can be enabled via parallel and cpus.
Invisibly returns use with evaluation results added.
tvA list of parameter-constancy (time-varying) test results, one element per .
htA list of no remaining nonlinearity (heterogeneity) test results, one element per .
wcb_tvA numeric matrix of WB/WCB p-values for parameter-constancy tests (one row per ).
wcb_htA numeric matrix of WB/WCB p-values for no remaining nonlinearity tests (one row per ).
The individual list elements in tv and ht contain LM-type test statistics and
p-values (including HAC variants), consistent with the output from LinTest.
NewPSTR, LinTest, WCB_LinTest,
EstPSTR.
pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20, indep_k = c("vala","debta","cfa","sales"), tvars = c("vala"), iT = 14) # estimate first pstr <- EstPSTR(use = pstr, im = 1, iq = 1, useDelta = TRUE, par = c(.63, 0), method = "CG") # evaluation tests pstr <- EvalTest( use = pstr, type = c("time-varying","heterogeneity"), vq = as.matrix(Hansen99[,'vala'])[,1] ) print(pstr, mode = "evaluation") # bootstrap variants (parallel via future/future.apply; can be slow) # Optional: if parallel bootstrap exports a large object, temporarily # increase the maximum size of exported globals. old_max <- getOption("PSTR.future.globals.maxSize") options(PSTR.future.globals.maxSize = 4 * 1024^3) # 4 GB, if needed pstr <- WCB_TVTest(use = pstr, iB = 4, parallel = TRUE, cpus = 2) pstr <- WCB_HETest( use = pstr, vq = as.matrix(Hansen99[, "vala"])[, 1], iB = 4, parallel = TRUE, cpus = 2 ) # Reset to the previous option value. options(PSTR.future.globals.maxSize = old_max) print(pstr, mode = "evaluation")pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20, indep_k = c("vala","debta","cfa","sales"), tvars = c("vala"), iT = 14) # estimate first pstr <- EstPSTR(use = pstr, im = 1, iq = 1, useDelta = TRUE, par = c(.63, 0), method = "CG") # evaluation tests pstr <- EvalTest( use = pstr, type = c("time-varying","heterogeneity"), vq = as.matrix(Hansen99[,'vala'])[,1] ) print(pstr, mode = "evaluation") # bootstrap variants (parallel via future/future.apply; can be slow) # Optional: if parallel bootstrap exports a large object, temporarily # increase the maximum size of exported globals. old_max <- getOption("PSTR.future.globals.maxSize") options(PSTR.future.globals.maxSize = 4 * 1024^3) # 4 GB, if needed pstr <- WCB_TVTest(use = pstr, iB = 4, parallel = TRUE, cpus = 2) pstr <- WCB_HETest( use = pstr, vq = as.matrix(Hansen99[, "vala"])[, 1], iB = 4, parallel = TRUE, cpus = 2 ) # Reset to the previous option value. options(PSTR.future.globals.maxSize = old_max) print(pstr, mode = "evaluation")
A dataset containing a balanced panel data of annual observations over the period 1973-1987 (15 years) for 560 US firms for the variables described below.
Hansen99Hansen99
A tibble with 7840 rows and 20 variables:
Committee on Uniform Security Identication Procedures firm code number, the first 6 digits (CNUM)
2-digit year of the data
investment to assets ratio
dummy variable for 1975
dummy variable for 1976
dummy variable for 1977
dummy variable for 1978
dummy variable for 1979
dummy variable for 1980
dummy variable for 1981
dummy variable for 1982
dummy variable for 1983
dummy variable for 1984
dummy variable for 1985
dummy variable for 1986
dummy variable for 1987
lagged total market value to assets ratio ("Tobin's Q")
lagged long term debt to assets ratio
lagged cash flow to assets ratio
lagged sales during the year (million USD)
The structure of the dataset is such that the time index runs “fast”, while the firm index runs “slow”; that is, first all 14 observations for the first firm are given, then the 14 observations for the second firm, etc.
Since we used one year lagged variables of "vala", "debta", "cfa" and "cfa" as regressors, the records in 1973 are skipped.
All values are nominal and millions of dollars except where otherwise noted. Stocks are end of year.
https://www.ssc.wisc.edu/~bhansen/progs/joe_99.html
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)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 , where is the maximal number of switches.
The procedures produce two families of tests:
For a fixed , the null hypothesis is
These are conditional tests with null
For each hypothesis, four asymptotic LM-type tests are reported:
-version LM test.
F-version LM test.
-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 .
sqtestList. Asymptotic sequence test results for each transition variable and .
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.
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). # For parallel execution, the exported object may exceed the default # size limit. If that happens, temporarily increase the limit below. old_max <- getOption("PSTR.future.globals.maxSize") options(PSTR.future.globals.maxSize = 4 * 1024^3) # 4 GB, if needed pstr$WCB_LinTest(iB = 200, parallel = TRUE, cpus = 2) # or pstr <- WCB_LinTest(use = pstr, iB = 200, parallel = TRUE, cpus = 2) # Reset to the previous option value. options(PSTR.future.globals.maxSize = old_max) print(pstr, mode = "tests")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). # For parallel execution, the exported object may exceed the default # size limit. If that happens, temporarily increase the limit below. old_max <- getOption("PSTR.future.globals.maxSize") options(PSTR.future.globals.maxSize = 4 * 1024^3) # 4 GB, if needed pstr$WCB_LinTest(iB = 200, parallel = TRUE, cpus = 2) # or pstr <- WCB_LinTest(use = pstr, iB = 200, parallel = TRUE, cpus = 2) # Reset to the previous option value. options(PSTR.future.globals.maxSize = old_max) print(pstr, mode = "tests")
Create an R6 object of class "PSTR" to be used as the main container for
Panel Smooth Transition Regression (PSTR) modelling in this package.
You typically call NewPSTR() once, and then pass the returned object to
specification, estimation and evaluation functions.
NewPSTR(data, dep, indep, indep_k = NULL, tvars, im = 1, iT)NewPSTR(data, dep, indep, indep_k = NULL, tvars, im = 1, iT)
data |
A tibble containing the panel in long format. The number of rows must be
|
dep |
A single column index or a single column name specifying the dependent variable. |
indep |
A vector of column indices or column names specifying the regressors in the linear part. |
indep_k |
Optional. A vector of column indices or column names specifying the regressors
in the non-linear part. If |
tvars |
A vector of column indices or column names specifying the candidate transition variables. |
im |
Integer. The maximal number of switches used in linearity-related tests.
Default is |
iT |
Integer. The time dimension (number of time observations per individual). |
The candidate transition variables in tvars will be stored in the object
and can be tested one by one by functions such as LinTest.
Missing values in the dependent variable, linear regressors, non-linear regressors,
or transition variables are removed internally (row-wise).
The number of individuals is inferred from nrow(data) and iT
after removing missing values.
An R6 object of class "PSTR".
LinTest, WCB_LinTest, EstPSTR,
EvalTest, WCB_TVTest, WCB_HETest.
pstr <- NewPSTR( Hansen99, dep = "inva", indep = 4:20, indep_k = c("vala", "debta", "cfa", "sales"), tvars = c("vala", "debta"), iT = 14 ) # print summary (your R6 print method) pstr print(pstr, mode = "summary") # after running tests/estimation, you can print other sections # print(pstr, mode = "tests") # print(pstr, mode = "estimates") # print(pstr, mode = "evaluation")pstr <- NewPSTR( Hansen99, dep = "inva", indep = 4:20, indep_k = c("vala", "debta", "cfa", "sales"), tvars = c("vala", "debta"), iT = 14 ) # print summary (your R6 print method) pstr print(pstr, mode = "summary") # after running tests/estimation, you can print other sections # print(pstr, mode = "tests") # print(pstr, mode = "estimates") # print(pstr, mode = "evaluation")
This function plots three curves against the transition variable: the coefficient function, its standard error, and the corresponding p-value.
plot_coefficients(obj, vars, length.out = 100, color = "blue", size = 1.5)plot_coefficients(obj, vars, length.out = 100, color = "blue", size = 1.5)
obj |
An object of class |
vars |
A vector of column indices or variable names from the nonlinear part. |
length.out |
Number of grid points over the transition variable. |
color |
Line colour. |
size |
Line width. |
For each selected variable , the curves are
where follows a chi-square distribution with one degree of freedom.
In addition to the exported function plot_coefficients(obj = ...),
the same functionality is available as an R6 method via
obj$plot_coefficients(...).
A named list of ggplot2 objects.
pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20, indep_k = c("vala","debta","cfa","sales"), tvars = c("vala","debta","cfa","sales"), iT = 14) pstr <- EstPSTR(use = pstr, im = 1, iq = 1, useDelta = TRUE, par = c(.63,0), method = "CG") # Exported function ret <- plot_coefficients(pstr, vars = 1:4) # R6 method ret2 <- pstr$plot_coefficients(vars = 1:4)pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20, indep_k = c("vala","debta","cfa","sales"), tvars = c("vala","debta","cfa","sales"), iT = 14) pstr <- EstPSTR(use = pstr, im = 1, iq = 1, useDelta = TRUE, par = c(.63,0), method = "CG") # Exported function ret <- plot_coefficients(pstr, vars = 1:4) # R6 method ret2 <- pstr$plot_coefficients(vars = 1:4)
This function plots the effect-adjusted expected response for selected nonlinear variables in a PSTR model.
plot_response( obj, vars, log_scale = FALSE, length.out = 20, color = "blue", size = 1.5 )plot_response( obj, vars, log_scale = FALSE, length.out = 20, color = "blue", size = 1.5 )
obj |
An object of class |
vars |
Integer vector of column indices from the nonlinear part. |
log_scale |
Logical scalar or length-2 vector indicating whether to use log scale for the regressor and/or transition variable. |
length.out |
Scalar or length-2 numeric vector controlling grid size. |
color |
Line colour. |
size |
Line width. |
If the selected variable differs from the transition variable, a 3-D surface of
is plotted against and the transition variable.
If the selected variable coincides with the transition variable, a curve is plotted instead.
In addition to the exported function
plot_response(obj = ...), the same functionality is available
as an R6 method via obj$plot_response(...).
A named list of ggplot2 (curve) and/or
plotly (surface) objects.
pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20, indep_k = c("vala","debta","cfa","sales"), tvars = c("vala","debta","cfa","sales"), iT = 14) pstr <- EstPSTR(use = pstr, im = 1, iq = 1, useDelta = TRUE, par = c(.63,0), method = "CG") # Exported interface ret <- plot_response(pstr, vars = 1:4) # R6 method ret2 <- pstr$plot_response(vars = 1:4)pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20, indep_k = c("vala","debta","cfa","sales"), tvars = c("vala","debta","cfa","sales"), iT = 14) pstr <- EstPSTR(use = pstr, im = 1, iq = 1, useDelta = TRUE, par = c(.63,0), method = "CG") # Exported interface ret <- plot_response(pstr, vars = 1:4) # R6 method ret2 <- pstr$plot_response(vars = 1:4)
This function plots a 3-D surface of the nonlinear least squares (NLS) target function used in estimating a PSTR model. It is mainly intended as a diagnostic tool for choosing reasonable initial values for the nonlinear parameters.
plot_target( obj, im = 1, iq = NULL, par = NULL, basedon = c(1, 2), from, to, length.out = 40 )plot_target( obj, im = 1, iq = NULL, par = NULL, basedon = c(1, 2), from, to, length.out = 40 )
obj |
An object of class |
im |
Integer. The number of switches |
iq |
Either an integer index (a column number in the transition-variable matrix) or a character string (a transition-variable name) specifying which transition variable is used when computing the target function. |
par |
Numeric vector of length |
basedon |
Integer vector of length |
from |
Numeric vector of length |
to |
Numeric vector of length |
length.out |
Either a scalar or a numeric vector of length |
The target function is evaluated on a two-dimensional grid over two selected parameters,
while all other nonlinear parameters are held fixed at values provided by par.
The nonlinear parameter vector is always ordered as
, where and .
In addition to the exported function plot_target(obj = ...), the same functionality
is available as an R6 method via obj$plot_target(...).
A plotly object representing a 3-D surface plot of the target function
values evaluated on the specified parameter grid.
NewPSTR, LinTest, WCB_LinTest,
EstPSTR, EvalTest, WCB_TVTest,
WCB_HETest
pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20, indep_k = c("vala", "debta", "cfa", "sales"), tvars = c("vala"), iT = 14) # 1) Exported function interface ret <- plot_target(obj = pstr, iq = 1, basedon = c(1, 2), from = c(log(1), 6), to = c(log(18), 10), length.out = c(40, 40)) # 2) R6 method interface ret2 <- pstr$plot_target(iq = 1, basedon = c(1, 2), from = c(log(1), 6), to = c(log(18), 10), length.out = c(40, 40))pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20, indep_k = c("vala", "debta", "cfa", "sales"), tvars = c("vala"), iT = 14) # 1) Exported function interface ret <- plot_target(obj = pstr, iq = 1, basedon = c(1, 2), from = c(log(1), 6), to = c(log(18), 10), length.out = c(40, 40)) # 2) R6 method interface ret2 <- pstr$plot_target(iq = 1, basedon = c(1, 2), from = c(log(1), 6), to = c(log(18), 10), length.out = c(40, 40))
This function plots the estimated transition function
of a fitted PSTR model.
plot_transition( obj, size = 1.5, color = "blue", xlim = NULL, ylim = NULL, fill = NULL, alpha = NULL )plot_transition( obj, size = 1.5, color = "blue", xlim = NULL, ylim = NULL, fill = NULL, alpha = NULL )
obj |
An object of class |
size |
Point size. |
color |
Point colour. |
xlim |
Optional numeric vector of length 2 specifying x-axis limits. |
ylim |
Optional numeric vector of length 2 specifying y-axis limits. |
fill |
Optional colour for highlighting the support of observed q. |
alpha |
Transparency level for points and shading. |
Observed transition values are displayed together with the fitted transition curve. For models with multiple switches, multiple curves are shown.
In addition to the exported function
plot_transition(obj = ...), the same functionality is
available as an R6 method via obj$plot_transition(...).
A ggplot2 object.
pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20, indep_k = c("vala","debta","cfa","sales"), tvars = c("vala"), iT = 14) pstr <- EstPSTR(use = pstr, im = 1, iq = 1, useDelta = TRUE, par = c(.63,0), method = "CG") # Exported function plot_transition(pstr) # R6 method pstr$plot_transition()pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20, indep_k = c("vala","debta","cfa","sales"), tvars = c("vala"), iT = 14) pstr <- EstPSTR(use = pstr, im = 1, iq = 1, useDelta = TRUE, par = c(.63,0), method = "CG") # Exported function plot_transition(pstr) # R6 method pstr$plot_transition()
Print method for objects of class "PSTR".
x |
An object of class |
... |
Further arguments passed to the underlying print routine. See Arguments below. |
The print output is organised into four sections:
"summary"Data summary: panel dimensions, dependent variable, linear/non-linear regressors, transition variables.
"tests"Specification tests: linearity (homogeneity) tests and the sequence of homogeneity tests (optionally with WB/WCB p-values if available).
"estimates"Estimation results: coefficient estimates with standard errors and t-ratios, printed in chunks to fit the console width.
"evaluation"Evaluation tests: parameter constancy and no-remaining-nonlinearity tests (optionally with WB/WCB p-values if available).
In addition to calling print(x, ...), the same functionality is available
as an R6 method via x$print(...).
Invisibly returns x.
The following arguments are supported (they are forwarded to the R6 method x$print()):
formatCharacter. Output format passed to knitr::kable() (for example "simple", "pipe", "latex"). Default is "simple".
modeCharacter vector specifying which sections to print. It is matched (partially) against c("summary","tests","estimates","evaluation"). Default is "summary".
digitsInteger. Number of significant digits used in printed tables. Default is 4.
NewPSTR, LinTest, WCB_LinTest,
EstPSTR, EvalTest, WCB_TVTest,
WCB_HETest.
pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20, indep_k = c("vala","debta","cfa","sales"), tvars = c("vala","debta","cfa","sales"), iT = 14) # default: summary only pstr # specification tests print(pstr, mode = "tests", format = "simple") print(pstr, mode = "tests", format = "pipe", caption = "The test results") # estimates print(pstr, mode = "estimates") # evaluation print(pstr, mode = "evaluation") # R6 method interface (same output) pstr$print(mode = c("summary","tests"))pstr <- NewPSTR(Hansen99, dep = "inva", indep = 4:20, indep_k = c("vala","debta","cfa","sales"), tvars = c("vala","debta","cfa","sales"), iT = 14) # default: summary only pstr # specification tests print(pstr, mode = "tests", format = "simple") print(pstr, mode = "tests", format = "pipe", caption = "The test results") # estimates print(pstr, mode = "estimates") # evaluation print(pstr, mode = "evaluation") # R6 method interface (same output) pstr$print(mode = c("summary","tests"))
A dataset containing the transformed Wolf annual sunspot numbers for the years 1710-1979.
sunspotsunspot
A tibble with 270 rows and 11 variables:
transformed sunspot
transformed sunspot, lag one
transformed sunspot, lag two
transformed sunspot, lag three
transformed sunspot, lag four
transformed sunspot, lag five
transformed sunspot, lag six
transformed sunspot, lag seven
transformed sunspot, lag eight
transformed sunspot, lag nine
transformed sunspot, lag ten
Each column of the data matrix is a lagged transformed sunspot observations from lag order 0 to 10.
The data were transformed by using the formula
see Ghaddar and Tong (1981)
Ghaddar, D. K. and Tong, H. (1981) Data transformation and self-exciting threshold autoregression, Applied Statistics, 30, 238–48.
https://www.sidc.be/html/sunspot.html
This function shows the version number and some information of the package.
version()version()
Yukai Yang, [email protected]