View source: R/plot_power_curve_ci.R
| plot_power_curve_ci | R Documentation |
Visualizes the isotonic power curve produced by
sample_size_EGA_montecarlo() together with a 95 percent bootstrap
band, the recommended sample size and its confidence interval as a
bracket on the x axis, and (optionally) the empirical validation point.
Conceptually related to the bootstrap-spline plot in the powerly package (Constantin et al., 2023), but distinct in styling, color palette, annotations (bracket on the x axis, validation marker) and underlying object (combined power, not an arbitrary statistic).
plot_power_curve_ci(
x,
show_validation = TRUE,
show_observed = TRUE,
ribbon_alpha = 0.25,
palette = c(median = "#2A6F4D", ribbon = "#7FB99B", accent = "#C25E2A"),
...
)
x |
Object returned by |
show_validation |
Logical; overlay the empirical power at the
validation |
show_observed |
Logical; overlay the observed (non-bootstrapped) power per grid point. |
ribbon_alpha |
Numeric in (0, 1); transparency of the bootstrap band. |
palette |
Character vector of length 3 with colors for: median curve, bootstrap band, validation/recommendation accents. |
... |
Ignored. For |
A ggplot object.
res <- sample_size_EGA_montecarlo(
community_sizes = c(4, 4), within_edge = 0.20,
sample_sizes = c(100, 200, 400), n_rep = 10,
data_type = "continuous", seed = 1, verbose = FALSE,
control = list(boots = 100, corr = "pearson", algorithm = "walktrap")
)
plot_power_curve_ci(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.