[R] ADF test
Leeds, Mark (IED)
Mark.Leeds at morganstanley.com
Thu Aug 16 15:37:34 CEST 2007
The dickey fuller test results can change radically depending on how
many lags you use. If you don't use enough lags, then the
regression assumptions won't hold and your test is not correct. If you
use too many lags, then you lose a lot of power. There is a lot
of literature on how many lags to use. Schwert developed an algorthm and
it's in eric zivot's splus finmetrics text but I don't have that
book with me at the moment. There's also the question of whether to
include a trend or intercept or both in your model. This issue
is discusssed very clearly in hamilton.
-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Megh Dal
Sent: Thursday, August 16, 2007 6:58 AM
To: r-help at stat.math.ethz.ch
Subject: [R] ADF test
Hi all,
Hope you people do not feel irritated for repeatedly sending mail on
Time series.
Here I got another problem on the same, and hope I would get some
answer from you.
I have following dataset:
data[,1]
[1] 4.96 4.95 4.96 4.96 4.97 4.97 4.97 4.97 4.97 4.98 4.98 4.98 4.98
4.98 4.99 4.99 5.00 5.01 [19] 5.01 5.00 5.01 5.01 5.01 5.01 5.02 5.01
5.02 5.02 5.03 5.03 5.03 5.03 5.03 5.04 5.04 5.04 [37] 5.04 5.04 5.04
5.05 5.05 5.06 5.06 5.06 5.07 5.07 5.07 5.07 5.08 5.07 5.08 5.08 5.09
5.10 [55] 5.10 5.09 5.10 5.10 5.10 5.10 5.10 5.10 5.10 5.10 5.11 5.11
5.11 5.11 5.11 5.11 5.11 5.12 [73] 5.12 5.12 5.12 5.13 5.14 5.14 5.14
5.14 5.14 5.15 5.15 5.15 5.15 5.14 5.15 5.15 5.15 5.16 [91] 5.16 5.16
5.16 5.16 5.16 5.16 5.16 5.16 5.16 5.16 5.17 5.17 5.17 5.17 5.17 5.18
5.18 5.18 [109] 5.18 5.18 5.19 5.19 5.20 5.20 5.20 5.20 5.20 5.21 5.21
5.21 5.21 5.21 5.21 5.22 5.22 5.23 [127] 5.23 5.23 5.23 5.24 5.24 5.24
5.25 5.24 5.24 5.25 5.26 5.26 5.26 5.26 5.26 5.26 5.26 5.27 [145] 5.27
5.26 5.27 5.27 5.28 5.29 5.29 5.29 5.29 5.30 5.30 5.30 5.31 5.31 5.31
5.32 5.32 5.33 [163] 5.33
Now I want to conduct a test for stationarity using ADF test :
> adf.test((data[,1]), "stationary", 0)
Augmented Dickey-Fuller Test
data: (data[, 1])
Dickey-Fuller = -3.7351, Lag order = 0, p-value = 0.02394 alternative
hypothesis: stationary
But surprisingly it leads towards rejestion of NULL [p-value is less
than 0.05], i.e. indicates a possible stationary series. However ploting
a graph of actual data set it doesn't seem so.
Am I making any mistakes ? Can anyone give me any suggestion?
Regards,
Megh
---------------------------------
[[alternative HTML version deleted]]
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
--------------------------------------------------------
This is not an offer (or solicitation of an offer) to buy/se...{{dropped}}
More information about the R-help
mailing list