post_lasso_cv: This function uses the 'glmnet' package to estimate the...

Description Usage Arguments Value

View source: R/post_lasso_cv.R

Description

This function uses the glmnet package to estimate the coefficient paths and cross-validates Lasso AND Post-Lasso

Usage

1
2
3
post_lasso_cv(x, y, w = NULL, kf = 10, family = "gaussian", seed = NULL,
  output = TRUE, d = NULL, parallel = FALSE, graph_file = NULL,
  se_rule = NULL, ...)

Arguments

x

Matrix of covariates (number of observations times number of covariates matrix)

y

vector of outcomes

w

vector of weights

kf

number of folds in k-fold CV

family

Outcome family, currenlty "gaussian" and "binomial" supported

seed

CV samples are drawn starting with a specified seed

output

If TRUE, output and graphs are printed

d

vector with binary treatment indicator, if not NULL, weights are normalized to sum to N in treated and control also in CV samples

parallel

If TRUE, cross-validation parallelized

graph_file

Option to define path to save graph

se_rule

If not NULL, define, e.g., c(-1,1) to get 1SE and 1SE+ rule

...

Pass glmnet options

Value

List with the names of selected variables at cross-validated minima for Lasso and Post-Lasso


MCKnaus/dmlmt documentation built on Dec. 4, 2020, 9:48 a.m.