The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Simulation-Based Sample Size with Delayed Onset

library(progme)

Ignoring a 6-month delayed onset inflates the apparent treatment effect and underestimates the required sample size. power_pmrm() simulates the full operating characteristic:

p <- power_pmrm(n_per_arm = 100, effect_size = -0.5, delay = 6,
                n_sims = 50, seed = 1)
p[c("power", "bias", "non_convergence_rate")]
#> $power
#> [1] 1
#> 
#> $bias
#> [1] -0.01605068
#> 
#> $non_convergence_rate
#> [1] 0

Search a grid of sample sizes (keep simulations small for the demo):

ss <- find_sample_size(target_power = 0.8, n_grid = c(80, 120),
                       effect_size = -0.5, delay = 6,
                       n_sims = 30, seed = 2)
#> Simulating n = 80
#> Simulating n = 120
ss$power_curve
#>     n power
#> 1  80     1
#> 2 120     1

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.