Reputation: 7846
I can perform an adf test on a vector:
library(tseries)
ht <- adf.test(vector, alternative="stationary", k=0)
but I am having trouble performing it on columns of values in a data.frame:
ht <- adf.test(dataframe, alternative="stationary", k=0)
Is there a way of doing this?
Upvotes: 1
Views: 2748
Reputation: 240
To get the pvalues of all the variables in one table you can us ldply from the plyr package.
pvalues=ldply(ht, function(x){ x$p.value })
Upvotes: 3