#-------------------------------------------------------------------------------
# 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)
Run the code above in your browser using DataLab