[R] How to implement an iterative unit root test

Andy Bunn abunn at whrc.org
Thu Apr 6 04:02:31 CEST 2006

Does this get you started?

foo <- matrix(rnorm(1000),ncol=10,nrow=100)
bar <- apply(foo,2,adf.test)
sapply(bar, "[[", "statistic")
sapply(bar, "[[", "p.value")

HTH, Andy

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Bernd Dittmann
Sent: Wednesday, April 05, 2006 8:58 PM
To: r-help at stat.math.ethz.ch
Subject: [R] How to implement an iterative unit root test


How can an interative unit root test be implemented in R?
More specifically, given a time series, I wish to perform the Dickey 
Fuller Test on a daily basis for say the last 100 observations. It would 
be interative in the sense that this test would be repeated each day for 
the last 100 observations.
Given the daily Dickey Fuller estimates of delta for the autoregressive 

d(Y(t)) = delta * Y(t-1) + u(t)

, the significance of delta would be computed. If possible, I would like 
to extract that value and record it in a table, that is a table 
containing the tau-values of a each day's calculations.

How can such a test be done in R? More specifically, how can it be 
programmed to iteratively perform the test and also how to extract the 
t-values on a daily basis?

Thank you.


Bernd Dittmann

R-help at stat.math.ethz.ch mailing list
PLEASE do read the posting guide!

More information about the R-help mailing list