Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: problem with bsample


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: problem with bsample
Date   Thu, 15 Apr 2010 08:43:43 -0700 (PDT)

--- On Thu, 15/4/10, Woolton Lee wrote:
> We are using the following command (essentially)
> 
> bsample , strata(tx) cluster(patzip)
> 
> this stratifies the sampling by treatment and control group
> and clusters the draws by patient zip code.  However, for
> one of our CA markets we are finding that the bsample obtains
> a draw that contains no observations from the treatment group
> - (which given the command above doesn't make any sense). 
> This particular market has roughly 95% of its observations in
> the comparison group and 5% of observations in the treatment
> group.  But given that bsample is supposed to be drawing
> its samples stratified by treatment/comparison group this
> still should not happen.  

I can't recreate that problem with the existing example datasets.
In the example below the proportion of foreign cars is constant
over samples as one would expect. 

*------------ begin example --------------
sysuse auto, clear
sum foreign

tempname memhold
tempfile results
postfile `memhold' prop using `results'
		
forvalues i = 1/1000 {
	bsample, strata(foreign)
	sum foreign, meanonly
	post `memhold' (`r(mean)')
}
postclose `memhold'
use `results' , clear
sum
*------------- end example ---------------

One thing I can imagine is that some observations get ignored
by an estimation command after -bsample- due to misssing values 
on other variables.  Say you bootstrapping a regression of some
dependent variable on your treatment and one or more control
variables. It might just happen that you draw a booststrap 
sample where all treated individuals have at least one missing
value on one of the other variables. In that case it would look
like there were no treated individuals in that bootstrap sample.

If that is not the case then you'll probably want to contact
Stata's tech support directly:
<http://www.stata.com/support/tech-support/tech2.html>

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


      

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index