size.mean {misty} | R Documentation |
Sample Size Determination for Testing Arithmetic Means
Description
This function performs sample size computation for the one-sample and two-sample t-test based on precision requirements (i.e., type-I-risk, type-II-risk and an effect size).
Usage
size.mean(delta, sample = c("two.sample", "one.sample"),
alternative = c("two.sided", "less", "greater"),
alpha = 0.05, beta = 0.1, write = NULL, append = TRUE,
check = TRUE, output = TRUE)
Arguments
delta |
a numeric value indicating the relative minimum difference
to be detected, |
sample |
a character string specifying one- or two-sample t-test,
must be one of |
alternative |
a character string specifying the alternative hypothesis,
must be one of |
alpha |
type-I-risk, |
beta |
type-II-risk, |
write |
a character string naming a text file with file extension
|
append |
logical: if |
check |
logical: if |
output |
logical: if |
Value
Returns an object of class misty.object
, which is a list with following
entries:
call |
function call |
type |
type of analysis |
data |
matrix or data frame specified in |
args |
specification of function arguments |
result |
list with the result, i.e., optimal sample size |
Author(s)
Takuya Yanagida takuya.yanagida@univie.ac.at,
References
Rasch, D., Kubinger, K. D., & Yanagida, T. (2011). Statistics in psychology - Using R and SPSS. New York: John Wiley & Sons.
Rasch, D., Pilz, J., Verdooren, L. R., & Gebhardt, G. (2011). Optimal experimental design with R. Boca Raton: Chapman & Hall/CRC.
See Also
Examples
#-------------------------------------------------------------------------------
# Example 1: Two-sided one-sample test
# H0: mu = mu.0, H1: mu != mu.0
# alpha = 0.05, beta = 0.2, delta = 0.5
size.mean(delta = 0.5, sample = "one.sample",
alternative = "two.sided", alpha = 0.05, beta = 0.2)
#-------------------------------------------------------------------------------
# Example 2: One-sided one-sample test
# H0: mu <= mu.0, H1: mu > mu.0
# alpha = 0.05, beta = 0.2, delta = 0.5
size.mean(delta = 0.5, sample = "one.sample",
alternative = "greater", alpha = 0.05, beta = 0.2)
#-------------------------------------------------------------------------------
# Example 3: Two-sided two-sample test
# H0: mu.1 = mu.2, H1: mu.1 != mu.2
# alpha = 0.01, beta = 0.1, delta = 1
size.mean(delta = 1, sample = "two.sample",
alternative = "two.sided", alpha = 0.01, beta = 0.1)
#-------------------------------------------------------------------------------
# Example 4: One-sided two-sample test
# H0: mu.1 <= mu.2, H1: mu.1 > mu.2
# alpha = 0.01, beta = 0.1, delta = 1
size.mean(delta = 1, sample = "two.sample",
alternative = "greater", alpha = 0.01, beta = 0.1)