Hand Coding the Power of a Test

less than 1 minute read

We want to test if our population average is different from twenty.

We therefore specify the follow zero hypothesis.

The alternative hypothesis is

Accepting

mu <- 40
sd <- 8
n  <- 20
ci <- qnorm(0.975)*sd/sqrt(n)
(left <- mu - ci)
## [1] 36.49391
(right <- mu + ci)
## [1] 43.50609