size.ci.lc.median.bs | R Documentation |
Computes the sample size in each group (assuming equal sample sizes) required to estimate a linear contrast of population medians with desired confidence interval precision in a between-subjects design. Set the variance planning value to the largest value within a plausible range for a conservatively large sample size. The sample size requirement depends on the shape of the distribution. Select one of the four distribution options (Normal, Logistic, Laplace, Exponential) that approximates the most likely distribution shape in the planned study. Select the Normal distribution for a conservatively large sample size requirement.
size.ci.lc.median.bs(alpha, var, w, v, dist)
alpha |
alpha level for 1-alpha confidence |
var |
planning value of average within-group variance |
w |
desired confidence interval width |
v |
vector of between-subjects contrast coefficients |
dist |
|
Returns the required sample size for each group
Bonett2002statpsych
v <- c(.5, .5, -1)
size.ci.lc.median.bs(.05, 5.62, 2.0, v, 1)
# Should return:
# Sample size per group
# 51
size.ci.lc.median.bs(.05, 5.62, 2.0, v, 4)
# Should return:
# Sample size per group
# 33
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.