Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: re: obtaining overlapping ROC graphs

From   Roger Newson <>
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:

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 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

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

* For searches and help try:

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