Hello, I am trying to bootstrap my multilevel model but there are weights for the first level, my model has individuals (caseid) within states (states) but there are sample weights with the first level of the model, the individuals. I tried writing the bootstrap in two different ways, both shown below, but neither works, if anyone has any advice or could provide any help it would be greatly appreciated.
Code:
.
. local contrls ppage biosex income education householdsize ///
> children employment race maritalstatus ///
> handgun_law
.
. bootstrap, reps(100) cluster(states) seed(20): melogit firearm_locked `contrls' [pw=weight] || states:, or
weights not allowed
r(101);
****
svyset caseid [pw=weight], strata(states)
bsweights bs_, n(-1) reps(50) seed(1000)
svyset [pw=weight}, bsrw(bs_*)
local contrls ppage biosex income education householdsize ///
children employment race maritalstatus ///
handgun_law
svy bootstrap _b: melogit firearm_locked `contrls' || states:, or
. ****
. svyset caseid [pw=weight], strata(states)
Sampling weights: weight
VCE: linearized
Single unit: missing
Strata 1: states
Sampling unit 1: caseid
FPC 1: <zero>
.
. bsweights bs_, n(-1) reps(50) seed(1000)
# of PSUs to bootstrap is not positive in some strata
r(194);

Comment