Description Usage Arguments Value Author(s) References See Also Examples
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).
1 2 3 |
theta |
relative minimum difference to be detected, θ. |
sample |
a character string specifying one- or two-sample t-test, must be one of "two.sample" (default) or "one.sample". |
alternative |
a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". |
alpha |
type-I-risk, α. |
beta |
type-II-risk, β. |
output |
logical: if |
Returns an object of class size
with following entries:
call | function call |
type | type of the test (i.e., arithmetic mean) |
spec | specification of function arguments |
res | list with the result, i.e., optimal sample size |
Takuya Yanagida takuya.yanagida@univie.ac.at,
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.
seqtest.mean
, size.prop
, size.cor
, print.size
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #--------------------------------------
# Two-sided one-sample test
# H0: mu = mu.0, H1: mu != mu.0
# alpha = 0.05, beta = 0.2, theta = 0.5
size.mean(theta = 0.5, sample = "one.sample",
alternative = "two.sided", alpha = 0.05, beta = 0.2)
#--------------------------------------
# One-sided one-sample test
# H0: mu <= mu.0, H1: mu > mu.0
# alpha = 0.05, beta = 0.2, theta = 0.5
size.mean(theta = 0.5, sample = "one.sample",
alternative = "greater", alpha = 0.05, beta = 0.2)
#--------------------------------------
# Two-sided two-sample test
# H0: mu.1 = mu.2, H1: mu.1 != mu.2
# alpha = 0.01, beta = 0.1, theta = 1
size.mean(theta = 1, sample = "two.sample",
alternative = "two.sided", alpha = 0.01, beta = 0.1)
#--------------------------------------
# One-sided two-sample test
# H0: mu.1 <= mu.2, H1: mu.1 > mu.2
# alpha = 0.01, beta = 0.1, theta = 1
size.mean(theta = 1, sample = "two.sample",
alternative = "greater", alpha = 0.01, beta = 0.1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.