I would like to do a time series analysis. Unfortunately, I get the following quite common error message but I do not know why.
time series has no or less than 2 periods
I have 44 observations, each representing a unit per Year. I would like to do a time series analysis of this 44 observations using a frequency of 1 (freq=1
) which, to my knowledge, should mean that the time unit is annual according to this website. This is my code:
var <- c(440, 500, 590, 750, 970, 1170, 1350, 1480, 1660, 1950, 2180, 2080, 2000, 1710, 1620, 1570, 1790, 2040, 2250, 2750, 2700, 2870, 2780, 2740, 3040, 3730, 4460, 5050, 4870, 4130, 3860, 3290, 3050, 2950, 3310, 3960, 4800, 6100, 7480, 8140, 9520, 10700, 11640, 11690)
myts <- ts(var,freq=1)
plot(decompose(myts))