[R] Confidence intervals for gls models?

Spencer Graves spencer.graves at pdf.com
Mon May 19 05:09:00 CEST 2003


What about the obvious:

tstDf <- data.frame(x=1:9, y=rnorm(9), w=1:9)
fit <- lm(y~x, tstDf, weights=w)
pred <- predict(fit, se.fit=T)
pred$fit + outer(pred$se.fit, c(-2, 2))

"predict.lm" might need weights for interval="prediction" with newdata, 
but not with interval="confidence" ... or am I missing something?

hth.  spencer graves

Brown, David wrote:
> Is there an easy way to compute confidence intervals (or prediction
> intervals) for gls models?
> 
> E.g. for standard linear models, with the predict.lm function, we can set
> interval="confidence" , level = 0.95 and type="response".
> 
> Thanks in advance!
> 
> 	[[alternate HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list