if (FALSE) {
# Example 1: set reference categories for the whole dataset and choose
# answer option 3:
set_refcat(data = NHANES)
3
# insert the returned string as argument refcats
mod1 <- lm_imp(SBP ~ age + race + creat + educ, data = NHANES,
refcats = 'largest')
# Example 2:
# specify a model formula
fmla <- SBP ~ age + gender + race + bili + smoke + alc
# write the output of set_refcat to an object
ref_mod2 <- set_refcat(data = NHANES, formula = fmla)
4
2
5
1
1
# enter the output in the model specification
mod2 <- lm_imp(formula = fmla, data = NHANES, refcats = ref_mod2,
n.adapt = 0)
}
Run the code above in your browser using DataLab