infer (version 0.4.0.1)

shade_confidence_interval: Add information about confidence interval

Description

shade_confidence_interval() plots confidence interval region on top of the visualize() output. It should be used as {ggplot2} layer function (see examples). shade_ci() is its alias.

Usage

shade_confidence_interval(endpoints, color = "mediumaquamarine",
  fill = "turquoise", ...)

shade_ci(endpoints, color = "mediumaquamarine", fill = "turquoise", ...)

Arguments

endpoints

A 2 element vector or a 1 x 2 data frame containing the lower and upper values to be plotted. Most useful for visualizing conference intervals.

color

A character or hex string specifying the color of the end points as a vertical lines on the plot.

fill

A character or hex string specifying the color to shade the confidence interval. If NULL then no shading is actually done.

...

Other arguments passed along to {ggplot2} functions.

Value

A list of {ggplot2} objects to be added to the visualize() output.

See Also

shade_p_value() to add information about p-value region.

Examples

Run this code
# NOT RUN {
viz_plot <- mtcars %>%
  dplyr::mutate(am = factor(am)) %>%
  specify(mpg ~ am) %>% # alt: response = mpg, explanatory = am
  hypothesize(null = "independence") %>%
  generate(reps = 100, type = "permute") %>%
  calculate(stat = "t", order = c("1", "0")) %>%
  visualize(method = "both")

viz_plot + shade_confidence_interval(c(-1.5, 1.5))
viz_plot + shade_confidence_interval(c(-1.5, 1.5), fill = NULL)

# }

Run the code above in your browser using DataCamp Workspace