forval i=1/24 {
qui xtreg y x1 x2 x3 x4 x5 ///
l`i'.y l`i'.x1 l`i'.x2 l`i'.x3 l`i'.x4 l`i'.x5, fe
qui estat ic
estimates store model`i'
}

Hello everybody. Before ı choose to use pmg or mg panel estimation model ı need to find the optimal lag. I can find it with long way. Bu ı want to build a loop for that as above. But ı dont know how to add other lags in every turn.

for example as above ı added first lags in first turn of loop but how to add secons lags with first lags in second turn?
how to add thirs lags with second and first lags in third turn of loop?