# power defined as the probability of observing z-statistics
# greater than the positive critical t value OR
# less than the negative critical t value
power.z.test(ncp = 1.96, alpha = 0.05,
alternative = "not equal")
# power is defined as the probability of observing z-statistics
# greater than the critical t value
power.z.test(ncp = 1.96, alpha = 0.05,
alternative = "greater")
# power is defined as the probability of observing z-statistics
# greater than the critical t value where the non-centrality parameter
# for the alternative distribution is adjusted for the non-inferiority margin
power.z.test(ncp = 1.98, alpha = 0.05,
alternative = "non-inferior")
# power is defined as the probability of observing z-statistics
# greater than the critical t value where the non-centrality parameter
# for the alternative distribution is adjusted for the superiority margin
power.z.test(ncp = 1.94, alpha = 0.05,
alternative = "superior")
# power is defined as the probability of observing z-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.z.test(ncp = 1.96, alpha = 0.05,
alternative = "equivalent")
# or, define lower and upper bound with rbind()
power.z.test(ncp = rbind(-1.96, 1.96), alpha = 0.05,
alternative = "equivalent")
Run the code above in your browser using DataLab