Learn R Programming

dlsem (version 1.0)

dlaglm: Distributed-lag linear regression

Description

Fit a distributed-lag linear regression model. A single group factor may be taken into account using fixed effect panel estimation.

Usage

dlaglm(formula, group = NULL, data, log = FALSE, L = 0, adapt = FALSE,
  max.gestation = NULL, min.width = NULL, sign = NULL)

Arguments

formula
An object of class formula describing the model to be fitted. See Details.
group
The name of the group factor (optional). If NULL, no groups are considered.
data
An object of class data.frame containing the variables included in the model.
log
Logical. If TRUE, logarithmic transformation is applied to numerical variables. Default is FALSE.
L
The highest lag with non-zero autocorrelation (non-negative integer). If greater than 0, the Newey-West correction of the covariance matrix of estimates (Newey and West, 1987) is used. Default is 0.
adapt
Logical. If TRUE, AIC-based selection of lag shapes is performed (see Details). Default is FALSE.
max.gestation
See Details. Ignored if adapt=FALSE.
min.width
See Details. Ignored if adapt=FALSE.
sign
See Details. Ignored if adapt=FALSE.

Value

  • An object of class lm.

Details

The formula cannot contain interaction terms (no ':' or '*' symbols), and may contain the following operators for lag specification: - quec: quadratic (2nd order polynomial) lag shape with endpoint constraints; - qdec: quadratic (2nd order polynomial) decreasing lag shape. Each operator must have the following three arguments (provided within brackets): 1) the name of the covariate to which the lag is applied; 2) the minimum lag with a non-zero coefficient; 3) the maximum lag with a non-zero coefficient. For example, quec(X1,3,15) indicates that a quadratic lag shape with endpoint constraints must be applied to variable X1 in the interval (3,15). If adapt=TRUE, AIC-based selection of lag shapes is performed. The selection involves only the second and the third arguments of each lag operator in the model formula. The following arguments of function dlaglm are considered in the selection: - max.gestation: a named vector, including the maximum gestation lag for one or more covariates; - min.width: a named vector, including the minimum lag width for one or more covariates; - sign: a named vector, including the sign (either '+' or '-') of the coefficients of one or more covariates.

References

B. H. Baltagi (2008). Econometrics (Chapter 6). Springer Verlag, 4th edition, Berlin, DE. W. K. Newey, and K. D. West (1978). A Simple, Positive Semi-Definite, Heteroskedasticity and Autocorrelation Consistent Covariance Matrix. Econometrica, 55(3), 703-708.

See Also

unirootTest, applyDiff, EM.imputation

Examples

Run this code
data(agres)

# first order differentiation
agres.diff <- applyDiff(c("NPATENT","GVA","ENTR_INCOME","PPI"),group="COUNTRY",data=agres,k=1)

# fit without AIC-based selection of lag shapes
dl0 <- dlaglm(ENTR_INCOME~quec(NPATENT,0,3)+quec(GVA,1,10)+GDP+FARM_SIZE,group="COUNTRY",
  data=agres.diff,log=TRUE)

### AIC-based selection of lag shapes: NOT RUN
#dl0 <- dlaglm(ENTR_INCOME~quec(NPATENT,0,3)+quec(GVA,1,10)+GDP+FARM_SIZE,group="COUNTRY",
#  data=agres.diff,log=TRUE,adapt=T,max.gestation=c(NPATENT=3,GVA=3),
#  min.width=c(NPATENT=3,GVA=3),sign=c(NPATENT="+",GVA="+")) 

# summaries of model fitting
summary(dl0)

Run the code above in your browser using DataLab