library(astsa)
library(forecast)
globtemp
trend <- tslm(globtemp~I(trend^2)+trend)
autoplot(cbind(globtemp,trend$fitted), lwd=1)
How do I extrapolate here? I'd like to draw the "trend line" line further, up to let's say 2031.
I tried using solution from this question:
predict(trend, data.frame(date=seq(as.Date("2021-01-01"), by="1 year", length.out=10)), interval = "prediction")
but it only warned me that Warning message: 'newdata' had 10 rows but variables found have 136 rows
and gave some gibberish results.