Description Usage Arguments Value See Also Examples
shade_p_value()
plots p-value region(s) on top of the visualize()
output.
It should be used as {ggplot2} layer function (see examples).
shade_pvalue()
is its alias.
1 2 3 | shade_p_value(obs_stat, direction, color = "red2", fill = "pink", ...)
shade_pvalue(obs_stat, direction, color = "red2", fill = "pink", ...)
|
obs_stat |
A numeric value or 1x1 data frame corresponding to what the observed statistic is. |
direction |
A string specifying in which direction the shading should
occur. Options are |
color |
A character or hex string specifying the color of the observed statistic as a vertical line on the plot. |
fill |
A character or hex string specifying the color to shade the
p-value region. If |
... |
Other arguments passed along to {ggplot2} functions. |
A list of {ggplot2} objects to be added to the visualize()
output.
shade_confidence_interval()
to add information about confidence
interval.
1 2 3 4 5 6 7 8 9 10 11 | 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_p_value(1.5, direction = "right")
viz_plot + shade_p_value(1.5, direction = "both")
viz_plot + shade_p_value(1.5, direction = NULL)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.