0
$\begingroup$

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.

$\endgroup$

1 Answer 1

3
$\begingroup$

Why do you use variable atm one time and variable atm.ts the other time ? Make sure you only work with one variable that is of class ts.

$\endgroup$
1
  • $\begingroup$ So sorry, I noticed the mistake. thanks all the same. $\endgroup$
    – Lekods04
    Commented Feb 13, 2017 at 12:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.