View source: R/rlassoIVselectZ.R
coef.rlassoIVselectZ | R Documentation |
rlassoIVselectZ
Method to extract coefficients from objects of class rlassoIVselectZ
.
## S3 method for class 'rlassoIVselectZ'
coef(object, complete = TRUE, selection.matrix = FALSE, ...)
object |
an object of class |
complete |
general option of the function |
selection.matrix |
if TRUE, a selection matrix is returned that indicates the selected variables from each first stage regression. Default is set to FALSE. See section on details for more information. |
... |
further arguments passed to functions coef. |
Printing coefficients and selection matrix for S3 object rlassoIVselectZ
. The columns of the selection matrix report the selection index for the first stage lasso regressions as specified
rlassoIVselectZ
command, i.e., the selected variables for each of the endogenous variables. "x"
indicates that a variable has been selected, i.e., the corresponding estimated coefficient is different from zero.
The very last column collects all variables that have been selected in at least one of the lasso regressions.
## Not run:
lasso.IV.Z = rlassoIVselectZ(x=x, d=d, y=y, z=z)
data(EminentDomain)
z <- EminentDomain$logGDP$z # instruments
x <- EminentDomain$logGDP$x # exogenous variables
y <- EminentDomain$logGDP$y # outcome varialbe
d <- EminentDomain$logGDP$d # treatment / endogenous variable
lasso.IV.Z = rlassoIVselectZ(x=x, d=d, y=y, z=z)
coef(lasso.IV.Z) # Default behavior
coef(lasso.IV.Z, selection.matrix = T)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.