Sigrid
2012-Oct-10 13:49 UTC
[R] se's and CI's for fitted lines in multivariate regression analysis
I?m entirely stumped on this particular issue and really hoping someone has some advice for me. I am running a covariant model in lm I would like to give the standard errors or the confidence intervals for the fitted lines. I?ve been using the dataset OrangeSprays where I want lines for each level of treatment over the covariant ?colpos?. I?ve been able to calculate intercepts and slopes for each lines by adding up the parameters, but this does not make sense when the comes to the se?s. I?ve run the summary (model) function, but only get the differences in standard error between lines. Also by running confint(model), I have the same problem. How can I get standard error per or the CI-interval for each fitted line? I?ve attached the coding underneath. Thank you, Sigrid> data(OrchardSprays) > model<-lm(decrease~rowpos+colpos+treatment+treatment:colpos) > summary(model)-- View this message in context: http://r.789695.n4.nabble.com/se-s-and-CI-s-for-fitted-lines-in-multivariate-regression-analysis-tp4645703.html Sent from the R help mailing list archive at Nabble.com.
Bert Gunter
2012-Oct-10 14:40 UTC
[R] se's and CI's for fitted lines in multivariate regression analysis
?predict Have you read An Inrtroduction to R? -- Bert On Wed, Oct 10, 2012 at 6:49 AM, Sigrid <s.stenerud at gmail.com> wrote:> I?m entirely stumped on this particular issue and really hoping someone has > some advice for me. > > I am running a covariant model in lm I would like to give the standard > errors or the confidence intervals for the fitted lines. I?ve been using the > dataset OrangeSprays where I want lines for each level of treatment over the > covariant ?colpos?. I?ve been able to calculate intercepts and slopes for > each lines by adding up the parameters, but this does not make sense when > the comes to the se?s. I?ve run the summary (model) function, but only get > the differences in standard error between lines. Also by running > confint(model), I have the same problem. > > How can I get standard error per or the CI-interval for each fitted line? > I?ve attached the coding underneath. > > Thank you, > Sigrid > >> data(OrchardSprays) >> model<-lm(decrease~rowpos+colpos+treatment+treatment:colpos) >> summary(model) > > > > > -- > View this message in context: http://r.789695.n4.nabble.com/se-s-and-CI-s-for-fitted-lines-in-multivariate-regression-analysis-tp4645703.html > Sent from the R help mailing list archive at Nabble.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.-- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm
Rui Barradas
2012-Oct-10 15:24 UTC
[R] se's and CI's for fitted lines in multivariate regression analysis
Hello, Your model is equivalent to the model below. As for standard errors, try predict.lm with the appropriate argument. ?predict.lm model <- lm(decrease ~ rowpos + colpos*treatment, data = OrchardSprays) predict(model, se.fit = TRUE, interval = "confidence") Hope this helps, Rui Barradas Em 10-10-2012 14:49, Sigrid escreveu:> I?m entirely stumped on this particular issue and really hoping someone has > some advice for me. > > I am running a covariant model in lm I would like to give the standard > errors or the confidence intervals for the fitted lines. I?ve been using the > dataset OrangeSprays where I want lines for each level of treatment over the > covariant ?colpos?. I?ve been able to calculate intercepts and slopes for > each lines by adding up the parameters, but this does not make sense when > the comes to the se?s. I?ve run the summary (model) function, but only get > the differences in standard error between lines. Also by running > confint(model), I have the same problem. > > How can I get standard error per or the CI-interval for each fitted line? > I?ve attached the coding underneath. > > Thank you, > Sigrid > >> data(OrchardSprays) >> model<-lm(decrease~rowpos+colpos+treatment+treatment:colpos) >> summary(model) > > > > -- > View this message in context: http://r.789695.n4.nabble.com/se-s-and-CI-s-for-fitted-lines-in-multivariate-regression-analysis-tp4645703.html > Sent from the R help mailing list archive at Nabble.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.