I am a beginning learner of Mata, and I came across a feedback of "break" when running the code below:
stata 16 SE
Code:
forvalues i = 1/20 { clear all set obs 100 program define myboot, rclass preserve bsample gen new7`i'id=id xtset new7`i'id qdate xtreg F`i'.y $bplinshock $bplinxlist, fe robust scalar bylinh`i'=_b[$bplinshock] gen new8`i'id=id xtset new8`i'id qdate xtreg F`i'.g $bplinshock $bplinxlist, fe robust scalar bglinh`i' = _b[$bplinshock] scalar sumliny = bylinh`i' + sumliny scalar sumling = bglinh`i' + sumling return scalar multlinh`i'=sumliny/sumling restore end simulate multlinh`i'=r(multlinh`i'), reps(100): myboot sum bstat, stat(multlinh`i'_obs) n(100) estat bootstrap, all }
Comment