Augmented Dickey-Fuller Test Results for Time Series Data

Aug 6, 2024, 4:41 AM

adfTest(ret_price[,2])

Title:
Augmented Dickey-Fuller Test
Test Results:
PARAMETER:
Lag Order: 1
STATISTIC:
Dickey-Fuller: -67.0931
P VALUE:
0.01
Description:
Tue Aug 6 09:08:13 2024 by user: ASUS
Warning message:
In adfTest(ret_price[, 2]) : p-value smaller than printed p-value
adfTest(ret_price[,3])
Title:
Augmented Dickey-Fuller Test
Test Results:
PARAMETER:
Lag Order: 1
STATISTIC:
Dickey-Fuller: -63.1956
P VALUE:
0.01
Description:
Tue Aug 6 09:08:13 2024 by user: ASUS
Warning message:
In adfTest(ret_price[, 3]) : p-value smaller than printed p-value
adfTest(ret_price[,5])
Title:
Augmented Dickey-Fuller Test
Test Results:
PARAMETER:
Lag Order: 1
STATISTIC:
Dickey-Fuller: -63.1008
P VALUE:
0.01
The Augmented Dickey-Fuller (ADF) test results for the columns in ret_price indicate the following:
  1. Column 2:
    • Dickey-Fuller Statistic: -67.0931
    • P-Value: < 0.01
    • Lag Order: 1
  2. Column 3:
    • Dickey-Fuller Statistic: -63.1956
    • P-Value: < 0.01
    • Lag Order: 1
  3. Column 5:
    • Dickey-Fuller Statistic: -63.1008
    • P-Value: < 0.01
    • Lag Order: 1
The warning message indicates that the p-value is smaller than the printed value of 0.01. This suggests that the null hypothesis of a unit root can be rejected for these columns, indicating that the time series is stationary.

> adfTest(ret_price[,2])

Title:
Augmented Dickey-Fuller Test
Test Results:
PARAMETER:
Lag Order: 1
STATISTIC:
Dickey-Fuller: -67.0931
P VALUE:
0.01
adfTest(ret_price[,3])
Title:
Augmented Dickey-Fuller Test
Test Results:
PARAMETER:
Lag Order: 1
STATISTIC:
Dickey-Fuller: -63.1956
P VALUE:
0.01
adfTest(ret_price[,5])
Title:
Augmented Dickey-Fuller Test
Test Results:
PARAMETER:
Lag Order: 1
STATISTIC:
Dickey-Fuller: -63.1008
P VALUE:
0.01
PP.test(ret_price[,2], lshort = TRUE)
Phillips-Perron Unit Root Test
data: ret_price[, 2]
Dickey-Fuller = -94.226, Truncation lag parameter = 11, p-value = 0.01
PP.test(ret_price[,3], lshort = TRUE)
Phillips-Perron Unit Root Test
data: ret_price[, 3]
Dickey-Fuller = -88.605, Truncation lag parameter = 11, p-value = 0.01
PP.test(ret_price[,5], lshort = TRUE)
Phillips-Perron Unit Root Test
data: ret_price[, 5]
Dickey-Fuller = -85.806, Truncation lag parameter = 11, p-value =
The Phillips-Perron (PP) test results for the columns in ret_price indicate the following:
  1. Column 2:
    • Dickey-Fuller Statistic: -94.226
    • Truncation Lag Parameter: 11
    • P-Value: < 0.01
  2. Column 3:
    • Dickey-Fuller Statistic: -88.605
    • Truncation Lag Parameter: 11
    • P-Value: < 0.01
  3. Column 5:
    • Dickey-Fuller Statistic: -85.806
    • Truncation Lag Parameter: 11
    • P-Value: < 0.01
The results from both the Augmented Dickey-Fuller (ADF) test and the Phillips-Perron (PP) test suggest that the null hypothesis of a unit root can be rejected for these columns, indicating that the time series is stationary.

give me a table result report of that two test.

Here is the table summarizing the results of the ADF and PP tests:
ColumnTestStatisticLag OrderP-Value
2ADF-67.09311< 0.01
3ADF-63.19561< 0.01
5ADF-63.10081< 0.01
2PP-94.22611< 0.01
3PP-88.60511< 0.01
5PP-85.80611< 0.01
Would you like to perform any further analysis or have any other questions?

Can you explain the difference between the ADF and PP tests?

The Augmented Dickey-Fuller (ADF) test and the Phillips-Perron (PP) test are both used to test for the presence of a unit root in a time series, which helps determine whether the series is stationary or not. Here are the key differences between the two tests:

