ROC curve and other statistics for any classification method
rocss dep_var prob_var [if exp] [in range] [, ncut(#) savedata(filename) graph replace]
Description
rocss calculates sensitivity, specificity, cumulative area under the ROC cur > ve and percentage of subjects correctly classified at user-specified probability cutoffs > .
dep_var is the binary outcome variable coded 0, 1.
prob_var contains the estimated probabilities that dep_var==1.
An example with four observations:
id dep_var prob_var 1 0 0.2 2 1 0.8 3 1 0.9 4 0 0.3
Remarks
Unlike lsens, rocss is not a post-estimation command and allows the user > to set arbitrary probability cutoffs. However, if used on predicted probabilities derived by logistic, logit or > probit, rocss represents a flexible alternative to lsens.
Options
ncut(#) specifies the number equally spaced probability intervals in the ra > nge 0, 1. The number of corresponding probability cutoffs will be (# + 1), at values 0, 1/#, 2/#, ..., 1. > The default is 10 equally spaced intervals. savedata(filename) specifies the name of a new dataset created to contain t > he probability cutoffs and corresponding sensitivity, specificity, cumulative area under t > he ROC curve and the percentage of subjects correctly classified. The dataset is saved in the current > directory.
graph graphs sensitivity versus 1-specificity (help for lroc) calculated at > each probability cutoff. replace requests that if the dataset specified in savedata(filename) alread > y exists, it should be overwritten.
Examples
. webuse lbw, clear . logistic low age lwt smoke ptl ht ui . lstat . lroc, nograph . lstat, cutoff(0.30) . predict p
. rocss low p // compare the results . rocss low p, ncut(20) gr . rocss low p, saved(allsens) . rocss low p, ncut(80) gr saved(allsens) rep Authors
Nicola Orsini, Institute of Environmental Medicine, Karolinska Institutet, Stockholm, Sweden and Institute of Information Science and Technology, National Research Council of Italy, Pisa, Italy.
Matteo Bottai, Arnold School of Public Health, University of South Carolina, Columbia, USA and Institute of Information Science and Technology, National Research Council of Italy, Pisa, Italy.
Support
Nicola Orsini, http://nicolaorsini.altervista.org, Karolinska Institutet, Sweden nicola.orsini@imm.ki.se
Also see
[R] logistic
On-line: help for lroc, lstat, lsens, roc