# 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)
## ymax not defined: adjusting position using y instead
## ymax not defined: adjusting position using y instead
## ymax not defined: adjusting position using y instead
## ymax not defined: adjusting position using y instead
## ymax not defined: adjusting position using y instead
## ymax not defined: adjusting position using y instead
# 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,
fade.ns = TRUE,
usePShapes = TRUE)
## ymax not defined: adjusting position using y instead
## ymax not defined: adjusting position using y instead
# ------------------------------
# plot multiple models from nested lists argument
# ------------------------------
all.models <- list()
all.models[[1]] <- fit1
all.models[[2]] <- fit2
all.models[[3]] <- fit3
sjp.lmm(all.models)
## ymax not defined: adjusting position using y instead
## ymax not defined: adjusting position using y instead
# ------------------------------
# plot multiple models with different
# predictors (stepwise inclusion),
# standardi estimates
# ------------------------------
fit1 <- lm(mpg ~ wt + cyl + disp + gear, data = mtcars)
fit2 <- update(fit1, . ~ . + hp)
fit3 <- update(fit2, . ~ . + am)
sjp.lmm(fit1, fit2, fit3, type = "std2")
## Error: Package 'arm' needed for computing this type of standardized estimates. Please install it.