Martin,
When I apply your correction to bsample.ado I get another error
(assuming I made the corrrection correctly).
. forvalue i=1/5{
2. clear
3. use bsampletest, clear
4. qui tab trmtgp
5. scalar prnt=0.5 // to set 50 percent
sampling, can change
> the number here
6. qui count if trmtgp==0 // comparision market in beginning year
7. scalar tabgp1=int(r(N)*prnt)
8. qui count if trmtgp==1 // treatment market in beginning year
9. scalar tabgp3=int(r(N)*prnt)
10. *display "tabgp1="tabgp1, "tabgp3=" tabgp3
. gen nsamp=cond(trmtgp==0 , tabgp1, 0) + cond(trmtgp==1, tabgp3, 0)
11.
.
. bsample_correction010710 nsamp, cluster(pat_zip) strata(trmtgp)
12. egen mean_dist=mean(dis)
13. display "_N=" _N, "mean_dis=" mean_dis
14. }
SRSWR already defined
(error occurred while loading bsample_correction010710.ado)
r(110);
bsample.ado Currently reads:
***
if _rc {
di as err
"resample size must not be greater than number of clusters"
exit 498
}
***
Should be:
***
if _rc {
di as err ///
"resample size must not be greater than number of clusters"
exit 498
}
***
HTH
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/