size.ci.median2 | R Documentation |
Computes the sample size for each group required to estimate a population median difference with desired confidence interval precision in a 2-group 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. Set R = 1 for equal sample sizes.
size.ci.median2(alpha, var, w, R, dist)
alpha |
alpha level for 1-alpha confidence |
var |
planning value of average within-group variance |
w |
desired confidence interval width |
R |
n2/n1 ratio |
dist |
|
Returns the required sample size for each group
Bonett2002statpsych
size.ci.median2(.05, 37.1, 5, 1, 1)
# Should return:
# n1 n2
# 72 72
size.ci.median2(.05, 37.1, 5, 2, 4)
# Should return:
# n1 n2
# 51 102
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.