coef.rlassoIVselectZ: Coefficients from S3 objects 'rlassoIVselectZ'

View source: R/rlassoIVselectZ.R

coef.rlassoIVselectZR Documentation

Coefficients from S3 objects rlassoIVselectZ

Description

Method to extract coefficients from objects of class rlassoIVselectZ.

Usage

## S3 method for class 'rlassoIVselectZ'
coef(object, complete = TRUE, selection.matrix = FALSE, ...)

Arguments

object

an object of class rlassoIVselectZ, usually a result of a call rlassoIVselectZ or rlassoIV with options select.X=FALSE and select.Z=TRUE.

complete

general option of the function coef.

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.

Details

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.

Examples

## 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)

hdm documentation built on May 29, 2024, 3:35 a.m.