NewPSTR: Create an object of the class PSTR.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/PSTR.R

Description

Create an object of the S3 class PSTR for later usage. This function should be run prior to the other functions in the package. It will return an object which you will use as an input for the other functions. It builds up the basic settings for the Panel Smooth Transition Regression (PSTR) Modelling.

Usage

1
NewPSTR(data, dep, indep, indep_k = NULL, tvars, im = 1, iT)

Arguments

data

a tibble of data. The number of rows of data must be the sample size iT times individuals number N.

dep

column number or name of the dependent variable. Note that this must be specified.

indep

a vector of column numbers of names of the independent variables. Note that this must be specified.

indep_k

a vector of column numbers of names of the independent variables in the nonlinear part. If indep_k is not given (= NULL), the nonlinear part will be the same as the linear part.

tvars

a vector of column numbers or names of the potential transition variables to be tested.

im

maximal number of switches in the transition function used in the linearity evaluation tests, by default im=1.

iT

sample size.

Details

Potential transition variables in tvars will be tested one by one in, for example, LinTest function.

There is no need to specify the number of individuals, as it will be obtained automatically inside the function given the number of rows and the sample size iT.

NAs in data are removed automatically inside the function.

Value

An object of the class PSTR for later usage.

The object is a list containing the following components:

iT

the time length of the panel

iN

the number of individuals

vY

the vector of the dependent variable

mX

the matrix of the explanatory variables in the linear part

mK

the matrix of the explanatory variables in the nonlinear part

mQ

the matrix of the potential transition variables

im

the maximal number of switches used in the linearity test

Author(s)

Yukai Yang, [email protected]

See Also

LinTest

Examples

1
2
3
4
5
6
pstr = NewPSTR(Hansen99, dep='inva', indep=4:20, indep_k=c('vala','debta','cfa','sales'),
    tvars=c('vala','debta'), iT=14)

pstr

print(pstr,"summary")

yukai-yang/PSTR documentation built on Nov. 5, 2019, 4:50 p.m.