I didn't get any responses to my previous question so I will repost it, hopefully someone is kind enough to respond.
I am encountering an error when trying to compute robust standard errors for the arhomme command. Since arhomme does not support the svyset extension, I am attempting to manually replicate the survey design to obtain the correct standard errors and coefficients. However, when I bootstrap the coefficients, the standard errors and confidence intervals are empty.
I have attached the code and output below. Any assistance would be appreciated.
I am encountering an error when trying to compute robust standard errors for the arhomme command. Since arhomme does not support the svyset extension, I am attempting to manually replicate the survey design to obtain the correct standard errors and coefficients. However, when I bootstrap the coefficients, the standard errors and confidence intervals are empty.
I have attached the code and output below. Any assistance would be appreciated.
Code:
* 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)
* Store sample size
global N "`e(N)'"
global Ns "`e(sN)'"
restore
* Step 2: Initialize bootstrap coefficient matrix
set seed 12345
global boot_reps = 50
mat BOOTmatrix = J(1, 119, .)
* Step 3: Run bootstrap
preserve
forvalues i = 1/$boot_reps {
preserve // Save original dataset before resampling
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)
if `i' == 1 {
matrix BOOTmatrix = e(b) // Initialize BOOTmatrix on first iteration
}
else {
matrix BOOTmatrix = (BOOTmatrix \ e(b)) // Append results
}
restore // Restore original dataset
}
restore
* Convert matrix to variables
svmat BOOTmatrix
* Step 4: Compute bootstrap statistics
bootstrap r(mean), reps(100) seed(1234) nodrop: summarize BOOTmatrix*, detail
(running summarize on estimation sample)
Bootstrap replications (100): .........10.........20.........30.........40.........50.........60.........70.........80.........90.........100 done
Bootstrap results Number of obs = 12,711
Replications = 100
Command: summarize BOOTmatrix*, detail
_bs_1: r(mean)
------------------------------------------------------------------------------
| Observed Bootstrap Normal-based
| coefficient std. err. z P>|z| [95% conf. interval]
-------------+----------------------------------------------------------------
_bs_1 | -5.915026 . . . . .
------------------------------------------------------------------------------

Comment