0
votes

I am currently learning the bootstrapping method on Stata 13.1. I am trying on an example given in the Stata Journal to generate bootstrap weights variables using bsweights. Below is the example given:

use http://www.stata-press.com/data/r11/nhanes2

generate cstrata = floor(sqrt(2*strata-1))

egen upsu = group(strata psu)

svyset upsu [pw=finalwgt], strata(cstrata)

pweight: finalwgt

VCE: linearized

Single unit: missing

Strata 1: cstrata

SU 1: upsu

FPC 1:

bsweights bw, reps(100) n(-1) seed(10101) dots

At this command, I received an error message- option rep() not allowed. What would be the possible cause?

Thank you

1

1 Answers

1
votes

I can't reproduce your error. This runs as expected for me:

use http://www.stata-press.com/data/r11/nhanes2, clear

generate cstrata = floor(sqrt(2*strata-1))
egen upsu = group(strata psu)

svyset upsu [pw=finalwgt], strata(cstrata)

bsweights bw, reps(100) n(-1) seed(10101) dots