Description Usage Arguments Value Examples
Simulates type I error inflation from testing a difference in group means many times as the trial is ongoing, stopping if the test is significant. A matrix of p values is returned with length(ns) columns and nsim rows.
1 | serial.testing.sim(ns = c(20, 30, 40, 50), nsim = 10000)
|
ns |
A vector of numbers, each of which is a number of people per group at which the group difference should be tested. |
nsim |
The number of simulated samples to run. |
A matrix of p values with length(ns) columns and nsim rows. Each row corresponds to a different sample, and the p values resulting from tests of the nested subsamples of size specified by ns are in different columns.
1 2 | sims <- serial.testing.sim(nsim = 1000)
mean(apply(sims, 1, min) < .05) #How often would optional stopping lead to a rejection of the null at the .05 level?
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.