[R] Augmented Dickie-Fuller test (Nick Wray)

Adrian Trapletti @dr|@n @end|ng |rom tr@p|ett|@org
Fri Aug 27 16:39:40 CEST 2021


Hi Nick,

If you are using adf.test() from tseries, then the reason is the
linear trend incorporated into the regression. From the help: "The
general regression equation which incorporates a constant and a linear
trend is used and the t-statistic for a first order autoregressive
coefficient equals one is computed."

Regress the data on a constant and a linear trend and check the residuals.

Cheers,
Adrian

Adrian Trapletti

Steinstrasse 9b, 8610 Uster, Switzerland
P +41 44 994 56 30  |  M +41 79 103 71 31
adrian using trapletti.org  |  www.trapletti.org


On Fri, Aug 27, 2021 at 12:00 PM <r-help-request using r-project.org> wrote:
>
> Send R-help mailing list submissions to
>         r-help using r-project.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://stat.ethz.ch/mailman/listinfo/r-help
> or, via email, send a message with subject or body 'help' to
>         r-help-request using r-project.org
>
> You can reach the person managing the list at
>         r-help-owner using r-project.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of R-help digest..."
>
>
> Today's Topics:
>
>    1. Augmented Dickie-Fuller test (Nick Wray)
>    2. ggplot error of "`data` must be a data frame, or other object
>       coercible by `fortify()`, not an S3 object with class rxlsx"
>       (Kai Yang)
>    3. Re: ggplot error of "`data` must be a data frame, or other
>       object coercible by `fortify()`, not an S3 object with class
>       rxlsx" (Thierry Onkelinx)
>    4. Re: ggplot error of "`data` must be a data frame, or other
>       object coercible by `fortify()`, not an S3 object with class
>       rxlsx" (Andrew Simmons)
>    5. Re: Augmented Dickie-Fuller test (John C Frain)
>    6. Re: ggplot error of "`data` must be a data frame, or other
>       object coercible by `fortify()`, not an S3 object with class
>       rxlsx" (Avi Gross)
>    7. Potential bug/unexpected behaviour in model matrix
>       (Leonidas Lundell)
>    8. Re: ggplot error of "`data` must be a data frame, or other
>       object coercible by `fortify()`, not an S3 object with class
>       rxlsx" (Kai Yang)
>    9. Re: ggplot error of "`data` must be a data frame, or other
>       object coercible by `fortify()`, not an S3 object with class
>       rxlsx" (Kai Yang)
>   10. Re: ggplot error of "`data` must be a data frame, or other
>       object coercible by `fortify()`, not an S3 object with class
>       rxlsx" (John C Frain)
>   11. Re: ggplot error of "`data` must be a data frame, or other
>       object coercible by `fortify()`, not an S3 object with class
>       rxlsx" (Bill Dunlap)
>   12. Re: ggplot error of "`data` must be a data frame, or other
>       object coercible by `fortify()`, not an S3 object with class
>       rxlsx" (Andrew Simmons)
>   13. Re: Potential bug/unexpected behaviour in model matrix
>       (Andrew Simmons)
>   14. Help with clinical trials.gov AACT database (bharat rawlley)
>   15. Re: ggplot error of "`data` must be a data frame, or other
>       object coercible by `fortify()`, not an S3 object with class
>       rxlsx" (Avi Gross)
>   16. Re: ggplot error of "`data` must be a data frame, or other
>       object coercible by `fortify()`, not an S3 object with class
>       rxlsx" (Kai Yang)
>   17. Re: Help with clinical trials.gov AACT database (bharat rawlley)
>   18. showing the complexity of r code..... (akshay kulkarni)
>   19. Re: showing the complexity of r code..... (Eric Berger)
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 26 Aug 2021 14:23:16 +0100
> From: Nick Wray <nickmwray using gmail.com>
> To: r-help using r-project.org
> Subject: [R] Augmented Dickie-Fuller test
> Message-ID:
>         <CABxY9BPhLpNwBThX107zT=9q48rxCfSUutH5+5H+d6A10mZ35w using mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hello: I've downloaded this dataset, and when I plot it it is clearly
> non-stationary
>
>
> df <- read.csv('
> https://raw.githubusercontent.com/ourcodingclub/CC-time-series/master/monthly_milk.csv
> ')
>
> plot(df,type="l")
>
> But when I apply the Augmented Dickie-Fuller Test I get a p value of 0.01,
> implying that there is evidence to reject the null that the series is
> non-stationary. I am puzzled as to why this is happening. Is this because
> the confidence level is basically too high or is something else going on?
>
> adf.test(df[,2])
>
> Augmented Dickey-Fuller Test
>
> data: df[, 2] Dickey-Fuller = -9.9714, Lag order = 5, p-value = 0.01
> alternative hypothesis: stationary
>
> Thanks Nick Wray
>



More information about the R-help mailing list