[R] PREDICT NEW VALUES FROM REGRESSION MODEL, EST. ST.ERROR, AND CI

Greg Snow Greg.Snow at imail.org
Wed Dec 17 16:51:42 CET 2008


?predict.lm

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Ricardo Gomez
> Sent: Wednesday, December 17, 2008 8:47 AM
> To: R-help at r-project.org
> Subject: [R] PREDICT NEW VALUES FROM REGRESSION MODEL, EST. ST.ERROR,
> AND CI
>
>
> Greetings,
>
> I'd be grateful if a good Samaritan  helps me to approach this
> problem....
>
> with my data, I've created the following model
>
> lm(formula = OUTCOME ~ VAR1 + VAR2)
>  summary(model)
>
> Call:
> lm(formula = OUTCOME ~ VAR1 + VAR2)
>
> Residuals:
> Min 1Q Median 3Q Max
> -1.4341 -0.3621 0.1879 0.4994 0.7696
>
> Coefficients:
> Estimate Std. Error t value Pr(>|t|)
> (Intercept) 1.89020 0.26826 7.046 5.92e-07 ***
> VAR1 0.04725 0.06001 0.787 0.440
> VAR2 0.04139 0.05655 0.732 0.472
>
> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> Residual standard error: 0.6618 on 21 degrees of freedom
> Multiple R-squared: 0.9474, Adjusted R-squared: 0.9424
> F-statistic: 189.2 on 2 and 21 DF, p-value: 3.696e-14
>
> but now, I need to predict OUTCOME (Y) when VAR1=8 and VAR2 =64;
> estimate the standard error of the predicted value, and construct a 95%
> CI
>
> Your help is much appreciated
>
> RG
> *****************************************
> Ricardo L Gomez
> Center for International Education
> University of Massachusetts-Amherst
> Telephone: (413)545-0465 | Fax: (413)545-1263
> Web Address http://www.umass.edu/cie
> E-mail: cie at educ.umass.edu
>
>
>
>       Get the world's best email - http://nz.mail.yahoo.com/
>
> ______________________________________________
> 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.


More information about the R-help mailing list