swSiz | R Documentation |
swSiz
is a wrapper function for swPwr
. For a given design, number of clusters, power and fixed and random effect parameters, swSiz
computes the number of individuals per cluster needed to achieve the desired power.
swSiz(power, alpha=0.05, ...)
power |
numeric (scalar) Desired power. Must be between |
alpha |
numeric (scalar): Two-sided statistical significance level. |
... |
Arguments to be passed to |
swSiz
calls swPwr
iteratively to find the number of participants per cluster-period needed to achieve power
power. Note that all warnings and messages normally generated by swPwr
are turned off. Also, the argument retDATA
is set to FALSE
. It is recommended that after using swSiz
, the user call swPwr
with the recommended sample size to view any warning messages and/or to get the data normally returned when retDATA
is TRUE
.
An error in swPwr
causes swSiz
to terminate and the error message from swPwr
is printed.
numeric (list): swSiz
returns a list of the following:
n |
scalar: number of individuals per cluster-period required to achieve the desired power. |
power |
scalar: exact power, as computed by |
Avi Kenny, James P Hughes
swSiz(power = 0.9, design = swDsn(clusters=c(4,4,4,4)),
distn = "gaussian", mu0 = 0, mu1 = 0.1, sigma = 0.5, icc = 0.1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.