# prepare dummy variables for binary logistic regression
# Now fit the models. Note that all models share the same predictors
# and only differ in their dependent variable
library(sjmisc)
data(efc)
# fit three models
fit1 <- lm(barthtot ~ c160age + c12hour + c161sex + c172code, data = efc)
fit2 <- lm(neg_c_7 ~ c160age + c12hour + c161sex + c172code, data = efc)
fit3 <- lm(tot_sc_e ~ c160age + c12hour + c161sex + c172code, data = efc)
# plot multiple models
sjp.lmm(fit1, fit2, fit3, facet.grid = TRUE, fade.ns = FALSE)
# plot multiple models with legend labels and point shapes instead of value labels
sjp.lmm(fit1, fit2, fit3,
axisLabels.y = c("Carer's Age",
"Hours of Care",
"Carer's Sex",
"Educational Status"),
labelDependentVariables = c("Barthel Index",
"Negative Impact",
"Services used"),
showValueLabels = FALSE,
showPValueLabels = FALSE,
usePShapes = TRUE)
# plot multiple models from nested lists parameter
all.models <- list()
all.models[[1]] <- fit1
all.models[[2]] <- fit2
all.models[[3]] <- fit3
sjp.lmm(all.models)
Run the code above in your browser using DataLab