Re: [R] Extracting coefficients' standard errors from linear model

From: Marc Schwartz <marc_schwartz_at_comcast.net>
Date: Fri, 25 Apr 2008 10:15:58 -0500

Or use:

   mod <- lm(var1 ~ var2 + var3 + var4)

   coef(summary(mod))[, 2]

or

   coef(summary(lm.D9))[, "Std. Error"]

if you prefer using column names.

coef() extracts the model coefficients from the lm object and the additional content in a summary.lm object.

There are accessor functions for model objects and these are referenced in "An Introduction to R" and in the See Also section of ?lm.

HTH, Marc Schwartz

Henrique Dallazuanna wrote:

> Try:
> 
>  summary(lm.D9)[["coefficients"]][,2]
> 
> On Fri, Apr 25, 2008 at 10:55 AM, Uli Kleinwechter <
> ulikleinwechter_at_yahoo.com.mx> wrote:
> 

>> Dear all,
>>
>> Hope this question is not too trivial...
>>
>> In order to correct standard errors from an estimation of a fixed
>> effects regression model y need to extract the vector of standard errors
>> of the coefficients of a simple linear model estimated using
>>
>> lm(var1~var2+var3+var4)
>>
>> Unfortunately I can't find out the corresponding function.
>>
>> Thank you very much for your help.
>>
>> Uli
>>


R-help_at_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. Received on Fri 25 Apr 2008 - 15:35:24 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 Fri 25 Apr 2008 - 16:30:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive