PSTR (version 1.0.1)

NewPSTR: Create an object of the class PSTR.

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

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.

indep

a vector of column numbers of names of the independent variables.

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.

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

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.

See Also

LinTest

Examples

Run this code
# NOT RUN {
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")

# }

Run the code above in your browser using DataLab