# \donttest{
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
# third: use these models for estimation
est <- gformula(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"),
Yform=glmnet.formulas$Ynames, Lform=glmnet.formulas$Lnames,
abar=seq(0,2,1)
)
est
# }
Run the code above in your browser using DataLab