Error in AR order using quantmod

I am trying to fo Augment dickey -fuller test using quantmod for a class project and have following code; and get the error. Am I missing any library since I only have quantmod , please help , I am new to this and seem lost ; thanks in advance

library(quantmod)
getSymbols("AAPL")
AAPL.rtn=diff(log(AAPL$AAPL.Adjusted))
t.test(AAPL.rtn)
AAPL <- na.omit(AAPL.rtn) # removes the NAs
acf(AAPL)
m1=ar(AAPL, method='mle')
m1$order

Error in ar.mle(x, aic = aic, order.max = order.max, na.action = na.action, :
MLE only implemented for univariate series

Do you want AAPL.rtn rather than AAPL?

I put AAPl since I omitted the na variable. I tried doing with AAPL.rtn but same error

Leave off method='mle'

it worked thanks a lot , appreciate much

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.