combine_lrm_models | R Documentation |
Combine two logistic regression models generated by lrm_model. Read the models information and refit the new models based on the union of the variables in two models.
combine_lrm_models(data = data, model1 = model1, model2 = model2, Included = NULL)
data |
The data. It must contain the variables (columns) that should be used, directly or indirectly, in the modelling procedures. Missing values (NA) are allowed. |
model1 |
The first model. |
model2 |
The second model. |
Included |
A variable list whose elements are forced to be included in the models, no matter variable selection is conducted or not. Default: NULL. |
A list data structure which contains model results.
model.Psyco1 <- lrm_model(data = ModelBase, DVList = DVList, IDVList = PsycoVars1) model.Psyco2 <- lrm_model(data = ModelBase, DVList = DVList, IDVList = PsycoVars2) #combine two Psyco models model.Psyco <- combine_lrm_models(data=ModelBase, model1=model.Psyco1, model2 = model.Psyco2) #combine two Psyco models, however, we force the demo variables to be in the final model. #the demo variables have to be in the data already. DemoVars <- c('Gender','respmar2','employ','incmid','parent','own','agemid','race1','race2','race3','educat1','educat2','educat3') model.Psyco <- combine_lrm_models(data=ModelBase, model1=model.Psyco1, model2 = model.Psyco2, Included = DemoVars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.