title: What is the use of xreg in auto.arima function?
body: <p>I am working on predicting the number of customer attending an hospital to perform MR scan per day. I have the daily count of the customers attending the hospital for the last 4 years. But I am not able to capture the daily change in the count of customers attending the hospital for different months accurately. </p>
  
  <p>I am working on Rstudio and I have tried <code>arima</code> as suggested by Rob Hyndman. </p>
  
  <pre><code>modelfitsample&lt;- read.csv("data_xreg_train.csv")
  modeltest &lt;- read.csv("data_xreg_test.csv")
  
  ts_beverly_train &lt;- ts(modelfitsample$Volume, start = c(2015,1), frequency=365.25)
  ts_beverly_test &lt;- ts(modeltest$Volume, start = c(2018,1), frequency=365)
  
  xreg &lt;- cbind(month=model.matrix(~as.factor(modelfitsample$Month)))
  xreg1 &lt;- cbind(month=model.matrix(~as.factor(modeltest$Month)))
  
  modArima &lt;- auto.arima(ts_beverly_train, xreg=xreg)
  modArima
  
  fit11 &lt;- forecast(modArima, h=485, xreg = xreg1)
  
  plot(fit11)
  </code></pre>
  
  <p>I need a prediction that can capture the daily change and also consider the monthly seasonality</p>