0

I have my data as below:

I have Date, Category and Qty in my data, where Category has n different types.

I'm able to forecast Qty, using just Date, but I would want to include Category in the forecast, so I do not have to load n different files to separate one category at a time. I'm new to R and any guidance is highly appreciated. Please advise.

enter image description here

kath
  • 7,624
  • 17
  • 32
Brad
  • 1
  • 1) Please don't share data as an image, but use e.g. `dput` instead. 2) Please share the code you have so far. – Axeman Jun 03 '19 at 15:05
  • Welcome to SO. Please provide your data in a reproducible format and share more information about the problem, such as what you tried and where you are stuck. Have a look at [How to make a great R reproducible example](https://stackoverflow.com/a/5963610/5892059) – kath Jun 03 '19 at 15:05
  • Y <- ts(df[,2], start = c(2019,2), frequency = 330) fit_arima <- auto.arima(Y,d=1, stepwise = FALSE, approximation = FALSE, trace = TRUE) print(summary(fit_arima)) checkresiduals(fit_arima) fcst <- forecast(fit_arima, h=7) autoplot(fcst) print(summary(fcst)) How do i use Category variable as an input in this code? – Brad Jun 03 '19 at 15:55
  • I'm pretty new to R and any help is highly appreciated – Brad Jun 03 '19 at 15:55

0 Answers0