Skip to content
Prev 308164 / 398506 Next

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

Hello,

Thinking again, there are better ways of getting all the CI's for the 
fitted lines in one go. First, make a list of models, subsetting on each 
level of treatment. Then lapply predict.lm to the list of models.

levs <- levels(OrchardSprays$treatment)
model.lst <- lapply(levs, function(.lvl)
     lm(decrease ~ colpos , subset = treatment == .lvl, data = 
OrchardSprays))

pred.lst <- lapply(model.lst, predict, interval = "confidence") # Get 
all CI's

names(model.lst) <- names(pred.lst) <- levs

pred.lst$A  # Just level 'A'


Hope this helps,

Rui Barradas

Em 16-10-2012 22:54, Rui Barradas escreveu: