combine_lrm_models: Combine Logistic Regression Models

Description Usage Arguments Value Examples

Description

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.

Usage

1
2
combine_lrm_models(data = data, model1 = model1, model2 = model2,
  Included = NULL)

Arguments

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.

Value

A list data structure which contains model results.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

yangx227/SimmonsResearchR documentation built on Oct. 5, 2017, 4:09 p.m.