Description Usage Arguments Value
View source: R/post_lasso_cv.R
This function uses the glmnet
package to estimate the coefficient paths
and cross-validates Lasso AND Post-Lasso
1 2 3 |
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 |
List with the names of selected variables at cross-validated minima for Lasso and Post-Lasso
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.