Hello,
I am trying to implement strata and survey weights with the arhomme command. However, since arhomme is not compatible with svyset, I am attempting to compute survey-weighted standard errors manually. I am using the gsample command to draw weighted samples from my data, but I am receiving the following error:
"Insufficient observations to compute bootstrap standard errors. No results will be saved."
Below is the program I wrote. Any help as to why I my program is failing would be appreciated.
I am trying to implement strata and survey weights with the arhomme command. However, since arhomme is not compatible with svyset, I am attempting to compute survey-weighted standard errors manually. I am using the gsample command to draw weighted samples from my data, but I am receiving the following error:
"Insufficient observations to compute bootstrap standard errors. No results will be saved."
Below is the program I wrote. Any help as to why I my program is failing would be appreciated.
Code:
****bootstrap survey design SE*****
*Step 1, save observed coefficients****
preserve
quietly xi: arhomme log_avrg_cost i.inc_d i.endentulism i.race i.age_cat i.male i.education i.veteran i.mothered i.wealth i.smoke_now chronicdisease[pw=new_weight], select(r11dentst = dentalinsurance_w1 endentulism inc_d race age_cat male education veteran mothered wealth smoke_now chronicdisease) quantiles(0.10, 0.25, 0.50, 0.75, 0.90) taupoints(29) rhopoints(35) meshsize(0.5) frank nostderrors centergrid(-0.20)
matrix beta = e(b)
global N "`e(N)'"
global Ns "`e(sN)'"
restore
** step 2 generate program for bootstrap****
capture program drop arhomme_bootstrap
program arhomme_bootstrap, eclass
preserve
gsample [w=new_weight], strata(raestrat) cluster(raehsamp)
quietly xi: arhomme log_avrg_cost i.inc_d i.endentulism i.race i.age_cat i.male i.education i.veteran i.mothered i.wealth i.smoke_now chronicdisease[pw=new_weight], select(r11dentst = dentalinsurance_w1 endentulism inc_d race age_cat male education veteran mothered wealth smoke_now chronicdisease) quantiles(0.10, 0.25, 0.50, 0.75, 0.90) taupoints(29) rhopoints(35) meshsize(0.5) frank nostderrors centergrid(-0.20)
matrix beta_boot = e(b)
forvalue i = 1/119 {
ereturn scalar beta_boot_`i' =beta_boot[1, `i']
}
restore
end
* step 3: run the bootstrap**
preserve
simulate "list of coefficents"
reps(5) seed(123456): arhomme_bootstrap
restore
* step 4 estimate the boostrap SE**
preserve
bstat, stat(beta)
restore
