avehtari / ROS-Examples

Regression and other stories R examples
https://avehtari.github.io/ROS-Examples/
325 stars 256 forks source link

p. 295 equation typo #81

Closed ASKurz closed 3 years ago

ASKurz commented 3 years ago

On page 295, we see the equation $n = (2.8 ∗ 0.49/0.1)^2 = 196$. It's incorrect. I suspect y'all meant either $n = (2.8 ∗ 0.5/0.1)^2 = 196$ or $n = (2.8 ∗ 0.49/0.1)^2 = 188.2$. To see, execute the following:

(2.8 * 0.49 / 0.1)^2 
(2.8 * 0.5 / 0.1)^2 

Which yields:

[1] 188.2384
[1] 196

If it's indeed $n = (2.8 ∗ 0.49/0.1)^2 = 188.2$, this will have implications for the lower row of Figure 16.2.

andrewgelman commented 3 years ago

Good catch! It's kind of confusing (including to me, apparently!). If you plug in p = 0.6, then you get an sd of sqrt(0.6*0.4/n) = 0.49/sqrt(n), so I wrote the text like that. But when you're doing the power calculation, you have to allow for the possibility that p_hat is near 0.5 in this example, so that the sd could be as high as 0.5/sqrt(n), hence when I did the calculations, I assumed 0.5. I think in this example we're safer using 0.5 and 196, so I'll just have to fix and add some text to explain.

avehtari commented 3 years ago

Thanks! Added to the errata, too