# Setting S = 50 and nsim = 50 for speed
# In practice you would want a much larger sample and more simulations
set.seed(123)
# One-sample case
cal_tbl1 <- calibrate_thresholds(
p_null = 0.1,
p_alt = 0.4,
n = seq(5, 15, 5),
N = 15,
pp_threshold = c(0.85, 0.9),
ppp_threshold = c(0.1, 0.2),
S = 10,
nsim = 10
)
plot(cal_tbl1, type1_range = c(0.01, 0.2), minimum_power = 0.7)
Run the code above in your browser using DataLab