fit.updated.formulas {CICI} | R Documentation |
Fit models after screening
Description
Fits the models that have been generated with screening using model.formulas.update
.
Usage
fit.updated.formulas(formulas, X)
Arguments
formulas |
An object returned by |
X |
A data frame on which the model formulas should be evaluated |
Details
Fits generalized (additive) linear models based on the screened model formula list generated by model.formulas.update
.
Value
Returns a list of length 2:
fitted.models |
A list of length 4, containing the fitted Y-/L-/C- and A-models. |
all.summaries |
A list of length 4, containing the summary of the fitted Y-/L-/C- and A-models. |
See Also
Examples
data(EFV)
# first: generate generic model formulas
m <- make.model.formulas(X=EFV,
Lnodes = c("adherence.1","weight.1",
"adherence.2","weight.2",
"adherence.3","weight.3",
"adherence.4","weight.4"
),
Ynodes = c("VL.0","VL.1","VL.2","VL.3","VL.4"),
Anodes = c("efv.0","efv.1","efv.2","efv.3","efv.4"),
evaluate=FALSE)
# second: update these model formulas based on variable screening with LASSO
glmnet.formulas <- model.formulas.update(m$model.names, EFV)
glmnet.formulas
# then: fit and inspect the updated models
fitted.models <- fit.updated.formulas(glmnet.formulas, EFV)
fitted.models$all.summaries
fitted.models$all.summaries$Ynames[1] # first outcome model
[Package CICI version 0.9.1 Index]