Description Usage Arguments Value Author(s) References Examples
Simulationbased power calculations for a SWT with normally distributed outcome
1 2 3 4 
I 
Number of clusters 
J 
Number of time points 
H 
Number of units randomised at each time point 
K 
Average size of each cluster 
design 
type of design. Can be 
mu 
baseline outcome value 
b.trt 
Treatment effect 
b.time 
Time effect 
sigma.y 
total standard deviation 
sigma.e 
individual standard deviation 
rho 
Intraclass correlation coefficient 
sigma.a 
the sd of the the clusterlevel intercept (default at NULL) 
rho.ind 
individuallevel ICC (for cohorts) 
sigma.v 
the sd of the clusterlevel slope (by intervention, default at NULL) 
n.sims 
Number of simulations to be used (default=1000) 
formula 
Formula describing the model to be used 
family 
The model family to be used. Default value is 'gaussian' and other possibile choices are 'binomial' or 'poisson' 
natural.scale 
Indicator for whether the input is passed on the natural scale or on the scale of the linear predictor. By default is set to TRUE. In the case of family='gaussian' it does not have any effect, since the link for the linear predictor is the identity. But for family='binomial' or family='poisson', the user has to specify when the input is given on the logit or log scale 
sig.level 
Significance level (default=0.05) 
n.cores 
Specifies the number of processors to be used for the computation (default=NULL, which means that R will try and figure out) 
method 
A string specifying the method to be used for the calculation. The default value is

plot 
Shows a plot of the moving average of the resulting power after 10
the simulations. This helps assessing the convergence of the estimate towards some
common value. The default is 
... 
Additional optional arguments. The user can specify a function named 
power 
The resulting estimated power, for the given configuration. If the model does not include
random effects, this is based on the pvalue computed by 
time2run 
Running time, in seconds 
ci.power 
Estimated 95% confidence interval for the power  based on normal approximation 
theta 
Estimated treatment effect with standard error 
rnd.eff.sd 
Estimated variance components 
setting 
A list summarising the assumptions in terms of number of clusters, time points, type of model, formula used 
Gianluca Baio
Baio, G; Copas, A; Ambler, G; Hargreaves, J; Beard, E; and Omar, RZ Sample size calculation for a stepped wedge trial. Trials, 16:354. Aug 2015.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.