I am trying to check statement on p. 23 of Data Analysis Using Regression and Multilevel/Hierarchical Models
For example, consider two independent studies with effect estimates and standard errors of 25 ± 10 and 10 ± 10. The first study is statistically significant at the 1% level
in R
> estimate <- 25
> se <- 10
> z <- estimate / se
> z
[1] 2.5
t distribution converges to normal as sample size increases (Cassella Berger 2ed Exercise 5.18)
I then plug z to distribution function to get probability of observing any value equal to |z| or larger (p value) ISL p. 67
> pnorm(2.5, lower.tail=FALSE)
[1] 0.006209665
Whereas if I use formula from method [3]
> exp(-0.717 * z - 0.416 * z * z)
[1] 0.01236977
Was 0.0062 due to poor approximation? Or it should not compute that way?
[3]: Lin J-T. Approximating the normal tail probability and its inverse for use on a pocket calculator. Appl Stat1989;38:69-70.
pnorm! – whuber Nov 23 '17 at 15:00pnormby 2 because equal to or larger |z| means two intervals ? oh, sopnormis by definition calculation ? – wildfluss Nov 23 '17 at 15:09pnormdoes, the first place to look is its help page, accessed via the command?pnorm. If that's unclear--which is often the case, because manyRhelp pages are overly terse--then experiment with it. For instance, you can plot it easily withcurve(pnorm(x), -3, 3). – whuber Nov 24 '17 at 13:20