Hello everyone,
I have a panel with 345 observations and six variables. My cross-sectional variable is Panel_bland (15 groups) and my time-series variable is Panel_year (23 years). I xtreg a correlated random effect model with a translog functional form, and imputed missing values (mi) for two variables (fsize and capint).
I got my results and tried to run my commands by using bysort to identify and compare the coefficients of the individual groups (Panel_bland).

Code:
 mi estimate: bysort panel_bland xtreg ln_NUE ln_rain ln_fsize ln_capint ln_soil ln_crpr ln_irrig mean_rain mean_fsize mean_capint rain2 fsize2 capint2 soil2 crpr2 irrig2 raca raso racr rafs rair fsca fsso fscr fsir crca crir crso cair caso soir, re
I got the error: bysort may not be used in this context.
Reading through Statalist, I tried some alternatives and used the forvalues command with the -if- qualifier but did not manage to make it work. I tried different variations and feel like I am doing a basic mistake when running the commands. Can you help me to find an appropriate alternitive to bysort and/or help me detect the mistake I am doing when running it?
Thank you in advance. Your help is very much appreciated.

Code:
forvalues i= 1(1)15 {
display "CRE for federal states" `i'
mi estimate :xtreg ln_NUE ln_rain ln_fsize ln_capint ln_soil ln_crpr ln_irrig mean_rain mean_fsize mean_capint rain2 fsize2 capint2 soil2 crpr2 irrig2 raca raso racr rafs rair fsca fsso fscr fsir crca crir crso cair caso soir if Panel_bland==`i', re
}
I got the error: insufficient observations an error occurred when mi estimate executed xtreg on m=1

Many thanks in advance.