*! version 1.0.1 28oct2021 Matteo Bottai
program m_effectsize
	syntax varname, [IQR * ]
	if "`e(cmd)'"!="xtreg" & "`e(cmd)'"!="xtqreg" {
		error 301
		}
	tempname a
	global cmd = e(cmdline)
	global depvar = e(depvar)
	global den = "(r(p75)-r(p25))"
	if "`e(cmd)'"=="xtreg" & "`iqr'"=="" {
		global den = e(sigma_e)
		}
	est store `a'
	bootstrap D = r(D), cluster(`=e(ivar)') nolegend `options': m_effectsize_extract `varlist'
	global cmd ""
	global depvar ""
	global den ""
	qui est restore `a'
	end