Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: weighting in bootstrapping


From   [email protected] (Jeff Pitblado, Stata Corp.)
To   [email protected]
Subject   Re: st: weighting in bootstrapping
Date   Tue, 09 Sep 2003 15:55:22 -0500

Peter Lachenbruch <[email protected]> asks about weights and the
-bootstrap- command:

> 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
> directly

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
	r(101);

The reason for this is that -bsample- implements only one of the following
sampling designs:

	simple random sampling (SRS)
	stratified SRS
	clustered SRS
	stratified and clustered SRS

Weighted sampling is not currently implemented.

--Jeff
[email protected]
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index