Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: RE: Can't store estimates after logistic regression

 From Edouard Betsem To Steve Samuels Subject Re: st: RE: Can't store estimates after logistic regression Date Sun, 30 Jun 2013 10:06:18 -0700

Best

Edouard BETSEM, MD, PhD

On 30/06/2013 04:28, Steve Samuels wrote:

Edouard:

Please do not send me private messages asking for advice, except as the Statalist FAQ provide (i.e. for paid consultation). I'm not familiar with
the other two commands.

Steve
On Jun 30, 2013, at 2:26 AM, Edouard Betsem wrote:

Thanks, I tried both models and they are working.
I also ran a -rocreg- and -rocregplot- model that returned a p value of 0.08
The roccomp model returned a p value of 0.008

Which one should I consider here?

Edouard

On 29/06/2013 09:33, Steve Samuels wrote:
Just a thought:

Since you have models with single classification variables,
-logistic- isnt't strictly necessary. You can use
-roccomp- on any set of predictors, as long as higher
values of each are associated with higher risk of the
event.

. corr foreign mpg
. corr foreign turn //note negative correlation
. gen rturn = -turn  // reverse turn
. roccomp foreign mpg rturn

Higher values of predictions after -logistic- are always
associated with increased risk, so no reversals
are needed.

---------------------------

Steve

Ed:

You probably want something like this:

. sysuse auto, clear
. logistic foreign mpg
. predict p1
. logistic foreign turn
. predict p2
. roccomp foreign p1 p2

Steve

On Jun 28, 2013, at 7:40 PM, Edouard Betsem wrote:

Thanks Steve, I understand it better now. I got to go through some more readings.
Ed

On 28/06/2013 15:54, Steve Samuels wrote:
Eduoard:

If you do

. des _est_mod1

you will see the variable label: "esample() from estimates store".
esample() just records whether the observation was used in the analysis

It  not the kind of variable needed by -roccomp-, which has syntax:

. rocommp refvar classvar

According to the Manual:

"The two variables refvar and classvar must be numeric. The reference
variable indicates the true state of the observation, such as diseased
and nondiseased or normal and abnormal, and must be coded as 0 and 1.
The rating or outcome of the diagnostic test or test modality is
recorded in classvar, which must be at least ordinal, with higher values
indicating higher risk."

In short -estimates- is irrelevant for running -roccomp-. I suggest that you
reread the manual entry for -roccomp-.

Steve

On Jun 28, 2013, at 5:54 PM, Edouard Betsem wrote:

It's still not working.
by is not allowed here and using separate returned this error code

r(111);

I'm wondering if "roccomp" can be used with "estimates"

I've even renamed the _est_mod1 to mod1. It's on the editor table but I don't know why Stata can't find it

logistic tma whoall
est store mod1
rename _est_mod1 mod1

logistic tma study_2
est store mod2
rename _est_mod2 mod2
roccomp tma _est_mod1 _est_mod2, graph summary

the estimates variables return the value "1" for all my observations.
Wish someone can help me solve this.
Thanks

Edouard BETSEM, MD, PhD

On 28/06/2013 00:48, Bley N'Dede wrote:
I am not sure but may be you should try something like

roccomp _est_mod1 _est_mod2, graph summary by(dis)
________________________________________
From: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] on behalf of Edouard Betsem [edouardbetsem@gmail.coou should try m]
Sent: Friday, June 28, 2013 7:29 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: Can't store estimates

Hi,
I'm trying to use roccomp commande to compare AUC for two logistic
models. but stata won't store my estimates.

here are the commande lines.

* all counts with binary
logistic dis ref
est store mod1

logistic dis stud
est store mod2
roccomp dis mod1 mod2, graph summary

and this is the message i have:

r(111);

does anyone know the reason for this?
Best
Edouard

--
Edouard BETSEM, MD, PhD

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/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/faqs/resources/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/faqs/resources/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/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/