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? thanks in advance, Ben. -- View this message in context: http://www.nabble.com/Accessing-individual-variables-from-summary-of-lm-tp18582274p18582274.html Sent from the R help mailing list archive at Nabble.com.
On Tue, Jul 22, 2008 at 5:44 AM, ascentnet <ascentnet at yahoo.com> 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?Try: data(swiss) model <- lm(Infant.Mortality ~ .,data=swiss) summary(model)$r.square # The following returns a matrix with the coefficients summary(model)$coefficients Paul