Tino -
When you call summary for an lm object, the function
that actually gets called is "summary.lm". This function
has a help page, and, if you type
?summary.lm
and look at the "Value" section, you'll see the following:
coefficients: a p x 4 matrix with columns for the estimated
coefficient, its standard error, t-statistic and
corresponding (two-sided) p-value. Aliased coefficients are
omitted.
Here's an example of how you could extract the probabilities:
set.seed(12)
df = data.frame(y=rnorm(100),x1=rnorm(100),x2=rnorm(100))
df.lm = lm(y~x1+x2,df)
sdf.lm = summary(df.lm)
sdf.lm$coefficients[,4]
(Intercept) x1 x2
0.7445605 0.8081874 0.2535098
or
sdf.lm$coefficients[,"Pr(>|t|)"]
(Intercept) x1 x2
0.7445605 0.8081874 0.2535098
Hope this helps
- Phil Spector
Statistical Computing Facility
Department of Statistics
UC Berkeley
spec...@stat.berkeley.edu
On Thu, 13 May 2010, Tino Schöllhorn wrote:
Hi,
I am quite new to R - but quite expierience in programming. Nonetheless I
have some problemes in accessing information of the "summary" object. Here is
what I do:
model <- lm ( y ~ myVariable )
"summary(model)" gives me an object which has a lot of information about the
regression. Now I'd like to access programmatically the level of significance
which is marked with "***" and ("**") according to its confidence-interval.
As I can access all information of the coefficients via
summary(model)$coeff["myVariable"]
I am now struggling to access the information of the level of significance.
Does anyone has an idea how I could achieve that? Or where I could find a
similar example?
Thanks in advance for any hint,
Tino
--
Tino Schöllhorn
Wittelsbachstr. 7
67061 Ludwigshafen
Tel: 0621-4255570
E-Mail: t.schoellh...@gmx.de
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.