I know that Stata's -bootstrap- command will not calculate a bootstrap weighted mean:
. bootstrap "sum loss_ratio [aw= premium]" r(mean), rep(100)
weights not allowed
However, is it possible to get around this by making repeated calls to -bsample-?
Will the following -simulate- program work or is it committing a sin and only
returning garbage?
program bst_mean, rclass
syntax varlist ,[ weight(string)]
preserve
bsample
sum `varlist' [`weight']
return scalar mean = r(mean)
restore
end
simulate "bst_mean loss_ratio, weight(aw =premium)" mean= r(mean), rep(100)
Thank you,
Scott
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/