Augmented Dickey-Fuller (ADF) Test

  1. Methodology: The ADF test is an extension of the Dickey-Fuller test. It includes lagged differences of the time series to account for higher-order correlation.
  2. Model: The ADF test estimates the following regression:
    Δyt=α+βt+γyt1+δ1Δyt1+δ2Δyt2++δpΔytp+ϵt\Delta y_t = \alpha + \beta t + \gamma y_{t-1} + \delta_1 \Delta y_{t-1} + \delta_2 \Delta y_{t-2} + \cdots + \delta_p \Delta y_{t-p} + \epsilon_t
    where Δ\Delta is the difference operator, α\alpha is a constant, βt\beta t is a time trend, γ\gamma is the coefficient of the lagged level of the series, and δi\delta_i are the coefficients of the lagged differences.
  3. Lag Selection: The number of lags (pp) is chosen to ensure that the residuals are white noise. This can be done using criteria like AIC (Akaike Information Criterion) or BIC (Bayesian Information Criterion).
  4. Null Hypothesis: The null hypothesis is that the time series has a unit root (i.e., it is non-stationary).
  5. Assumptions: The ADF test assumes that the error terms are homoscedastic (constant variance).

Phillips-Perron (PP) Test

  1. Methodology: The PP test is a non-parametric test that makes corrections to the Dickey-Fuller test to account for serial correlation and heteroscedasticity in the error terms.
  2. Model: The PP test estimates the following regression:
    Δyt=α+βt+γyt1+ϵt\Delta y_t = \alpha + \beta t + \gamma y_{t-1} + \epsilon_t
    The test then makes corrections to the test statistics to account for serial correlation and heteroscedasticity.
  3. Lag Selection: The PP test does not require the selection of lag length. Instead, it uses a non-parametric correction to the test statistic.
  4. Null Hypothesis: The null hypothesis is that the time series has a unit root (i.e., it is non-stationary).
  5. Assumptions: The PP test is robust to general forms of heteroscedasticity in the error term.

Summary

  • Both tests are used to test for a unit root in a time series.
  • The ADF test includes lagged differences to account for higher-order correlation, while the PP test makes non-parametric corrections to the test statistics.
  • The ADF test requires the selection of lag length, while the PP test does not.
  • The PP test is more robust to heteroscedasticity and serial correlation in the error terms.
Would you like to perform any further analysis or have any other questions?

> library(tseries)

kpss.test(ret_price[,2], null = c("Level", "Trend"), lshort = TRUE)
KPSS Test for Level Stationarity
data: ret_price[, 2]
KPSS Level = 0.098137, Truncation lag parameter = 11, p-value = 0.1
Warning message:
In kpss.test(ret_price[, 2], null = c("Level", "Trend"), lshort = TRUE) :
p-value greater than printed p-value
kpss.test(ret_price[,3], null = c("Level", "Trend"), lshort = TRUE)
KPSS Test for Level Stationarity
data: ret_price[, 3]
KPSS Level = 0.16856, Truncation lag parameter = 11, p-value = 0.1
Warning message:
In kpss.test(ret_price[, 3], null = c("Level", "Trend"), lshort = TRUE) :
p-value greater than printed p-value
kpss.test(ret_price[,5], null = c("Level", "Trend"), lshort = TRUE)
KPSS Test for Level Stationarity
data: ret_price[, 5]
KPSS Level = 0.052713, Truncation lag parameter = 11, p-value = 0.1
Warning message:
In kpss.test(ret_price[, 5], null = c("Level", "Trend"), lshort = TRUE) :
p-value greater than printed p-value
The KPSS (Kwiatkowski-Phillips-Schmidt-Shin) test results for the columns in ret_price indicate the following:
  1. Column 2:
    • KPSS Level: 0.098137
    • Truncation Lag Parameter: 11
    • P-Value: > 0.1
  2. Column 3:
    • KPSS Level: 0.16856
    • Truncation Lag Parameter: 11
    • P-Value: > 0.1
  3. Column 5:
    • KPSS Level: 0.052713
    • Truncation Lag Parameter: 11
    • P-Value: > 0.1
The warning message indicates that the p-value is greater than the printed value of 0.1. This suggests that the null hypothesis of level stationarity cannot be rejected for these columns, indicating that the time series is likely stationary.
Would you like to perform any further analysis or have any other questions?
Get started with Vizly