Learn R Programming

sjPlot (version 1.7)

sjp.lmm: Plot beta coefficients of multiple fitted lm's

Description

Plot beta coefficients (estimates) with confidence intervalls of multiple fitted linear models in one plot.

Usage

sjp.lmm(..., title = NULL, labelDependentVariables = NULL,
  legendDepVarTitle = "Dependent Variables", legendPValTitle = "p-level",
  stringModel = "Model", axisLabels.y = NULL, axisTitle.x = "Estimates",
  axisLimits = NULL, breakTitleAt = 50, breakLabelsAt = 25,
  breakLegendAt = 20, gridBreaksAt = NULL, geom.size = 3,
  geom.spacing = 0.4, geom.colors = "Dark2", nsAlpha = 1,
  usePShapes = FALSE, interceptLineType = 2,
  interceptLineColor = "grey70", coord.flip = TRUE, showIntercept = FALSE,
  showAxisLabels.y = TRUE, showValueLabels = TRUE, labelDigits = 2,
  showPValueLabels = TRUE, hideLegend = FALSE, facet.grid = FALSE,
  printPlot = TRUE)

Arguments

Value

(Insisibily) returns the ggplot-object with the complete plot (plot) as well as the data frame that was used for setting up the ggplot-object (df).

See Also

Examples

Run this code
# 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
data(efc)

# fit first model
fit1 <- lm(barthtot ~ c160age + c12hour + c161sex + c172code, data=efc)
# fit second model
fit2 <- lm(neg_c_7 ~ c160age + c12hour + c161sex + c172code, data=efc)
# fit third model
fit3 <- lm(tot_sc_e ~ c160age + c12hour + c161sex + c172code, data=efc)

# plot multiple models
sjp.lmm(fit1, fit2, fit3, facet.grid=TRUE)

# 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,
         nsAlpha=0.3)

Run the code above in your browser using DataLab