Learn R Programming

tvReg (version 0.5.6)

tvPLM: Time-Varying Coefficients Panel Data Models

Description

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.

Usage

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(...),
  ...
)

Arguments

formula

An object of class formula.

z

A vector containing the smoothing variable.

ez

(optional) A scalar or vector with the smoothing estimation values. If values are included then the vector z is used.

data

An optional data frame or matrix.

index

Indicates the individual and time indexes.

bw

An opcional scalar. It represents the bandwidth in the estimation of trend coefficients. If NULL, it is selected by cross validation.

bw.cov

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".

cv.block

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.

method

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.

est

The nonparametric estimation method, one of "lc" (default) for linear constant

tkernel

A character, either "Triweight" (default), "Epa" or "Gaussian" kernel function.

control

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.

Value

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:

coefficients

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.

Lower

If level non equal zero, an array of dimension obs x nvar x neq containing the confidence interval lower band.

Upper

If level non equal zero, an array of dimension obs x nvar x neq containing the confidence interval upper band.

fitted

The fitted values.

residuals

Estimation residuals.

x

A list with the regressors data.

y

A matrix with the dependent variable data.

z

A vector with the smoothing variable.

ez

A vector with the smoothing estimation values.

alpha

A vector with the individual fixed effects, if chosen.

bw

Bandwidth of mean estimation.

totobs

Integer specifying the total number of observations.

neq

Integer specifying the number of cross-section observations.

obs

Integer specifying the number of time observations per cross-section.

nvar

Number of variables.

method

Estimation method.

est

Nonparemtric estimation methodology.

tkernel

Kernel type.

level

Confidence interval range.

runs

Number of bootstrap replications.

tboot

Type of bootstrap.

BOOT

List with all bootstrap replications of coefficients, if done.

formula

Initial formula.

call

Matched call.

Details

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.

References

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.

See Also

bw, confint, plot, print and summary

Examples

Run this code
# 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