I have timeserie:
x
4557 9940 9855 9894 10142 9501 9532 9229 9169 9214 9347 9176 8951 9344 9873 9970
9139 9420 9476 9205 9271 8632 8730 9336 9150 9601 10012 9841 9951 9222 8799 9316
10087 9677 9154 9019 10549 9629 9131 9560 10246 10982 11748 9054 8690 9923
tt<-1:length(x)
plot(x, xaxt = "n", type = "l", xlab = NULL, ylab = NULL, col = "royalblue2", lwd = 2.3)
I want to add linear trend:
fit <- lm(x ~ tt)
co <- coef(fit)
co
(Intercept) tt
8940.23478 21.27031
And then I need to find angle between two red lines:
abline(8940.23478, 21.27031, col = "red", lwd = 2)
abline(8940.23478, 0, col = "red", lwd = 2)
How can I manage that?
Here is my graph: