# power is defined as the probability of observing t-statistics
# greater than the positive critical t value OR
# less than the negative critical t value
power.t.test(ncp = 1.96, df = 99, alpha = 0.05,
alternative = "not equal")
# power is defined as the probability of observing t-statistics
# greater than the critical t value
power.t.test(ncp = 1.96, df = 99, alpha = 0.05,
alternative = "greater")
# power is defined as the probability of observing t-statistics
# greater than the critical t value where the non-centrality parameter
# for the alternative distribution is adjusted for the non-inferiority margin
power.t.test(ncp = 1.98, df = 99, alpha = 0.05,
alternative = "non-inferior")
# power is defined as the probability of observing t-statistics
# greater than the critical t value where the non-centrality parameter
# for the alternative distribution is adjusted for the superiority margin
power.t.test(ncp = 1.94, df = 99, alpha = 0.05,
alternative = "superior")
# power is defined as the probability of observing t-statistics
# less than the positive critical t value AND
# greater than the negative critical t value
# the non-centrality parameter is for the null distribution
# and is derived from the equivalence margins (lower and upper)
power.t.test(ncp = 1.96, df = 999, alpha = 0.05,
alternative = "equivalent")
# or, define lower and upper bound with rbind()
power.t.test(ncp = rbind(-1.96, 1.96),
df = 999, alpha = 0.05,
alternative = "equivalent")
Run the code above in your browser using DataLab