ciTools icon indicating copy to clipboard operation
ciTools copied to clipboard

Support gls models?

Open tomwenseleers opened this issue 6 years ago • 3 comments

Would it also be possible for the package to support confidence and prediction intervals for gls models?

tomwenseleers avatar Mar 05 '18 14:03 tomwenseleers

Thanks for this question. It would be nice to have this feature in ciTools. I'm a bit busy with the intervals associated with lmers and glmers right now. Do you have a reference on the math behind CIs and PIs for GLS models? That would be the first step for us.

jthaman avatar Mar 05 '18 15:03 jthaman

I'm also not sure how users commonly fit GLS models in R. I assume this is done with the nlme package?

jthaman avatar Mar 05 '18 15:03 jthaman

Yes nlme::gls is the common one; there is also MASS:lm.gls, which has a predict method with a SE.fit argument. I noticed this paper where they calculated prediction intervals for a gls model, https://pubs.usgs.gov/wri/1994/4155/report.pdf, but in this thread they seem to indicate it's not so trivial : https://stat.ethz.ch/pipermail/r-help/2003-May/033891.html. I think it's easy if only the weights argument is given (as it's basically equivalent to weighted least squares then), but not if more complex within-group correlation structures are specified using the correlation argument...

tomwenseleers avatar Mar 06 '18 09:03 tomwenseleers