Fits a balanced panel data model using the Time-Varying Pooled Ordinary Least Squares, the Time-Varying Random Effects and the Time-Varying Fixed Effects models.
tvPLM(
formula,
z = NULL,
ez = NULL,
data,
index = NULL,
bw = NULL,
bw.cov = NULL,
cv.block = 0,
method = c("pooling", "random", "within"),
est = c("lc", "ll"),
tkernel = c("Triweight", "Epa", "Gaussian"),
control = tvreg.control(...),
...
)
An object of class formula.
A vector containing the smoothing variable.
(optional) A scalar or vector with the smoothing estimation values. If
values are included then the vector z
is used.
An optional data frame or matrix.
Indicates the individual and time indexes.
An opcional scalar. It represents the bandwidth in the estimation of trend coefficients. If NULL, it is selected by cross validation.
An optional scalar. It represents the bandwidth in the "lc" nonparametric estimation of the
time-varying covariance matrix. If NULL, it is selected by cross validation for method "random"
.
A positive scalar with the size of the block in leave one block out cross-validation. By default 'cv.block=0' meaning leave one out cross-validation.
A character with the choice of panel model/estimation method:
If method = "pooling"
(default) then the data is pooled estimated with time-varying OLS.
No individual or time effects are estimated
If method = "random"
then individual effects are considered random and independent
of the regressors.
If method = "within"
then individual effects which might be correlated with
the regressors are estimated.
The nonparametric estimation method, one of "lc" (default) for linear constant
A character, either "Triweight" (default), "Epa" or "Gaussian" kernel function.
list of control parameters. The default is constructed by
the function tvreg.control
. See the documentation of
tvreg.control
for details.
Other parameters passed to specific methods.
tvPLM
returns a list of the class tvplm
containing the results of model, results of the estimation
and confidence instervals if chosen.
The object of class tvplm
have the following components:
An array of dimension obs x nvar x neq (obs = number of observations, nvar = number of variables in each equation, neq = number of equations in the system) with the time-varying coefficients estimates.
If level
non equal zero, an array of dimension obs x nvar x neq containing the confidence
interval lower band.
If level
non equal zero, an array of dimension obs x nvar x neq containing the confidence
interval upper band.
The fitted values.
Estimation residuals.
A list with the regressors data.
A matrix with the dependent variable data.
A vector with the smoothing variable.
A vector with the smoothing estimation values.
A vector with the individual fixed effects, if chosen.
Bandwidth of mean estimation.
Integer specifying the total number of observations.
Integer specifying the number of cross-section observations.
Integer specifying the number of time observations per cross-section.
Number of variables.
Estimation method.
Nonparemtric estimation methodology.
Kernel type.
Confidence interval range.
Number of bootstrap replications.
Type of bootstrap.
List with all bootstrap replications of coefficients
, if done.
Initial formula.
Matched call.
This function wraps up the kernel smoothing time-varying coefficient pooled, random effects and fixed effects estimators.
Bandwidth selection is of great importance in kernel smoothing methodologies and it is done automatically by cross-validation.
A panel data model consists of "neq" elements in the cross-sectional dimention and "obs" number of time observations for each cross-section. All variables are the same for each equation which have common coefficients.
Casas, I., Gao, J., Peng B., and Xie, S. (2019). Modelling Time-Varying Income Elasticities of Health Care Expenditure for the OECD. Available at SSRN: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3262326
Sun, Y., Carrol, R.J and Li, D. (2009). Semiparametric Estimation of Fixed-Effects Panel Data Varying Coefficient Models. Advances in Econometrics, 25, pp. 101-129.
# NOT RUN {
data(OECD)
##TVPOLS estimation of the model
tvpols <- tvPLM(lhe~lgdp+pop65+pop14+public, index = c("country", "year"),
data = OECD, method ="pooling", bw = 0.3)
# }
# NOT RUN {
tvfe <- tvPLM(lhe~lgdp+pop65+pop14+public, index = c("country", "year"),
data = OECD, method ="within", bw = 0.8)
tvre <- tvPLM(lhe~lgdp+pop65+pop14+public, index = c("country", "year"),
data = OECD, method ="random", bw = 0.3)
# }
Run the code above in your browser using DataLab