View source: R/rlassoIVselectZ.R
rlassoIVselectZ | R Documentation |
This function selects the instrumental variables in the first stage by
Lasso. First stage predictions are then used in the second stage as optimal
instruments to estimate the parameter vector. The function returns an element of class rlassoIVselectZ
rlassoIVselectZ(x, ...)
## Default S3 method:
rlassoIVselectZ(x, d, y, z, post = TRUE, intercept = TRUE, ...)
## S3 method for class 'formula'
rlassoIVselectZ(formula, data, post = TRUE, intercept = TRUE, ...)
x |
exogenous variables in the structural equation (matrix) |
... |
arguments passed to the function |
d |
endogenous variables in the structural equation (vector or matrix) |
y |
outcome or dependent variable in the structural equation (vector or matrix) |
z |
set of potential instruments for the endogenous variables. Exogenous variables serve as their own instruments. |
post |
logical. If |
intercept |
logical. If |
formula |
An object of class |
data |
An optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model.
If not found in data, the variables are taken from environment(formula), typically the environment from which |
The implementation follows the procedure described in Belloni et al. (2012).
Option post=TRUE
conducts post-lasso estimation, i.e. a refit of the
model with the selected variables, to estimate the optimal instruments. The
parameter vector of the structural equation is then fitted by two-stage
least square (tsls) estimation.
An object of class rlassoIVselectZ
containing at least the following
components:
coefficients |
estimated parameter vector |
vcov |
variance-covariance matrix |
residuals |
residuals |
samplesize |
sample size |
selection.matrix |
matrix of selected variables in the first stage for each endogenous variable |
D. Belloni, D. Chen, V. Chernozhukov and C. Hansen (2012). Sparse models and methods for optimal instruments with an application to eminent domain. Econometrica 80 (6), 2369–2429.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.