I have a time series over 10 years with no seasonal changes (only one value per year) and I try to detect a trend. I dont really understand how to do so. I read that the moving average is used in this case
What I did so far:
CharFS <- read.csv("./DataInvestigation/TEST.csv", header=TRUE, sep=";")
ma.1 <- rep(1/5,5)
ma.2 <- rep(1/25,25) #How do I know what I should take?
ma.3 <- rep(1/81,81)
CharMA <- filter(CharFS, ma.1, sides=2)
plot(CharFS)
lines(ma.1, lty=2, col="blue")
lines(ma.2, lty=2, col="blue")
lines(ma.3, lty=2, col="blue")
However, no line shows up. I assume that ma.1
,ma.2
,ma.3
are wrong is but I dont know how to adjust it to my data, any ideas?
Or is there a better way to get a trend when there are no seasons involved? Would it be possible with a normal plot and then add a line? This did not work either when I tried it though.
Thanks in advance!