I am trying to fit ARIMA model on a monthly data. I checked for stationarity, it was not stationarity so I tried to difference, but this is the error message I got:
>Error in `if (k < 0) stop("k negative")`:
> missing value where TRUE/FALSE needed
Here is my code
>>>>>>>>>
#...create a monthly time series data
atm.ts<-ts(atm,frequency=12,start=c(2009,1))
atm.ts
#... plot of the cheque data
plot.ts(atm,main="Values of atm Transaction(Billions)",ylab="values in billion",xlab="Years(Monthly)")
#...test of normality
shapiro.test(atm.ts)
#...test of stationarity using augmented dickey fuller tests
adf.test(atm.ts)
#...not stationary, needs differencing
atm.diff<-diff(atm,difference=1)
#..test of stationarity on the differenced
adf.test(atm.diff)
Then the error message comes up.