Dear R list, I calculated a two-sided p values according to 2*(1-pnorm(8.104474)), which gives 4.440892e-16. However, it appears to be 5.30E-16 by a colleague and 5.2974E-16 from SAS. I tried to get around with mvtnorm package but it turns out to be using pnorm for univariate case. I should have missed some earlier discussions, but for the moment is there any short answer for a higher precision? Somehow these days, statistical geneticists are infatuated with such tiny p values! Many thanks in advance, Jing Hua _________________________________________________________________ Telly addicts unite! [[alternative HTML version deleted]]
I guess that you destroy the accuracy of the calculation by the subtraction. Try 2*(pnorm(8.104474,lower=FALSE)) instead, which results in 5.29742e-16 for me. Regards, Martin jing hua zhao schrieb:> Dear R list, > > I calculated a two-sided p values according to 2*(1-pnorm(8.104474)), which gives 4.440892e-16. However, it appears to be 5.30E-16 by a colleague and 5.2974E-16 from SAS. I tried to get around with mvtnorm package but it turns out to be using pnorm for univariate case. I should have missed some earlier discussions, but for the moment is there any short answer for a higher precision? Somehow these days, statistical geneticists are infatuated with such tiny p values! > > Many thanks in advance, > > > Jing Hua > > _________________________________________________________________ > Telly addicts unite! > > [[alternative HTML version deleted]] > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >
On 2/7/2008 12:00 PM, jing hua zhao wrote:> Dear R list, > > I calculated a two-sided p values according to 2*(1-pnorm(8.104474)), which gives 4.440892e-16. However, it appears to be 5.30E-16 by a colleague and 5.2974E-16 from SAS. I tried to get around with mvtnorm package but it turns out to be using pnorm for univariate case. I should have missed some earlier discussions, but for the moment is there any short answer for a higher precision?You are taking the difference between two numbers, 1 and a number that is almost equal to 1. Don't do that, it results in a catastrophic loss of precision. Evaluate the upper tail probability directly: > 2*(pnorm(8.104474, lower=FALSE)) [1] 5.29742e-16 Duncan Murdoch Somehow these days, statistical geneticists are infatuated with such tiny p values!> > Many thanks in advance, > > > Jing Hua > > _________________________________________________________________ > Telly addicts unite! > > [[alternative HTML version deleted]] > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
On Thu, 7 Feb 2008, jing hua zhao wrote:> > Dear R list, > > I calculated a two-sided p values according to 2*(1-pnorm(8.104474)), > which gives 4.440892e-16. However, it appears to be 5.30E-16 by a > colleague and 5.2974E-16 from SAS. I tried to get around with mvtnorm > package but it turns out to be using pnorm for univariate case. I should > have missed some earlier discussions, but for the moment is there any > short answer for a higher precision? Somehow these days, statistical > geneticists are infatuated with such tiny p values!2*pnorm(8.104474, lower=FALSE) You can't find a small number accurately by subtraction: pnorm(8.104474) is being returned as the number the second smaller than one in IEC60559 arithmetic.> > Many thanks in advance, > > > Jing Hua > > _________________________________________________________________ > Telly addicts unite! > > [[alternative HTML version deleted]] > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
you should use the 'lower.tail' argument of pnorm(), e.g., check the following: 2 * (1 - pnorm(8.104474)) 2 * pnorm(8.104474, lower.tail = FALSE) I hope it helps. Best, Dimitris ---- Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm ----- Original Message ----- From: "jing hua zhao" <jinghuazhao at hotmail.com> To: <r-devel at stat.math.ethz.ch> Sent: Thursday, February 07, 2008 6:00 PM Subject: [Rd] pnorm> > Dear R list, > > I calculated a two-sided p values according to > 2*(1-pnorm(8.104474)), which gives 4.440892e-16. However, it > appears to be 5.30E-16 by a colleague and 5.2974E-16 from SAS. I > tried to get around with mvtnorm package but it turns out to be > using pnorm for univariate case. I should have missed some earlier > discussions, but for the moment is there any short answer for a > higher precision? Somehow these days, statistical geneticists are > infatuated with such tiny p values! > > Many thanks in advance, > > > Jing Hua > > _________________________________________________________________ > Telly addicts unite! > > [[alternative HTML version deleted]] > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
On Thu, 7 Feb 2008, jing hua zhao wrote:> > I calculated a two-sided p values according to 2*(1-pnorm(8.104474)), > which gives 4.440892e-16. However, it appears to be 5.30E-16 by a > colleague and 5.2974E-16 from SAS. I tried to get around with mvtnorm > package but it turns out to be using pnorm for univariate case. I should > have missed some earlier discussions, but for the moment is there any > short answer for a higher precision?pnorm(8.104474,lower.tail=FALSE)*2 gives the same answer as SAS, and pnorm(8.104474,lower.tail=FALSE,log=TRUE)/log(10)+log(2,10) gives the (base-10) logarithm of the p-value, which is often the preferred genetics scale. These are much more accurate.> Somehow these days, statistical > geneticists are infatuated with such tiny p values!Yes, but in my experience they are at least fairly realistic about the lack of difference between 4e-16 and 5e-16. -thomas Thomas Lumley Assoc. Professor, Biostatistics tlumley at u.washington.edu University of Washington, Seattle