In Jay L. Devore 'Probability and Statistics for Engineering and the Sciences', he presents the following formula to retrieve β, when we consider a two-tailed test and the population mean is known.
$\beta_{(\mu')} = \Phi({z_{\alpha/2}+\frac{\mu_0 - \mu'}{\sigma/\sqrt{n}}}) - \Phi({-z_{\alpha/2}+\frac{\mu_0 - \mu'}{\sigma/\sqrt{n}}})$
Therefore I tried to apply this to a mock-up data:
Desired $\alpha = 0.05$
$\mu_0 = 14$
$\mu' = 15$
$n = 4$
$\sigma = 1.496$
From this I get:
$\beta = \Phi(1.96 + \frac{-1}{0.374}) - \Phi(- 1.96 + \frac{-1}{0.374})$
$\beta = \Phi(-0.714) - \Phi(-4.634)$
$β = 0.24$
However, when I try to get power from R language:
> power.t.test(n = 4, delta = 1, sd = 1.496,
sig.level = 0.05, power = NULL,
type = "one.sample", alternative = "two.sided")
I get power = $0.1578781$ ($\beta = 0.84$).
This is a huge difference and it's making me nuts. What am I doing wrong, and why both formulas seem to be the same thing, though they are obviously not?