avehtari / ROS-Examples

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

errata in book p.42 #50

Closed antonioprol closed 4 years ago

antonioprol commented 4 years ago

p. 42, the last line is the calculation for the standard error of the sample mean. For the standard error of the difference we calculate:

sqrt(2.9^2+2.7^2) 4 approx.

Check:

h_m <- rnorm(1e4, 69.1, 2.9) h_w <- rnorm(1e4, 63.7, 2.7) h_diff <- h_m-h_w sd(h_diff)

Regards.

avehtari commented 4 years ago

Thanks for reaching out.

Note: "compute the difference between the average heights of the men and the women"

In your check you have dropped out the average over sample of 100 men and 100 women. Your computation is showing the result for the difference between heights and not for the difference between averages of heights of 100 men and 100 women, The variance of the average height of 100 men is variance of height of men divided by 100, etc.

When I checked the paragraph, I also had to read it couple times to make sure that what text says and what the equation computes match. I changed the last sentence to start "This difference between the average heights will be approximately normally distributed". I hope this is more clear.

antonioprol commented 4 years ago

You're right, I get it now. Thanks.