P-value for F from summary.lm (was RE: [R] (no subject))

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Mon Jul 7 14:58:44 CEST 2003


"Liaw, Andy" <andy_liaw at merck.com> writes:

> [Please use the subject line!]
> 
> In the help page for summary.lm, the "Value" section says that the returned
> object has a component called "fstatistic", which has the F-statistic and
> the associated numerator and denominator degrees of freedom.  You can get
> the p-value by something like:
> 
>   fstat <- summary(speciallinearmodel)$fstatistic
>   pval <- pf(fstat[1], fstat[2], fstat[3], lower.tail=FALSE)

Also, note that this gets printed using format.pval(), which avoids
misleading printouts if the p value underflows to zero:

> format.pval(0)
[1] "< 2.22e-16"


> > but the desired p-value like in this example p-value: < 
> > 2.2e-16, i somehow can not retrieve by any command like 
> > attributes(speciallinearmodel). has anyone an idea to get 
> > this shown but not selectable respectively exportable p-value?


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list