glmnet_model | R Documentation |
Apply a regularized (generalized) linear model in parallel across each response $y$ in an outcome or mediation model. This can be helpful when we have many mediators or pretreatment variables, making the input high-dimensional.
glmnet_model(progress = TRUE, ...)
progress |
A logical indicating whether to show a progress bar during estimation. |
... |
Keyword parameters passed to package 'glmnet'. |
model An object of class model
with estimator, predictor, and
sampler functions associated wtih a lienar model.
model lm_model rf_model
exper <- demo_joy() |>
mediation_data("PHQ", "treatment", starts_with("ASV"))
multimedia(exper, glmnet_model(lambda = 1)) |>
estimate(exper)
multimedia(exper, glmnet_model(lambda = 1), glmnet_model()) |>
estimate(exper)
# example with another dataset
exper <- demo_spline(tau = c(2, 1)) |>
mediation_data(starts_with("outcome"), "treatment", "mediator")
multimedia(exper, glmnet_model(lambda = 0.1)) |>
estimate(exper)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.