s-news
[Top] [All Lists]

Re: SEs from lm

To: "John Sorkin" <jsorkin@grecc.umaryland.edu>
Subject: Re: SEs from lm
From: "Thomas D. Fletcher" <tom.fletcher@cox.net>
Date: Fri, 13 May 2005 09:04:35 -0400
Cc: "S-News List" <s-news@lists.biostat.wustl.edu>
Importance: Normal
In-reply-to: <s2845500.021@grecc.umaryland.edu>
John,
 
Use the summary function for the coefficients to get the standard errors.
 
x <- rnorm(10)
y <- .5*x + rnorm(10)
fit1 <- lm (y ~ x)
summary(fit1)
 
summary(fit1)$coefficients[,2]
 
This should work.

HTH
Tom

*** ++++++++++++ ***
Thomas D. Fletcher
Department of Psychology
Old Dominion University
Office (757) 683 - 3725
tflet002@odu.edu
*** ++++++++++++ ***
 

-----Original Message-----
From: s-news-owner@lists.biostat.wustl.edu [mailto:s-news-owner@lists.biostat.wustl.edu]On Behalf Of John Sorkin
Sent: Friday, May 13, 2005 7:19 AM
To: s-news@lists.biostat.wustl.edu
Subject: [S] SEs from lm

SPlus 6.2 running under Windows 2000
Please forgive a basic question.
 
I are using lm, e.g. fit1<-lm(y~x). I would like to obtain the coefficients AND the SEs of the coefficient. I know I can get the coefficient using fit1$coefficients[1] and fit1$coefficients[2], but this does not give the SEs. Could some one tell me how and can get the SEs? Is there anyway to use a single statement to get the coefficients and SE?
Thanks
John
 
John Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
Baltimore VA Medical Center GRECC and
University of Maryland School of Medicine Claude Pepper OAIC
 
University of Maryland School of Medicine
Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
 
410-605-7119
NOTE NEW EMAIL ADDRESS:
jsorkin@grecc.umaryland.edu
<Prev in Thread] Current Thread [Next in Thread>