View source: R/plot_magnitude.R
plot_magnitude | R Documentation |
plot_magnitude
creates a ggplot2 plot suitable for visualizing
the results of a study with one group and one or more continuous outcome
variables. It can highlight either the mean or median of each outcome
variable. This function can be passed an esci_estimate object generated by
estimate_magnitude()
plot_magnitude(
estimate,
effect_size = c("mean", "median"),
data_layout = c("random", "swarm", "none"),
data_spread = 0.25,
error_layout = c("halfeye", "eye", "gradient", "none"),
error_scale = 0.3,
error_nudge = 0.35,
error_normalize = c("groups", "all", "panels"),
rope = c(NA, NA),
ggtheme = NULL
)
estimate |
|
effect_size |
|
data_layout |
|
data_spread |
|
error_layout |
|
error_scale |
|
error_nudge |
|
error_normalize |
|
rope |
|
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_penlaptop1")
estimate_from_raw <- esci::estimate_magnitude(
data = data_penlaptop1[data_penlaptop1$condition == "Pen", ],
outcome_variable = transcription
)
# To visualize the estimate
myplot_from_raw <- esci::plot_magnitude(
estimate_from_raw,
effect_size = "median"
)
# From summary data
mymean <- 24.5
mysd <- 3.65
myn <- 40
estimate_from_summary <- esci::estimate_magnitude(
mean = mymean,
sd = mysd,
n = myn
)
# To visualize the estimate
myplot_from_summary <- esci::plot_magnitude(
estimate_from_summary,
effect_size = "mean"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.