Re: [R] values from a linear model

2007-07-25 Thread Manuele Pesenti
On Tuesday 24 July 2007 12:02:58 Manuele Pesenti wrote:
> Dear R users,
> how can I extrapolate values listed in the summary of an lm model but not
> directly available between object values such as the the standard errors of
> the calculated parameters?

thank you very much for all interesting answer
:)

Manuele



-- 
Manuele Pesenti
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://mpesenti.polito.it

__
R-help@stat.math.ethz.ch 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.


Re: [R] values from a linear model

2007-07-24 Thread Vladimir Eremeev



Manuele Pesenti wrote:
> 
> Dear R users,
> how can I extrapolate values listed in the summary of an lm model but not 
> directly available between object values such as the the standard errors
> of 
> the calculated parameters?
> 
> for example I got a model:
> 
> mod <- lm(Crd ~ 1 + Week, data=data)
> 
> and its summary:
> 
>> summary(mod)
> 
> Call:
> lm(formula = Crd ~ 1 + Week, data = data, model = TRUE, y = TRUE)
> 
> Residuals:
>Min 1Q Median 3QMax 
> -4.299e-03 -1.653e-03  2.628e-05  1.291e-03  5.130e-03 
> 
> Coefficients:
>  Estimate Std. Error  t value Pr(>|t|)
> (Intercept) 1.000e+01  3.962e-04 25238.73   <2e-16 ***
> Week5.038e-04  6.812e-0673.96   <2e-16 ***
> ---
> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
> 
> Residual standard error: 0.001966 on 98 degrees of freedom
> Multiple R-Squared: 0.9824, Adjusted R-squared: 0.9822 
> F-statistic:  5469 on 1 and 98 DF,  p-value: < 2.2e-16
> 
> I'm interested in values of Std. Error of coefficients...
> 
> thank you very much
> 

If you want to assign these values to some other variables, try assigning
the result of the summary() to a variable and working with its components
(the result is a list, use $ or [[]] to get its members)

mod.sum<-summary(mod)
then
coef(mod.sum)[,2]
or
mod.sum$coefficients[,2]

will give you those Std. Errors

-- 
View this message in context: 
http://www.nabble.com/values-from-a-linear-model-tf4134911.html#a11760459
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch 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.


Re: [R] values from a linear model

2007-07-24 Thread Dimitris Rizopoulos
try this:

coef(summary(mod))[, "Std. Error"]


I hope it helps.

Best,
Dimitris


Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
 http://www.student.kuleuven.be/~m0390867/dimitris.htm


- Original Message - 
From: "Manuele Pesenti" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, July 24, 2007 12:02 PM
Subject: [R] values from a linear model


> Dear R users,
> how can I extrapolate values listed in the summary of an lm model 
> but not
> directly available between object values such as the the standard 
> errors of
> the calculated parameters?
>
> for example I got a model:
>
> mod <- lm(Crd ~ 1 + Week, data=data)
>
> and its summary:
>
>> summary(mod)
>
> Call:
> lm(formula = Crd ~ 1 + Week, data = data, model = TRUE, y = TRUE)
>
> Residuals:
>   Min 1Q Median 3QMax
> -4.299e-03 -1.653e-03  2.628e-05  1.291e-03  5.130e-03
>
> Coefficients:
> Estimate Std. Error  t value Pr(>|t|)
> (Intercept) 1.000e+01  3.962e-04 25238.73   <2e-16 ***
> Week5.038e-04  6.812e-0673.96   <2e-16 ***
> ---
> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>
> Residual standard error: 0.001966 on 98 degrees of freedom
> Multiple R-Squared: 0.9824, Adjusted R-squared: 0.9822
> F-statistic:  5469 on 1 and 98 DF,  p-value: < 2.2e-16
>
> I'm interested in values of Std. Error of coefficients...
>
> thank you very much
>
> Best regards
> Manuele
>
> -- 
> Manuele Pesenti
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> http://mpesenti.polito.it
>
> __
> R-help@stat.math.ethz.ch 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.
> 


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

__
R-help@stat.math.ethz.ch 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.


Re: [R] values from a linear model

2007-07-24 Thread ONKELINX, Thierry
It's not very clear to me but I think summary(mod)$coef[, "Std. Error"]
is wat you need?

Cheers,

Thierry



ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
[EMAIL PROTECTED]
www.inbo.be 

Do not put your faith in what statistics say until you have carefully
considered what they do not say.  ~William W. Watt
A statistical analysis, properly conducted, is a delicate dissection of
uncertainties, a surgery of suppositions. ~M.J.Moroney

 

> -Oorspronkelijk bericht-
> Van: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] Namens Manuele Pesenti
> Verzonden: dinsdag 24 juli 2007 12:03
> Aan: r-help@stat.math.ethz.ch
> Onderwerp: [R] values from a linear model
> 
> Dear R users,
> how can I extrapolate values listed in the summary of an lm 
> model but not directly available between object values such 
> as the the standard errors of the calculated parameters?
> 
> for example I got a model:
> 
> mod <- lm(Crd ~ 1 + Week, data=data)
> 
> and its summary:
> 
> > summary(mod)
> 
> Call:
> lm(formula = Crd ~ 1 + Week, data = data, model = TRUE, y = TRUE)
> 
> Residuals:
>Min 1Q Median 3QMax 
> -4.299e-03 -1.653e-03  2.628e-05  1.291e-03  5.130e-03 
> 
> Coefficients:
>  Estimate Std. Error  t value Pr(>|t|)
> (Intercept) 1.000e+01  3.962e-04 25238.73   <2e-16 ***
> Week5.038e-04  6.812e-0673.96   <2e-16 ***
> ---
> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
> 
> Residual standard error: 0.001966 on 98 degrees of freedom
> Multiple R-Squared: 0.9824, Adjusted R-squared: 0.9822 
> F-statistic:  5469 on 1 and 98 DF,  p-value: < 2.2e-16
> 
> I'm interested in values of Std. Error of coefficients...
> 
> thank you very much
> 
> Best regards
>   Manuele
> 
> --
> Manuele Pesenti
>   [EMAIL PROTECTED]
>   [EMAIL PROTECTED]
>   http://mpesenti.polito.it
> 
> __
> R-help@stat.math.ethz.ch 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.
>

__
R-help@stat.math.ethz.ch 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.


[R] values from a linear model

2007-07-24 Thread Manuele Pesenti
Dear R users,
how can I extrapolate values listed in the summary of an lm model but not 
directly available between object values such as the the standard errors of 
the calculated parameters?

for example I got a model:

mod <- lm(Crd ~ 1 + Week, data=data)

and its summary:

> summary(mod)

Call:
lm(formula = Crd ~ 1 + Week, data = data, model = TRUE, y = TRUE)

Residuals:
   Min 1Q Median 3QMax 
-4.299e-03 -1.653e-03  2.628e-05  1.291e-03  5.130e-03 

Coefficients:
 Estimate Std. Error  t value Pr(>|t|)
(Intercept) 1.000e+01  3.962e-04 25238.73   <2e-16 ***
Week5.038e-04  6.812e-0673.96   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 

Residual standard error: 0.001966 on 98 degrees of freedom
Multiple R-Squared: 0.9824, Adjusted R-squared: 0.9822 
F-statistic:  5469 on 1 and 98 DF,  p-value: < 2.2e-16

I'm interested in values of Std. Error of coefficients...

thank you very much

Best regards
Manuele

-- 
Manuele Pesenti
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://mpesenti.polito.it

__
R-help@stat.math.ethz.ch 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.