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

Re: st: Speed of ROC analysis

From   Roger Newson <>
Subject   Re: st: Speed of ROC analysis
Date   Mon, 14 Jul 2003 21:34:38 +0100

At 14:57 14/07/03 -0400, James Shaw wrote:
Dear Statalist:

Has anyone developed faster versions of roctab or roccomp (using DeLong et
al.'s estimated standard errors)?  The versions available in Stata 8 (as
well as in earlier versions of Stata) run very slowly when used with large
samples (e.g., 500-1000 observations).  For example, in simulations I have
been performing, it generally takes about 24 hours to complete 1000
repetitions of roccomp in samples consisting of 1000 observations each.  I
suspect the problem is related to the fact that all possible pairwise
comparisons are being made between scores for true-positive and
true-negative subjects.

I think James's problem is indeed that the calculation of the ROC curve uses loops over observations. This is definitely a problem with my -somersd- package, downloadable from SSC, which calculates Somers' D, which is related to the ROC area by the formula D=2A-1 (where D is Somers' D and A is the ROC area). I plan in the long run to write a successor package to -somersd- using plugins, but this is not expected to happen immediately. I think ROC curve calculation might equally be improved by using plugins, but I don't know if StataCorp plan to do this soon.

More about the -somersd- package, and its connection with ROC areas, can be found in a Stata Journal article (Newson, 2002). A pre-publication draft of this article can be downloaded from my website at

which is accessible either using a browser or using the Stata -net- command.



Newson R. Parameters behind "nonparametric" statistics: Kendall's tau, Somers' D and median differences. The Stata Journal 2002; 2(1):45-64.

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–2022 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index