<p>Do the last one, the first one is just the same thing but you will not be using the in-built adf function. The second one does it better and you have a choice of including lagged differences to control for possible autocorrelation. If your data is monthly, give it a lag order of 12. </p>

CC BY-SA 3.0
2016-05-17T16:59:45.640Z
2016-05-17T16:59:45.640Z
london
<p>In STATA I would actually recommend the package egranger</p>

<p>Find more about it:</p>

<pre><code>findit egranger
</code></pre>

<p>and to install it:</p>

<pre><code>ssc inst egranger
</code></pre>

<p>Regarding the DF-test, I usually use another package, dfao. This one lets me use an information criterion, such as HQIC, AIC or SBIC, to choose the optimal lag length. Again:</p>

<pre><code>findit dfao
</code></pre>

<p>To install it:</p>

<pre><code>ssc inst dfao
</code></pre>

<p>My default specification for the DF is </p>

<pre><code>dfao varname, lltc(sc) noao notr
</code></pre>

<p>where the options specify, in order: use the Schwarz criterion to choose the lag length; do not test for additive outliers [i.e. work like normal DF test]; and do not add a trend automatically.</p>

CC BY-SA 3.0
2016-05-18T01:35:04.773Z
2016-05-18T01:35:04.773Z
user_newbie10
<p>I am doing a Engle-Granger test for cointegration and I am unsure about some commands.</p>

<p>"Cointegration and the ECM" (document) from learneconometric.com says I should use:</p>

<pre><code>regress b f
predict ehat, residual
regress D.ehat L.ehat L.D.ehat, noconstant
</code></pre>

<p>However, "Time series" (document from Princeton Uni) says I should use:</p>

<pre><code>regress b f
predict ehat, resid
dfuller ehat, lags(10)
</code></pre>

<p>So I am unsure about the last commands here. Should I use <code>regress D.ehat L.ehat L.D.ehat, noconstant</code> or <code>dfuller ehat, lags(10)</code> and what is the difference here? Also, how many "lags" should I include for the Dickey Fuller test?</p>

<econometrics><stata>
Cointegration test in Stata
Arete
# Cointegration test in Stata

(Asked by: username_0 on 2016-05-16)

I am doing a Engle-Granger test for cointegration and I am unsure about some commands.

"Cointegration and the ECM" (document) from learneconometric.com says I should use:

```
regress b f
predict ehat, residual
regress D.ehat L.ehat L.D.ehat, noconstant

```

However, "Time series" (document from Princeton Uni) says I should use:

```
regress b f
predict ehat, resid
dfuller ehat, lags(10)

```

So I am unsure about the last commands here. Should I use `regress D.ehat L.ehat L.D.ehat, noconstant` or `dfuller ehat, lags(10)` and what is the difference here? Also, how many "lags" should I include for the Dickey Fuller test?

**Tags:** econometrics, stata


---

## 2 answers

### Answer by username_1 on 2016-05-17. Score: 1 | Accepted answer

Do the last one, the first one is just the same thing but you will not be using the in-built adf function. The second one does it better and you have a choice of including lagged differences to control for possible autocorrelation. If your data is monthly, give it a lag order of 12.


---

### Answer by username_2 on 2016-05-18. Score: 0

In STATA I would actually recommend the package egranger

Find more about it:

```
findit egranger

```

and to install it:

```
ssc inst egranger

```

Regarding the DF-test, I usually use another package, dfao. This one lets me use an information criterion, such as HQIC, AIC or SBIC, to choose the optimal lag length. Again:

```
findit dfao

```

To install it:

```
ssc inst dfao

```

My default specification for the DF is

```
dfao varname, lltc(sc) noao notr

```

where the options specify, in order: use the Schwarz criterion to choose the lag length; do not test for additive outliers [i.e. work like normal DF test]; and do not add a trend automatically.


---

