View source: R/plot_magnitude.R
plot_proportion | R Documentation |
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()
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
)
estimate |
|
error_layout |
|
error_scale |
|
error_normalize |
|
rope |
|
plot_possible |
|
ggtheme |
|
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
Returns a ggplot object
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.