[R] Getting Pr from Summary(lm)

jferrer@ivic.ve jferrer at ivic.ve
Wed Jun 9 13:01:35 CEST 2004

Hi David,

To see what is stored in an object, use names().
In your case you could try this:

> lm <- lm(y ~ age + sex)
> s <- summary(lm)
>  names(s)
 [1] "call"          "terms"         "residuals"     "coefficients"
 [5] "aliased"       "sigma"         "df"            "r.squared"
 [9] "adj.r.squared" "fstatistic"    "cov.unscaled"
> s$coefficients
> s$coefficients[,4]



En respuesta a / Antwort zu / Reply to:

~~I am trying to get the P values from the output of a summary for lm.
~~lm <- lm(y ~ age + sex)
~~s <- summary(lm)
~~I thought that I might be able to get them using a combination of scan,
~~grep and sub.
~~But I got stuck on the first step - being able to process "s" as a text
~~I could perhaps write it to file than scan it back but there is probably
~~an easier
~~way to do the whole thing.
~~Help would be welcome, David
~~R-help at stat.math.ethz.ch mailing list
~~PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Dipl.-Biol. J.R. Ferrer Paris ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Laboratorio de Biología de Organismos - Centro de Ecología
   Instituto Venezolano de Investigaciones Científicas
             Apartado 21827 - Caracas 1020A
     Tel:00-58-212-5041452 --- Fax: 00-58-212-5041088
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ jferrer at ivic.ve

More information about the R-help mailing list