[R] qnorm?

Marc Schwartz marc_schwartz at me.com
Tue Aug 23 19:34:12 CEST 2011


On Aug 23, 2011, at 12:21 PM, Jim Silverton wrote:

> Hi everyone,
> I have the following problem. I have some small p-values but when I use
> 
> qnorm(1-4e-30)
> I get an error.
> Is there anyway to get around this?


Here is a hint:

> qnorm(1 - 4e-30)
[1] Inf

> qnorm(1)
[1] Inf


# See ?all.equal
> all.equal(1 - 4e-30, 1)
[1] TRUE


# See ?.Machine for more information
> .Machine$double.eps
[1] 2.220446e-16


Since 4e-30 is smaller than the above, you are essentially passing 1 to qnorm().

Try this:

> qnorm(4e-30, lower.tail = FALSE)
[1] 11.34337


See ?qnorm and avoid using the '1 - x' approach.

HTH,

Marc Schwartz



More information about the R-help mailing list