Statalist


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

st: Creating a loop for bsample


From   Farasat Bokhari <[email protected]>
To   [email protected]
Subject   st: Creating a loop for bsample
Date   Fri, 24 Jul 2009 12:01:56 -0700 (PDT)

Hi -

I need to create replicas of bsample followed by probit and save the coefficients.  Can some one show me how to create the loop and save results? Specifically, i need to run the following command 500 time and save the coefficients of the probit:


#delimit;
use nschschlaws2003;
gen wt2 = weight;
gen myflag1 = 0;
replace myflag1 = 1 if sample1 == 1 & pubsch == 1;

/* the loop part beging below:*/

#delimit;
bsample 6700 if myflag1 == 1, weight(wt2);

#delimit;
probit adhd assistance rewards sanctions
       gender age black othrace hispanic family2 family3 family4
       poverty1-poverty7 edu1 edu2 conachive1 conachive2 schcalls1 schcalls2
        [fw=wt2];

replace wt2 = weight;

/* end of what i need to loop */

Thanks in advance.
farasat bokhari


      

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index