I don't have advice specific to error correcting model (ECM) setting, but in undergraduate applied econometric class they gave us the generic advice to continue to extend lags in the model until the residuals of the fitted model were serially uncorrelated. For example, in the US life expectancy data, residuals of male life expectancy is serially uncorrelated in the AR(5) model but not the AR(4) model. You can see this for yourself with the following Stata code:
use http://www.stata-press.com/data/r8/uslifeexp.dta
tsset year, yearly
reg le_male L(1/4).le_male
estat durbinalt, small
reg le_male L(1/5).le_male
estat durbinalt, small
The Stata documentation for the vector error-correction models also seems to roughly follow this approach but it looks like it is automated under the varsoc function and additionally the AIC, HQIC, and SBIC are all generated programmatically.
To test for cointegration or fit cointegrating VECMs, we must specify
how many lags to include. Building on the work of Tsay (1984) and
Paulsen (1984), Nielsen (2001) has shown that the methods implemented
in varsoc can be used to determine the lag order for a VAR model with
I(1) variables. As can be seen from (9), the order of the
corresponding VECM is always one less than the VAR. vec makes this
adjustment automatically, so we will always refer to the order of the
underlying VAR. The output below uses varsoc to determine the lag
order of the VAR of the average housing prices in Dallas and
Houston....
We will use two lags for this bivariate model because the Hannan–Quinn
information criterion (HQIC) method, Schwarz Bayesian information
criterion (SBIC) method, and sequential likelihood-ratio (LR) test all
chose two lags, as indicated by the “*” in the output.
. clear all
. use http://www.stata-press.com/data/r13/txhprice
. varsoc dallas houston
Selection-order criteria
Sample: 1990m5 - 2003m12 Number of obs = 164
+---------------------------------------------------------------------------+
|lag | LL LR df p FPE AIC HQIC SBIC |
|----+----------------------------------------------------------------------|
| 0 | 299.525 .000091 -3.62835 -3.61301 -3.59055 |
| 1 | 577.483 555.92 4 0.000 3.2e-06 -6.9693 -6.92326 -6.85589 |
| 2 | 590.978 26.991* 4 0.000 2.9e-06* -7.0851* -7.00837* -6.89608* |
| 3 | 593.437 4.918 4 0.296 2.9e-06 -7.06631 -6.95888 -6.80168 |
| 4 | 596.364 5.8532 4 0.210 3.0e-06 -7.05322 -6.9151 -6.71299 |
+---------------------------------------------------------------------------+
Endogenous: dallas houston
Exogenous: _cons
If, as @GraemeWalsh suggests, you would like to use an auto-regressive distributed lags methodology (ARDL) you can do so without having to code it up yourself.
use http://www.stata-press.com/data/r13/txhprice
sort t
net install ardl.pkg
ardl dallas houston, maxlag(4)
ARDL regression
Model: level
Sample: 1990m5 - 2003m12
Number of obs = 164
Log likelihood = 313.86816
R-squared = .96315461
Adj R-squared = .96246376
Root MSE = .03613756
------------------------------------------------------------------------------
dallas | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
dallas |
L1. | .427744 .0789194 5.42 0.000 .271886 .583602
L2. | .1747019 .0720507 2.42 0.016 .0324089 .3169948
|
houston | .3404766 .0567884 6.00 0.000 .2283252 .452628
_cons | .7276476 .2061803 3.53 0.001 .3204618 1.134833
------------------------------------------------------------------------------