# Estimating ARDL using Stata

In this simple tutorial, we will show you the steps towards Estimating ARDL using Stata. The estimation of ARDL using Stata requires installation of the Stata ado -ardl- which can be downloaded from the link of its authors here. The installation of Stata ado is simple a copy paste. You need to download the zip folder of the -ardl- ado from the above link, unzip the -ardl- ado and shlp files to any temporary folder. Then copy the given files and paste it to the folder of -ado- in Stata. The common path where -ardl- can be pasted in Stata installation directory can be found here: C:\Program Files (x86)\Stata14\ado\base\a on PCs.

Once the -ardl- ado is copied to this directory, one can read its help file by typing the following command in Stata:

**help ardl**

The help file of -ardl- provides complete instructions on how -ardl- works. One can also see example codes of using the -ardl- where one needs to change the arguments of the code as well as the variables names to the one already in the Stata.

Before running the -ardl- code to estimate the short run or long run equation for the time series, one needs to -tsset- the data using the following code:

**tsset timevariable**

by replacing the timevariable with the name of variable containing the time indicator. Commonly, it will be year for annual time series data.

After the data is -tsset-, we can estimate the -ardl model- using the following example steps which includes time series data from World Bank World Development Indicators for Pakistan.

Download WDI data using the following code

**db wbopendata**

**wbopendata, language(en – English) country(PAK) topics() indicator() long**

tsset the data using the code:

**tsset year**

estimate a simple VAR using the following line of code:

**var ag_agr_trac_no ag_lnd_arbl_ha ag_prd_crel_mt**

Estimation of VAR is not a pre-req of ARDL but we only estimated it for seeing the auto-regressive equations. After estimating the var, we can estimate the -ardl- model using the following code:

**ardl ag_agr_trac_no ag_lnd_arbl_ha ag_prd_crel_mt**

**ardl ag_agr_trac_no ag_lnd_arbl_ha ag_prd_crel_mt, ec**

**ardl ag_agr_trac_no ag_lnd_arbl_ha ag_prd_crel_mt, lags(4) ec**

Once we determine an estimate of -ARDL- using Stata, we can use many otpions like in above code to create different version of the tables like including long run and short run equations for use in writing of reports. After estimating an -ARDL-, we can use the following code to estimate -Pesaran/Shin/Smith (2001) ARDL Bounds Test- to verify existence of cointegration.

**estat btest**

The following example is reproduced from Stata help file of -ardl- to show how it works and to explain how different options work and mean:

We use Stata’s example data set ‘lutkepohl2’ that contains quarterly data for German aggregate

income, investment, and consumption. We estimate an ARDL model in levels-form using the

optimal number of lags according to BIC.

. webuse lutkepohl2

. ardl ln_inv ln_inc ln_consump, lags(. . 4) maxlag(3 3 3)

Lags for ln_inv and ln_inc are optimally selected. ln_consump is pre-specified to receive

a lag order of 4. Here the maxlag setting of 3 is ignored. We can display the lags

selected by issuing

. matrix list e(lags)

For the next model estimates, we do not specify the maxlag() option, so the default of a

maximum lag of 4 applies to all regressors. Since we also do not specify the lags()

option, lags are selected optimally for all regressors.

. ardl ln_inv ln_inc ln_consump

To estimate the error-correction coefficients, use option ec.

. ardl ln_inv ln_inc ln_consump, ec

predict works as usual:

. predict yhat if e(sample), xb

Since we have used option ec in the ardl estimation, the predicted values refer to the

first difference of ln_inv, not to the level:

. tsline yhat d.ln_inv

Whenever you want to select the lags optimally for higher lag orders and many regressors,

consider using option fast. In very rare cases its algorithm may not be as numerically

robust as the standard algorithm, but it makes the lag selection much faster. Compare:

. ardl ln_inv ln_inc ln_consump , maxlag(8) maxcomb(1500) dots

. ardl ln_inv ln_inc ln_consump , maxlag(8) maxcomb(1500) dots fast

To give an example which is more meaningful from an economic perspective, we now want to

examine a potential levels relationship between consumption and income. The unrestricted

constant in the model below is capable of generating the upward drift in the variables that

is visible from their time-series graphs.

. ardl ln_consump ln_inc, lags(4) ec

The long-run coefficient on income is close to 1 and has a tight confidence intervall. To

check whether a long-run relationship between consumption and income can be statistically

confirmed, we use the postestimation command estat btest, which displays results of the PSS

bounds testing procedure.

. estat btest

The output shows that we cannot confirm the existence of a levels relationship. Neither

the F-statistic nor the t-statistic reject the null hypothesis of no levels relationship.