[R] se's and CI's for fitted lines in multivariate regression analysis

Rui Barradas ruipbarradas at sapo.pt
Wed Oct 10 17:24:22 CEST 2012


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.




More information about the R-help mailing list