Statalist


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

Re: st: simulate


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   stata list <statalist@hsphsun2.harvard.edu>
Subject   Re: st: simulate
Date   Fri, 4 Sep 2009 19:29:53 +0000 (GMT)

--- Andrzej Niemierko wrote:
> How would you do a similar simulation with -estat gof?

*------------ begin example ----------------
sysuse nlsw88, clear
logistic union south grade
est store a   

capture program drop mysim
program define mysim, rclass
    sysuse nlsw88, clear
    bsample
    est restore a	
    estat gof, all
    return scalar chi2=r(chi2)
end

simulate chi2=r(chi2), reps(100): mysim
*-------------- end example ---------------
( For more on how to use examples I sent to statalist see:
http://www.maartenbuis.nl/stata/exampleFAQ.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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index