Est of SE of coefficients from lm() function

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Est of SE of coefficients from lm() function

Arun.stat
Dear all R users,

Can anyone tell me how I can get estimate of SE of coefficients from, lm()
function?

I tried following :

x = 1:10
lm(x[-1]~x[-10]-1)$coefficients

Here I got the est. of coefficient, however I also want to get some
"automated" way to get estimate of SE.

Regards,

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Est of SE of coefficients from lm() function

Chuck Cleland
Arun Kumar Saha wrote:

> Dear all R users,
>
> Can anyone tell me how I can get estimate of SE of coefficients from, lm()
> function?
>
> I tried following :
>
> x = 1:10
> lm(x[-1]~x[-10]-1)$coefficients
>
> Here I got the est. of coefficient, however I also want to get some
> "automated" way to get estimate of SE.

> y <- 2:10
> x <- 1:9

> summary(lm(y ~ x - 1))

Call:
lm(formula = y ~ x - 1)

Residuals:
    Min      1Q  Median      3Q     Max
-0.4211 -0.1053  0.2105  0.5263  0.8421

Coefficients:
  Estimate Std. Error t value Pr(>|t|)
x  1.15789    0.02883   40.17 1.62e-10 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.4867 on 8 degrees of freedom
Multiple R-Squared: 0.9951,     Adjusted R-squared: 0.9944
F-statistic:  1613 on 1 and 8 DF,  p-value: 1.624e-10

> coef(summary(lm(y ~ x - 1)))
  Estimate Std. Error  t value     Pr(>|t|)
x 1.157895 0.02882750 40.16632 1.624006e-10

> coef(summary(lm(y ~ x - 1)))[,2]
[1] 0.02882750

> Regards,
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.

--
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Est of SE of coefficients from lm() function

Achim Zeileis
In reply to this post by Arun.stat
On Fri, 24 Aug 2007, Arun Kumar Saha wrote:

> Dear all R users,
>
> Can anyone tell me how I can get estimate of SE of coefficients from, lm()
> function?

The vcov() function extracts the estimated covariance matrix:
  fm <- lm(...)
  vcov(fm)
Thus, you can get the ESE via
  sqrt(diag(vcov(fm)))

hth,
Z

> I tried following :
>
> x = 1:10
> lm(x[-1]~x[-10]-1)$coefficients
>
> Here I got the est. of coefficient, however I also want to get some
> "automated" way to get estimate of SE.
>
> Regards,
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.
>
>

______________________________________________
[hidden email] 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.