if (FALSE) {
# Create multi-scenario simulation results
scenarios <- list(
list(name = "Scenario 1",
p_true = c(0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45)),
list(name = "Scenario 2",
p_true = c(0.01, 0.025, 0.05, 0.075, 0.10, 0.125, 0.15, 0.20, 0.30))
)
result <- sim_boin_multi(
scenarios = scenarios,
target = 0.30,
n_trials = 1000,
n_cohort = 48,
cohort_size = 3,
seed = 123
)
# Print as plain text with absolute numbers (default)
print(result)
# Print with absolute numbers as Markdown table
print(result, kable = TRUE, kable_format = "pipe")
# Print with percentages instead of absolute numbers
print(result, percent = TRUE)
# Print with percentages as Markdown table
print(result, kable = TRUE, kable_format = "pipe", percent = TRUE)
# Print as LaTeX table for PDF documents
print(result, kable = TRUE, kable_format = "latex")
# Print as HTML table
print(result, kable = TRUE, kable_format = "html")
}
Run the code above in your browser using DataLab