[R] Puzzled in utilising summary.lm() to obtain Var(x)

From: Ajay Narottam Shah <ajayshah_at_mayin.org>
Date: Tue 14 Jun 2005 - 23:03:37 EST

I have a program which is doing a few thousand runs of lm(). Suppose it is a simple model

   y = a + bx1 + cx2 + e

I have the R object "d" where

   d <- summary(lm(y ~ x1 + x2))

I would like to obtain Var(x2) out of "d". How might I do it?

I can, of course, always do sd(x2). But it would be much more convenient if I could snoop around the contents of summary.lm and extract Var() out of it. I couldn't readily see how. Would you know what would click?

Ajay Shah                                                   Consultant
ajayshah@mayin.org                      Department of Economic Affairs
http://www.mayin.org/ajayshah           Ministry of Finance, New Delhi

R-help@stat.math.ethz.ch mailing list
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Jun 14 23:13:10 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:34 EST