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

Re: st: Creating a loop for bsample

From   Austin Nichols <>
Subject   Re: st: Creating a loop for bsample
Date   Fri, 24 Jul 2009 22:00:47 -0400


On Fri, Jul 24, 2009 at 9:32 PM, Farasat
Bokhari<> wrote:
> Thanks. But I can't use the bootstrap since it does not let me use weights.  The issue is the following:  I have a complex survey design dataset with about 100K obs.  Of these, about 49K satisfy a certain criteria to be the relevant population (children in public schools and within a certain age group, ie. myflag1 == 1).  The main probit tests the impact of certain state laws on an outcome for these children and is positive and significant.  I then create a falsefication test by checking what these laws do to children in a different criteria (pvt. school students to whom the law does not apply) and find that the probit coefficients are not significant.  So far so good.  However, the pvt. school population is very small (about 6,700) and so this could be just a power issue. To test if this is a power issues, I want to select 6,700 obs. from public school population (hence the criteria if myflag1 ==1) and then re-run the original probit on this smaller
>  set.  Since different obs. have different weights associated with them, I want to create the smaller set based on these weights (hence the need for "bsample 6700 if myflag1 == 1, weight(wt2)" and repeat the process about 500 times.
> Best i could tell the bootstrap does not let me specify obs. weights when selecting the sample while the bsample does.  Hence I need to manually loop the code given below. Will follow up on the "post" to see how to save the results but still need to know the syntex for creating the loop.
> fb

*   For searches and help try:

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