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, ...)# S3 method for default
rlassoIVselectZ(x, d, y, z, post = TRUE, intercept = TRUE, ...)
# S3 method for formula
rlassoIVselectZ(formula, data, post = TRUE, intercept = TRUE, ...)
An object of class rlassoIVselectZ
containing at least the following
components:
estimated parameter vector
variance-covariance matrix
residuals
sample size
matrix of selected variables in the first stage for each endogenous variable
exogenous variables in the structural equation (matrix)
arguments passed to the function rlasso
.
endogenous variables in the structural equation (vector or matrix)
outcome or dependent variable in the structural equation (vector or matrix)
set of potential instruments for the endogenous variables. Exogenous variables serve as their own instruments.
logical. If TRUE
, post-lasso estimation is conducted.
logical. If TRUE
, intercept is included in the second stage equation.
An object of class Formula
of the form " y ~ x + d | x + z" with y the outcome variable,
d endogenous variable, z instrumental variables, and x exogenous variables.
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 rlassoIVselectZ
is called.
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.
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.