I am running a time series regression by doing:
ts(Regression.data, frequency = 12, start=c(2012,10))
and then running:
attach(Regression.data)
model <- lm(logsalesUK ~ time(Date) + Exchangerate)
plot(Exchangerate, logsalesUK)
I would like to return the regression line using:
abline(model)
However this returns the date regression line. Can someone explain to me how to choose the exchange rate regression line to the plot?
---bonus question---
Is this time series regression taking into account the seasonality specified in the ts
function? (see above)
You can extract the coefficients you need from model
and feed them into abline
explicitly:
abline(model$coefficients[["(Intercept)"]], model$coefficients[["Exchangerate"]])