I would like to create a confidence band for a model fitted with gls like this:
require(ggplot2)
require(nlme)
mp <-data.frame(year=c(1990:2010))
mp$wav <- rnorm(nrow(mp))*cos(2*pi*mp$year)+2*sin(rnorm(nrow(mp)*pi*mp$wav))+5
mp$wow <- rnorm(nrow(mp))*mp$wav+rnorm(nrow(mp))*mp$wav^3
m01 <- gls(wow~poly(wav,3), data=mp, correlation = corARMA(p=1))
mp$fit <- as.numeric(fitted(m01))
p <- ggplot(mp, aes(year, wow))+ geom_point()+ geom_line(aes(year,fit))
p
This only plots the fitted values and the data, and I would like something in the style of
p <- ggplot(mp, aes(year, wow))+ geom_point()+ geom_smooth()
p
but with the bands generated by the gls model.
Thanks!