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

RE: st: simulate

From   Maarten buis <[email protected]>
To   stata list <[email protected]>
Subject   RE: st: simulate
Date   Fri, 4 Sep 2009 15:11:33 +0000 (GMT)

--- Andrzej Niemierko wrote:
> After estimation using -logistic command I can run my little
> program below several times without a problem and getting 
> what I want.
> capture program drop mysim
> program define mysim
>    preserve
>    bsample
>    lroc, nograph
>    restore
> end
> However, when I try to use the -simulation command it looks
> as my model is dropped from memory:

*------------ begin example ----------------
sysuse nlsw88, clear
logit union south grade
matrix b = e(b)

capture program drop mysim
program define mysim, rclass
    sysuse nlsw88, clear
    lroc union, nograph beta(b)
    return scalar area=r(area)

simulate area=r(area), reps(100): mysim
*-------------- end example ---------------
( For more on how to use examples I sent to statalist see: )

Hope this helps,

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


*   For searches and help try:

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