Re: [R] exact values for p-values

From: Stephen D. Weigand <weigand.stephen_at_charter.net>
Date: Wed 13 Jul 2005 - 14:11:59 EST

On Jul 11, 2005, at 11:47 AM, S.O. Nyangoma wrote:

> Hi there,
> If I do an lm, I get p-vlues as
>
> p-value: < 2.2e-16
>
> Suppose am interested in exact value such as
>
> p-value = 1.6e-16 (note = and not <)
>
> How do I go about it?
>
> stephen
>

I think you're seeing a very small p-value after it has been formatted by format.pval.
Consider:

options(digits = 6)
format.pval(0)
# [1] "< 2.2e-16"

format.pval(0, eps = 1e-20)
# [1] "< 1e-20"

you could access the p-values you're interested following this example:

x <- 1:100
y <- x + rnorm(100, 0, 1)
f <- lm(y ~ x)

ff <- summary(f)
print(ff)
ff$coefficients
Pvals <- ff$coefficients[, 4]
print(Pvals, digits = 20)

Hope this helps,

Stephen



R-help@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 Received on Wed Jul 13 14:16:33 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:36 EST