plot_proportion {esci} | R Documentation |
Plot an estimated proportion
Description
plot_proportion
creates a ggplot2 plot suitable for visualizing an
estimated proportion from a categorical variable. This function can be passed
an esci_estimate object generated by estimate_proportion()
Usage
plot_proportion(
estimate,
error_layout = c("halfeye", "eye", "gradient", "none"),
error_scale = 0.3,
error_normalize = c("groups", "all", "panels"),
rope = c(NA, NA),
plot_possible = FALSE,
ggtheme = NULL
)
Arguments
estimate |
|
error_layout |
|
error_scale |
|
error_normalize |
|
rope |
|
plot_possible |
|
ggtheme |
|
Details
This function was developed primarily for student use within jamovi when learning along with the text book Introduction to the New Statistics, 2nd edition (Cumming & Calin-Jageman, 2024).
Expect breaking changes as this function is improved for general use. Work still do be done includes:
Revise to avoid deprecated ggplot features
Revise for consistent ability to control aesthetics and consistent layer names
Value
Returns a ggplot object
Examples
# From raw data
data("data_campus_involvement")
estimate_from_raw <- esci::estimate_proportion(
esci::data_campus_involvement,
CommuterStatus
)
# To visualize the estimate
myplot_from_raw <- esci::plot_proportion(estimate_from_raw)
# From summary data
estimate_from_summary <- esci::estimate_proportion(
cases = c(8, 22-8),
outcome_variable_levels = c("Affected", "Not Affected")
)
# To visualize the estimate
myplot_from_summary<- esci::plot_proportion(estimate_from_summary)