You can use Markus Eberhardt's excellent xtmg command for this. This will perform separate time series regressions for each panel unit. You can install it through ssc I think (ssc install xtmg) and then replace the regress part by the following.
Code:
*** Regress xtset date prediction gen L_routput = L.routput xtmg routput L_routput, res(shock)
Comment