capture estimates drop

use MI_drugdeaths_dataset, clear
_eststo deaths: mi estimate, post: regress ln_IHMEdrugdeaths USA $notimputable $imputable, robust
test $imputable $notimputable
estadd scalar pF=r(p)

use MI_drugsWDR_dataset, clear
local counter=0
foreach drug in $drugs {
local start=`counter++'*$imputations+1
local end=`counter'*$imputations
_eststo `drug': mi estimate, post imputations(`start'/`end'): regress `drug' USA $notimputable $imputable year, robust
test $imputable $notimputable
estadd scalar pF=r(p)
}

esttab deaths $drugs using results/table5, ///
	replace csv label b(2) se(2) scalars(pF) sfmt(3) star(* 0.10 ** 0.05 *** 0.01) drop(year _cons) order(USA $notimputable $imputable) ///
	nogaps nonumbers title(Drugs) mtitles(deaths $drugs) coeflabels($variabledescriptions) ///
	addnotes("All dependent variables are log-transformed.")
