<>
You also asked Stata for "r(area)", although your "prog" returns "r(roc)"...
Here is a possible solution:
******
capt pr drop myprog
clear*
set obs 1000
//covariates
gen x1=rchi2(2)
gen x2=rnormal()
gen x3=runiform()
//DGP
gen y=runiform()< /*
*/ invlogit(1+0.3*x1+ /*
*/ 0.6*x2+0.5*x3)
program define myprog, rclass
preserve
bsample 1000
logistic y x1 x2 x3
qui lroc, nograph
return scalar roc=r(area)
restore
end
simulate roc=r(roc), /*
*/ reps(100): myprog
list, noobs
******
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Andrzej
Niemierko
Gesendet: Donnerstag, 3. September 2009 18:08
An: Stata
Betreff: st: simulate using lroc
What's the reason that the below -simulate command creates all missing
values for the scalar roc? Also, is it possible to suppress plotting of the
ROC curves after each -lroc?
Andrzej
program define prog, rclass
preserve
bsample
logistic y x1 x2 x3
lroc
return scalar roc=r(area)
restore
end
simulate roc=r(area), reps(100): prog
The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.
*
* 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/
*
* 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/