[R] lm function

2004-01-22 Thread jenny smith
Hi,
How can I extract the standard deviation of the coefficients when using the lm 
function.  I know $coefficient gives me the individual betas.  thank you


-


[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] lm function

2004-01-22 Thread Thomas Lumley
On Thu, 22 Jan 2004, jenny smith wrote:

 Hi, How can I extract the standard deviation of the coefficients when
 using the lm function.  I know $coefficient gives me the individual
 betas.  thank you

$coefficient is not the recommended way to get the coefficients.

use coef(your.model) for the coefficients and vcov(your.model) for their
variance matrix, so that sqrt(diag(vcov(your.model))) are the standard
errors.

-thomas





 -


   [[alternative HTML version deleted]]

 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Thomas Lumley   Assoc. Professor, Biostatistics
[EMAIL PROTECTED]   University of Washington, Seattle

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] lm function

2004-01-22 Thread David Firth
If the model is called mymodel, you could do

  summary(mymodel)$coefficients[,2]

or

  sqrt(diag(vcov(mymodel)))

This gives the estimated standard errors of the coefficients, which I 
think is what you wanted.

David

On Thursday, Jan 22, 2004, at 20:35 Europe/London, jenny smith wrote:

Hi,
How can I extract the standard deviation of the coefficients when 
using the lm function.  I know $coefficient gives me the 
individual betas.  thank you

-

	[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html