1

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))
talat
  • 68,970
  • 21
  • 126
  • 157
Til Hund
  • 1,543
  • 5
  • 21
  • 37
  • 2
    It's not clear how you can expect to analyse a seasonal trend (within year) if you only have one registration per year. `?ts` is pointing you to `?stl`, which is more explicit on the requirements of `x`: "This should be an object of class "`ts`" with a frequency greater than one.". I assume this is true for `x` in `decompose` as well. – Henrik Dec 05 '14 at 10:30
  • Also explained here: http://stackoverflow.com/a/12330763/3521006 – talat Dec 05 '14 at 10:35
  • @Henrik, thank you! I was blind, I overlooked the fact that decompose has as well a seasonal trend analysis. D'oh. **Edit: How can I mark your comment as answer to my question?** – Til Hund Dec 05 '14 at 10:58
  • @TilHund Your question already has an answer (see my previous comment), and will most likely be closed as a dupe, so I am reluctant to post an answer here. – Henrik Dec 05 '14 at 11:11

0 Answers0