Re: [R] Accessing individual variables from summary of lm

From: Paul Smith <>
Date: Tue, 22 Jul 2008 10:38:23 +0100

On Tue, Jul 22, 2008 at 5:44 AM, ascentnet <> wrote:
> I am trying to access the R2, intercept, and slope out of the summary from an
> lm so that I can insert it into a database using RODBC. How can I access
> these individually?


model <- lm(Infant.Mortality ~ .,data=swiss) summary(model)$r.square
# The following returns a matrix with the coefficients summary(model)$coefficients

Paul mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Tue 22 Jul 2008 - 09:43:34 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Jul 2008 - 07:32:19 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive