I am trying to perform an adfTest in order to evaluate the stationarity of my daily returns. Using the function adfTest
, I get the following error:
Error in r[i1] - r[-length(r):-(length(r) - lag + 1L)] :
non-numeric argument to binary operator
In addition: Warning message:
In if (class(x) == "timeSeries") x = series(x) :
the condition has length > 1 and only the first element will be used
I think it might comes from the fact that daily returns are not an univariate timeseries but I don't understand then how I could test the stationarity of my daily returns?
I computed the following example for a better understanding of my problem:
library(fUnitRoots)
library(zoo)
test.date <- as.Date(c("2009-02-01", "2009-02-02", "2009-02-05", "2009-02-06"))
test.return <- c("0.01", "0.02", "-0.05", "0.008")
test.data <- data.frame(test.date, test.return)
test.ts <- read.zoo(test.data, format = "%Y-%m-%d")
adfTest(test.ts)
Thanks for your help