***Getting Bootstrapped Standard errors for counts of binary outcomes. program myratio, rclass sum exp if study==1 & outcome==1 & cond==7 local nom = r(N) sum exp if study==1 & cond==7 local denom = r(N) return scalar ratio = `nom'/`denom' end bootstrap r(ratio), reps(1000): myratio **Notes: There is probably a better way, but tabulate does not store the scalars needed and this works! *First sum if statement denotes the outcome (yes or 1s) out of the sample population *Second if statement denotes the sample population for the condition (cond) and the study (study) ****CREDIT Stata *https://www.stata.com/features/overview/bootstrap-sampling-and-estimation/