Sweeps one x-axis parameter and repeatedly calls
cc_mssn() to plot the minimum sample size
necessary (MSSN) for case-control tests.
Character. Parameter to vary on the x-axis.
Numeric vector of x-axis values.
One of "genotypes" or "trend".
One of "model_based" or "model_free".
One of "total", "case", or "control".
Logical. If TRUE, plot genotype and trend tests
together and ignore test.
Optional character title override.
Optional x-axis label override.
Optional y-axis label override.
Logical. If TRUE, return the data frame instead of a ggplot.
Arguments passed to cc_mssn().
A ggplot object, or a data frame if return_data = TRUE.
The supported test values are "genotypes" and "trend".
sample_size selects whether to plot required cases, controls, or
total sample size. compare_tests = TRUE plots both tests together.
Supported x_var values are the same heterogeneity and
misclassification variables documented for plot_cc_power(),
plus "power" for target power. Fixed sample-size variables such as
"N_case" are not valid because sample size is the MSSN output.
Multiplier behavior matches plot_cc_power():
pheno_error_multiplier multiplies baseline theta_base and
phi_base; geno_error_multiplier multiplies the corresponding
baseline genotype-error parameters for the selected genotype
misclassification model.
All arguments in ... remain fixed while x_var is swept. The
y-axis is the required number of selected cases, controls, or total
individuals returned by cc_mssn(), according to sample_size.
For locus-heterogeneity sweeps, an exact pi = 0 design has no finite
MSSN when target power exceeds alpha. That scientifically structural
boundary is retained with MSSN NA, finite_mssn = FALSE, and
status = "no finite MSSN"; other errors are propagated unchanged.
plot_cc_mssn(
x_var = "geno_error_multiplier",
x_values = c(0, 1, 2),
test = "trend",
input_mode = "model_based",
power = 0.80,
alpha = 0.05,
prev = 0.10,
pd = 0.25,
R2 = 2,
MOI = "M",
geno_misclass = "3p",
e01_base = 0.02,
e02_base = 0.01,
e03_base = 0.005,
k = 1
)