clear
set more off
use "~/public_html/econ407/workshop/handson_data.dta"
* generated in matlab by score=round(rsn(20,70,5,1.5))';
hist scores, bin(10) kdensity freq
ci scores, level(95)
bstrap r(mean), reps(1000) saving(bsdata,replace): sum scores
* In our class experiment, we get [69.75,79.15] using the non-parametric.
* Note: stata is using the normal approximation method
* To use the non-parametric method, and not have to rely on normality, use this:
* The short version
estat bootstrap, percentile
* To verify this, consider manually look at each bootstrap replicate (stored in bsdata),
* sort them and pick off the upper and lower 95% ci's:
clear
use bsdata
sort _bs_1
sum _bs_1
list if _n==25 | _n==975