Learn R Programming

sjPlot (version 1.7)

sjp.aov1: Plot One-Way-Anova tables

Description

Plot One-Way-Anova table sum of squares (SS) of each factor level (group) against the dependent variable. The SS of the factor variable against the dependent variable (variance within and between groups) is printed to the model summary.

Usage

sjp.aov1(depVar, grpVar, meansums = FALSE, type = "dots",
  hideErrorBars = FALSE, title = NULL, axisLabels.y = NULL,
  reverseOrder = FALSE, stringIntercept = "(Intercept)",
  showAxisLabels.y = TRUE, axisTitle.x = "", axisLimits = NULL,
  errorBarColor = NULL, geom.colors = c("#3366a0", "#aa3333"),
  geom.size = 3, breakTitleAt = 50, breakLabelsAt = 25,
  gridBreaksAt = NULL, expand.grid = FALSE, showValueLabels = TRUE,
  labelDigits = 2, showPValueLabels = TRUE, showModelSummary = TRUE,
  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
data(efc)
# note: "grpVar" does not need to be a factor.
# coercion to factor is done by the function
sjp.aov1(efc$c12hour, efc$e42dep)


data(efc)
efc.val <- get_val_labels(efc)
efc.var <- get_var_labels(efc)
sjp.aov1(efc$c12hour,
         as.factor(efc$e42dep),
         axisLabels.y = efc.val['e42dep'],
         axisTitle.x = efc.var[['c12hour']])

# -------------------------------------------------
# auto-detection of value labels and variable names
# -------------------------------------------------
efc <- set_var_labels(efc, efc.var)
sjp.aov1(efc$c12hour,
         efc$e42dep)

# bar-plot, don't use this!
# however, if you dare to, adjust
# 'geom.size'...
sjp.aov1(efc$c12hour,
         as.factor(efc$c172code),
         axisLabels.y = efc.val['c172code'],
         title = efc.var[['c12hour']],
         type = "bars",
         geom.size = 0.5,
         showModelSummary = FALSE)

Run the code above in your browser using DataLab