Hi there, If I do an lm, I get p-vlues as p-value: < 2.2e-16 This is obtained from F =39540 with df1 = 1, df2 = 7025. Suppose am interested in exact value such as p-value = 1.6e-16 (note = and not <) How do I go about it? stephen
On Mon, 11 Jul 2005, S.O. Nyangoma wrote:> Hi there, > If I do an lm, I get p-vlues as > > p-value: < 2.2e-16 > > This is obtained from F =39540 with df1 = 1, df2 = 7025. > > Suppose am interested in exact value such as > > p-value = 1.6e-16 (note = and not <) > > How do I go about it?You can always extract the `exact' p-value from the "summary.lm" object or you can compute it by hand via pf(39540, df1 = 1, df2 = 7025, lower.tail = FALSE) For all practical purposes, the above means that the p-value is 0. I guess you are on a 32-bit machine, then it also means that the p-value is smaller than the Machine epsilon .Machine$double.eps So if you want to report the p-value somewhere, I think R's output should be more than precise enough. If you want to compute some other values that depend on such a p-value, then it is probably wiser to compute on a log scale, i.e. instead pf(70, df1 = 1, df2 = 7025, lower.tail = FALSE) use pf(70, df1 = 1, df2 = 7025, lower.tail = FALSE, log.p = TRUE) However, don't expect to be able to evaluate it at such extreme values such as 39540. Z
Adaikalavan Ramasamy
2005-Jul-11 17:57 UTC
[R] exact values for p-values - more information.
Compare the following t.test( 1:100, 101:200 )$p.value t.test( 1:100, 101:200 ) In the latter, the print method truncates to 2.2e-16. You can go as far as (depending on your machine) .Machine$double.xmin [1] 2.225074e-308 before it becomes indistinguishable from zero. But there are good reasons to truncate it at 2.2e-16 such as the difficulty in trying to accurately estimate the extreme tail probabilities. Regards, Adai On Mon, 2005-07-11 at 18:52 +0200, S.O. Nyangoma wrote:> Hi there, > If I do an lm, I get p-vlues as > > p-value: < 2.2e-16 > > This is obtained from F =39540 with df1 = 1, df2 = 7025. > > Suppose am interested in exact value such as > > p-value = 1.6e-16 (note = and not <) > > How do I go about it? > > stephen > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >
Hi there, Actually my aim was to compare anumber of extreme values (e.g. 39540) with df1=1, df2=7025 via p-values. Spencer mentions that "However, I have also used numbers like exp(-19775.52) to guestimate relative degrees of plausibility for different alternatives." Can someone point to me an article using this method? Regards. Stephen. ----- Original Message ----- From: Spencer Graves <spencer.graves at pdf.com> Date: Monday, July 11, 2005 7:39 pm Subject: Re: [R] exact values for p-values - more information.> I just checked: > > > pf(39540, 1, 7025, lower.tail=FALSE, log.p=TRUE) > [1] -Inf > > This is not correct. With 7025 denominator degrees of > freedom, we > might use the chi-square approximation to the F distribution: > > > pchisq(39540, 1, lower.tail=FALSE, log.p=TRUE) > [1] -19775.52 > > In sum, my best approximation to pf(39540, 1, 7025, > lower.tail=FALSE, log.p=TRUE), given only a minute to work on > this, is > exp(pchisq(39540, 1, lower.tail=FALSE, log.p=TRUE)) = exp(-19775.52). > > I'm confident that many violations of assumptions would > likely be > more important than the differences between "p-value: < 2.2e-16" > andThat doesn't mean they are right, only> the best > I can get with the available resources. > > spencer graves > > Achim Zeileis wrote: > > > On Mon, 11 Jul 2005, S.O. Nyangoma wrote: > > > > > >> Hi there, > >> If I do an lm, I get p-vlues as > >> > >> p-value: < 2.2e-16 > >> > >>This is obtained from F =39540 with df1 = 1, df2 = 7025. > >> > >> Suppose am interested in exact value such as > >> > >> p-value = 1.6e-16 (note = and not <) > >> > >> How do I go about it? > > > > > > You can always extract the `exact' p-value from the "summary.lm" > object or > > you can compute it by hand via > > pf(39540, df1 = 1, df2 = 7025, lower.tail = FALSE) > > For all practical purposes, the above means that the p-value is 0. > > I guess you are on a 32-bit machine, then it also means that the > p-value > > is smaller than the Machine epsilon > > .Machine$double.eps > > > > So if you want to report the p-value somewhere, I think R's > output should > > be more than precise enough. If you want to compute some other > values that > > depend on such a p-value, then it is probably wiser to compute > on a log > > scale, i.e. instead > > pf(70, df1 = 1, df2 = 7025, lower.tail = FALSE) > > use > > pf(70, df1 = 1, df2 = 7025, lower.tail = FALSE, log.p = TRUE) > > > > However, don't expect to be able to evaluate it at such extreme > values> such as 39540. > > Z > > > > ______________________________________________ > > R-help at stat.math.ethz.ch mailing list > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide! http://www.R- > project.org/posting-guide.html > > -- > Spencer Graves, PhD > Senior Development Engineer > PDF Solutions, Inc. > 333 West San Carlos Street Suite 700 > San Jose, CA 95110, USA > > spencer.graves at pdf.com > www.pdf.com <http://www.pdf.com> > Tel: 408-938-4420 > Fax: 408-280-7915 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting- > guide.html
> If they have the same degrees of freedom, use the test statistic > and not > the p value for comparing them. > ZI appretiate your input to this discussion. Do you know of a reference to your statement above? I had actually used the test-statistic which in my case is r-squared to compare them. This is in my view was adequate but I also think it is more convincing to say something about the p-values (difficulties in computing them, and hence the rationale of solely using the test- stat). regards. Stephen.