I regressed data by industry by year as following commands:

. xtset code1 year
panel variable: code1 (unbalanced)
time variable: year, 2548 to 2559, but with gaps
delta: 1 unit

. gen ta2=.
(3305 missing values generated)

. tempvar ta

. levelsof bus, local(levels)
1 2 3 4 5 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

. foreach x of local levels {
2. foreach z of numlist 2005/2016 {
3. capture reg ta delrev scaleppe if bus==`x' & year==`z'
4. if !_rc {
5. predict `ta'
6. replace ta2=`ta' if e(sample)
7. drop `ta'
8. }
9. }
10. }

However, there was nothing happened. What's wrong with it.