title: How to interpret adfuller test results?
body: <p>I am struggling to understand the concept of p-value and the various other results of adfuller test.</p>
  <p>The code I am using:</p>
  <p>(I found this code in Stack Overflow)</p>
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  import os
  import pandas as pd
  import statsmodels.api as sm
  import cython
  
  import statsmodels.tsa.stattools as ts
  
  loc = r&quot;C:\Stock Study\Stock Research\Hist Data&quot;
  os.chdir(loc)
  xl_file1 = pd.ExcelFile(&quot;HDFCBANK.xlsx&quot;)
  xl_file2 = pd.ExcelFile(&quot;KOTAKBANK.xlsx&quot;)
  y1 = xl_file1.parse(&quot;Sheet1&quot;)
  x1 = xl_file2.parse(&quot;Sheet1&quot;)
  
  x = x1['Close']
  y = y1['Close']
  
  
  def cointegration_test(y, x):
      # Step 1: regress on variable on the other
      ols_result = sm.OLS(y, x).fit()
      # Step 2: obtain the residual (ols_resuld.resid)
      # Step 3: apply Augmented Dickey-Fuller test to see whether
      #        the residual is unit root
      return ts.adfuller(ols_result.resid)
  </code></pre>
  <p>The output:</p>
  <pre><code>(-1.8481210964862593, 0.35684591783869046, 0, 1954, {'10%': -2.5675580437891359, '1%': -3.4337010293693235, '5%': -2.863020285222162}, 21029.870846458849)
  </code></pre>
  <p>If I understand the test correctly:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Value</th>
  <th></th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>adf : float</td>
  <td>Test statistic</td>
  </tr>
  <tr>
  <td>pvalue : float</td>
  <td>MacKinnon’s approximate p-value based on MacKinnon (1994, 2010)</td>
  </tr>
  <tr>
  <td>usedlag : int</td>
  <td>Number of lags used</td>
  </tr>
  <tr>
  <td>nobs : int</td>
  <td>Number of observations used for the ADF regression and calculation of the critical values</td>
  </tr>
  <tr>
  <td>critical values : dict</td>
  <td>Critical values for the test statistic at the 1 %, 5 %, and 10 % levels. Based on MacKinnon (2010)</td>
  </tr>
  <tr>
  <td>icbest : float</td>
  <td>The maximized information criterion if autolag is not None.</td>
  </tr>
  <tr>
  <td>resstore : ResultStore, optional</td>
  <td></td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I am unable to completely understand the results and was hoping someone would be willing to explain them in layman's language. All the explanations I am finding are very technical.</p>
  <p>My interpretation is: they are cointegrated, i.e. we failed to disprove the null hypothesis(i.e. unit root exists). Confidence levels are the % numbers.</p>
  <p>Am I completely wrong?</p>