0

I am a beginner in R TimeSeries analysis. I have a .txt file having comma separated values like below:

data

I have run the below commands:

dd <- read.zoo("data.txt", index.column = 1, sep = ",", format = "%Y-%m-%d", 
               header = TRUE, FUN = as.Date)

str

dd_xts <- as.xts(dd)
model <- arima(dd_xts, order=c(2, 0, 1))

Now, plotting the fitted values via:

plot(fitted.Arima(model))

fitted

which does not have the same values of Time as the initial xts object on X-axis, as shown below:

original

What is going wrong??

MBorg
  • 1,345
  • 2
  • 19
  • 38
  • Try to use `as.Date`. –  Mar 07 '18 at 06:21
  • Have a look at this, it is quite similar to your question. https://stackoverflow.com/questions/4843969/plotting-time-series-with-date-labels-on-x-axis –  Mar 07 '18 at 06:22
  • have already used as.Date in read.zoo() , so my data on plotting gives the second plot but issue is with the plot of values fitted by the arima model in the first plot .The first plot's x-axis doesn't show Time values as in the second one . – Ankita Jhar Mar 07 '18 at 17:45
  • Missed to mention....dd_xts looks like below:., , [1] 2017-01-01,338.9700000. 2017-01-02,4551.350000 – Ankita Jhar Mar 07 '18 at 17:47

0 Answers0