I am trying to model the overall trend of the data set globtemp from the astsa R package with a polynomial: however, I am having problems creating the liner model.
Attaching package: 'zoo'
The following objects are masked from 'package:base':
as.Date, as.Date.numeric
g.temp=as.matrix(globtemp)
plot(time~temperature, ylab="Temperature", main="Global Temperature Model")
Error in eval(predvars, data, env): object 'temperature' not found
That gives me the original plot. I am trying to remove the trend; therefore, I need to create a linear model of the data. So, it needs to be written in the form of x~y.