0

I'm working with monthly data. Have to forecast drug sales. Also, the data points are less in count.

library("readxl")
library(dplyr)
library(doBy)
library("TTR")
library(forecast)
ts_dr1
      Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
2016              0    0    0    0    0    0    0    0    0    0
2017    0    0    0    0 4341 3993 3495 2478  337 

>dput(ts_dr1)
structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4417, 4135, 
    3118, 2415, 500), .Tsp = c(2016.16666666667, 2017.66666666667, 
    12), class = "ts")

However, when i try to convert monthly data into quarter (as none of the functions is working with less than 2 periods),it doesn't yield expected results.

> quarterly <- aggregate(ts_dr1 , nfrequency=4, mean)
> quarterly 
Time Series:
Start = 2016.16666666667 
End = 2017.41666666667 
Frequency = 4 
[1]    0.000    0.000    0.000    0.000 1472.333 3222.667      

Problem area: 1) It shows 1 observation ,whereas ideally, it should be 2 . 2) Also,no function is working with these(auto.arima or decompose,etc.):"as the periods are less than 2". Any workaround ! Although, my ultimate aim is to use ARIMAX on it . I'm starting with the univariate(Arima) as this is my 1st project.

Any help would be appreciated.

  • please provide a [great reproducible example](https://stackoverflow.com/q/5963269/3250126). You should edit the output of `dput(ts_dr1)` to your Q so that we can help you with your specific problem. Furthermore, include all used `library()`s – loki Dec 21 '17 at 09:20
  • Though, I think `[1] 0.3333333 0.3333333 0.0000000 2.3333333 1448.3333333 3322.0000000` does not only *show[] 1 observation* but the mean of 6 quarters. – loki Dec 21 '17 at 09:25
  • @loki : libraries added to the code. I'm not sure ,if I correctly understand "edit the output of dput(ts_dr1) " – user2518829 Dec 21 '17 at 11:36
  • also,can i forecast using these 6 values. Would it be reliable, specifically , when the data is skewed(from 2017 April shift to May) – user2518829 Dec 21 '17 at 11:46
  • just enter `dput(ts_dr1)` into the console and paste the `structure(.....)` that is returned into your Q – loki Dec 21 '17 at 12:46

0 Answers0