ptm2 {PanelTM} | R Documentation |
Two-way panel threshold regression model.
Description
Two-way panel threshold regression model with the 2-step GMM estimator.
Usage
ptm2(Y, TV=NULL, Xendo=NULL, Xexo=NULL, IV=NULL, trimrate=0.4,
ngrid=100, h0=1.5, Iweight=FALSE, test.lin=TRUE, B=1000)
Arguments
Y |
a |
TV |
a |
Xendo |
a |
Xexo |
a |
IV |
a matrix of the additional instrumental variables to include in the analysis. The rows contain in order |
trimrate |
the trim rate when constructing the grid for estimating the threshold. Default is set to 0.4. |
ngrid |
the number of grid points to estimate the threshold. Default is set to 100. |
h0 |
the parameter for Silverman's rule of thumb for kernel estimation. The default is set to 1.5. |
Iweight |
the 1-st step weight matrix. If |
test.lin |
if |
B |
if |
Details
ptm2
performs the first-difference 2-step GMM estimator by Seo and Shin (2016) for panel threshold regression. The following steps are performed in the estimation algorithm:
Computes the first differences of the dependent and independent variables.
Defines the instrumental variables matrix, which includes the lagged dependent and independent variables, and the additional instrumental variables in the IV matrix (if specified).
Constructs the 1-st step weight matrix according to the Iweight option.
Identifies a set of equally distant points between quantiles (
trimrate
/2) and 1-(trimrate
/2) of the threshold variable vector. The number of points is specified in the option ngrid.Computes the GMM estimator setting the threshold equal to each selected point and computes the residuals. Identifies the 1st-step estimator by minimizing the residual.
Constructs the 2nd-step weight matrix from the residuals associated with the 1st-step estimator.
Repeats steps 4. and 5. and returns the 2nd-step estimator of the 1st-differenced parameters, the threshold, and the covariance matrix.
Value
An object of S4 class "ptm2", which is a list with the following elements:
threshold |
the estimated threshold and the associated p-value. |
estimates |
the |
cov. |
the sample version of covariance matrix of the estimated paramaters. |
residuals. |
the |
test.lin. |
the |
Note
The method requires at least 6 times of observation: four lags of the dependent and independent variables are used as instruments, and two more are necessary to identify the regime switch (i.e., one per regime).
Author(s)
Francesca Marta Lilja Di Lascio <marta.dilascio@unibz.it>
Selene Perazzini <selene.perazzini@alumni.imtlucca.it>
References
Seo, M.H. and Shin, Y. (2016) Dynamic panels with threshold effect and endogeneity. Journal of Econometrics, 195(2), p.169-186.
Seo, M.H., Kim, S. and Kim Y.-J. (2019) Estimation of dynamic panel threshold model using Stata. The Stata Journal, 19(3), p.685-697.
See Also
Examples
## Select data
data(banana)
data <- banana[which(banana$j==1),]
# Prepare input matrices for ptm2
bioimpedance <- matrix(data$bioimpedance, ncol=length(unique(data$t)),
byrow=TRUE)
weight <- matrix(data$weight, ncol=length(unique(data$t)), byrow=TRUE)
## Estimation
# Model on bioimpedance y_{it} with transition variable y_{i(t-1)}
# y_{it}= (phi1_c)1(y_{it-1}<= gamma) + (phi2_c)1(y_{it-1}>gamma)
# Estimation and linear test
ptm2(Y=bioimpedance, TV=NULL, Xendo=NULL, Xexo=NULL, IV=NULL,
trimrate=0.4, ngrid=100, h0=1.5, Iweight=FALSE, test.lin=TRUE,
B=100)
## NOT RUN
## Model on bioimpedance y_{it} with transition variable y_{i(t-1)} and
## weight as regressor x_{it}:
## y_{it}= (phi1_c + phi1_X*x_{it})1(y_{it-1}<= gamma) +
## (phi2_c + phi2_X*x_{it})1(y_{it-1}>gamma)
#ptm2(Y=bioimpedance, TV=NULL, Xendo=weight, Xexo=NULL, IV=NULL,
# trimrate=0.4, ngrid=100, h0=1.5, Iweight=FALSE, test.lin=FALSE)
##