Hi....
My data is stored in a panel data format. I want to estimate the ARDL with a structural break. The break dates are identified using the Bai-Perron test. Suppose I have data for 3 countries (identified by "ID" variable). The break dates are 2006 2001 2004.
The ARDL command with ONE structural break is:

set more off
foreach i of numlist 1/3 {
forvalues j = 2006 2001 2004{
gen trend=_n
gen DU=0
replace DU=1 if year>`j'
gen DTB=0
replace DTB= DU*trend if year>`j'

ardl x y, exo(DU DTB) maxcombs() if id==`i'
ardl x y, exo(DU DTB) ec maxcombs()
estat btest, n(30)
}
}
*
When I run the above command, it is not running successfully. The dataex is the following:

clear all
input int id year x y
1 1993 1.3 1.20E+07
1 1994 1.19 1.30E+07
1 1995 0.87 1.40E+07
1 1996 0.97 1.50E+07
1 1997 1.04 1.40E+07
1 1998 1.04 1.60E+07
1 1999 1.01 1.70E+07
1 2000 1.05 1.80E+07
1 2001 1 1.90E+07
1 2002 0.98 2.00E+07
1 2003 0.95 2.10E+07
1 2004 0.84 2.30E+07
1 2005 0.83 2.40E+07
1 2006 0.82 2.70E+07
1 2007 0.92 3.10E+07
1 2008 0.96 3.10E+07
1 2009 0.98 3.30E+07
1 2010 1.03 3.60E+07
1 2011 1.11 3.80E+07
1 2012 1.01 3.80E+07
1 2013 1.04 4.10E+07
1 2014 0.7 4.40E+07
1 2015 0.6 4.90E+07
1 2016 0.67 5.50E+07
1 2017 0.58 6.10E+07
2 1993 1.57 8.00E+06
2 1994 1.53 8.90E+06
2 1995 1.08 7.70E+06
2 1996 0.95 9.50E+06
2 1997 0.95 9.10E+06
2 1998 0.95 9.80E+06
2 1999 1.42 1.00E+07
2 2000 1.16 1.20E+07
2 2001 0.85 1.10E+07
2 2002 0.81 1.30E+07
2 2003 0.76 1.20E+07
2 2004 0.64 1.30E+07
2 2005 0.91 1.30E+07
2 2006 0.83 1.50E+07
2 2007 0.86 1.60E+07
2 2008 0.71 1.80E+07
2 2009 0.71 1.90E+07
2 2010 0.61 2.20E+07
2 2011 0.61 2.50E+07
2 2012 0.54 2.60E+07
2 2013 0.55 2.70E+07
2 2014 0.85 2.80E+07
2 2015 0.84 3.00E+07
2 2016 0.98 3.20E+07
2 2017 1.16 3.60E+07
3 1993 1.42 931777
3 1994 1.26 977847
3 1995 1.2 1.10E+06
3 1996 1.19 1.20E+06
3 1997 1.09 1.20E+06
3 1998 1.1 1.50E+06
3 1999 1.09 1.60E+06
3 2000 1.08 1.50E+06
3 2001 1.08 1.60E+06
3 2002 1.01 1.70E+06
3 2003 0.99 1.80E+06
3 2004 0.89 2.00E+06
3 2005 0.87 2.10E+06
3 2006 0.82 2.40E+06
3 2007 0.76 2.50E+06
3 2008 0.87 2.70E+06
3 2009 0.94 3.00E+06
3 2010 0.98 3.50E+06
3 2011 0.87 4.20E+06
3 2012 1.06 3.60E+06
3 2013 1.21 3.20E+06
3 2014 1 4.00E+06
3 2015 0.96 4.60E+06
3 2016 0.95 5.20E+06
3 2017 1.07 5.90E+06
end


Any help will be much appreciated.