Skip to contents

Boxplot with jittered points, shared across every runner whose result carries vars = c(group_column, outcome_column): t_test_ind, mann_whitney, kruskal_wallis, and anova_one. 1 function instead of 4, since the underlying comparison (an outcome split by a grouping factor) and the data shape needed to plot it are identical across all 4 tests, and only the inferential statistic differs.

Usage

sframe_plot_group_comparison(result, data, palette = c("web", "print"))

Arguments

result

A result list from one of the 4 runners above, with vars = c(group_column, outcome_column).

data

The response data frame the result was computed from.

palette

One of "web" or "print". See sframe_brand().

Value

A ggplot2 object, or NULL if the columns are missing, fewer than 2 groups remain after removing missing values, or ggplot2 is unavailable.

Examples

# \donttest{
if (requireNamespace("ggplot2", quietly = TRUE)) {
  demo <- sframe_demo("tourism_services")
  res <- run_analysis_plan(demo$responses, demo$instrument)
  sframe_plot_group_comparison(res$rq_visit_bi, demo$responses)
}
# }