[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

# Re: st: re: obtaining overlapping ROC graphs

 From Roger Newson To statalist@hsphsun2.harvard.edu Subject Re: st: re: obtaining overlapping ROC graphs Date Tue, 27 Aug 2002 20:38:59 +0100

```At 12:31 27/08/02 -0400, Devendra Amre wrote:
```
Hi,

I was wondering if it is possible to plot 2 overlapping graphs (not 2 graphs on the same page as is possible with the statagraph combine command) each representating different regression equations (example one in sample another out-of-sample). I wish to compare 2 such ROC curves.

Devendra does not state how the data are formatted. However, if the false positive rate is -fpr-, and the true positive rate (ie sensitivity) is -tpr-, and the indicator for being in-sample is -insamp- (equal to 1 if in-sample, 0 if out of sample), then Devendra might write

gene tpr0=tpr if insamp==0
gene tpr1=tpr if insamp==1
graph tpr0 tpr1 fpr,s(oo) c(LL)

and the graph would then have 2 lines, 1 for -tpr1- against -fpr- and one for -tpr0- against -fpr-. The general principle is that Stata likes to graph multiple Y-variables against a single X-variable. If there are multiple groups, and you want Stata to draw multiple lines (one per group), then Stata likes you to create multiple Y-variables (one per group), and plot them against the X-variable.

I hope this helps.

Roger

--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Email: roger.newson@kcl.ac.uk

Opinions expressed are those of the author, not the institution.

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/

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