[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: weighting in bootstrapping
Peter Lachenbruch <firstname.lastname@example.org> asks about weights and the
> I have a stratified sample and have computed a statistic within each
> stratum. It is a ratio of some quantities and there is interest to see if
> the ratio is 1. I want to combine these estimates over the strata to get a
> population wide estimate and a test to see if the combined ratio is 1. The
> bsample command allows weights, but I am interested in determining if it is
> permissible to issue the command
> bootstrap "statacommand y [w=freq]" _b[outvar],reps(1000) bca etc.
> That is, are weights OK in the bootstrapped command? And do they operate as
> if I had a total of N=sum(stratum frequencies) observations, or do they
> sample the entire stratum?
> I don't have the data in hand yet, so I can't try it out and find out
The -bsample- option has a -weight()- option that allows the user to supply a
variable name (new or existing), which it will then put the bootstrap
replicate weights. These weights are frequency weights, identifying which
observations are in the bootstrap sample, and how many times. This is a
programmer's tool, for those who are implementing their own bootstrap loop.
We currently discourage using weights with -bootstrap-. In fact, unless the
command you are running retrieves weights in a non-standard way (such as
-svyratio-), -bootstrap- will complain when weights are present in the command
it will be running. For example,
. sysuse auto, clear
. bootstrap "sum turn [fw=mpg]" r(mean)
weights not allowed
The reason for this is that -bsample- implements only one of the following
simple random sampling (SRS)
stratified and clustered SRS
Weighted sampling is not currently implemented.
* For searches and help try: