*! version 1.1.5 15dec2022

Title

dtroc -- ROC Analysis & Optimal Cutoff Point

Syntax

dtroc refvar classvar [if] [in] [, options]

st(type) study type; valid values are:

cs Cross-sectional (default)

cc Case-control

ic(#) code of illness group; default is ic(1)

non-illness group: codes not equal to ic

noinc by default, illness increases classvar variable;
if illness decreases classvar variable, specify noinc

prev(#) prevalence of illness in the population; by default: sample prevalence

cost(#) ratio false-negative/positive cost (FNC/FPC); default is cost(1)

detail show & save to a file details on sensitivity/specificity for each cutoff point

using(filename) filename to store the cutoff points data created by the detail option; by default a dataset named
dtroc_cutoff is saved in the current (working) directory

noreplace if filename exists, do not replace; by default existing datasets are replaced

graph graph sensitivity and specificity depending on each cutpoint

level(#) confidence level (%); default is level(95)

nst(string) name of the study (label)

Description

Receiver Operating Characteristic (ROC) analysis and Optimal Cutoff Point.

refvar and classvar variables must be numeric. The reference variable indicates the true state of the
observation, such as diseased and nondiseased. By default the illness code is 1, see the ic() option to
change this behaviour. The rating or outcome of the diagnostic test is saved in classvar. By default higher values
indicate higher risk, see noinc.

dtroc performs nonparametric ROC analyses, and by default shows the area under the roc curve (AUC) and the optimal cutoff
point, as defined by Zweig & Campbell. Optimal cutoff points for maximum efficiency and based on ROC curve are also
computed. Optionally it is possible to show and save to a file a detailed table with sensibility, specificity, efficiency, Youden index,
likelihood ratios and prevalence values for each cutpoint, see options detail and using. Option graph creates a graph of
sensibility and specificity depending on each cutoff point.

You can click here to pop up a dialog or type db dtroc.

Execute net from http://metodo.uab.cat/stata for install.

It is important to keep the commands updated. Execute adoupdate dtroc, update to update the dtroc command.

Execute adoupdate, update to update all the user-written commands.

If you find any bugs or want to suggest any improvements, please send an e-mail to: leam@uab.cat.

Examples

. use http://metodo.uab.cat/stata/GlucoseDiabetes.dta

. dtroc Diabetes Glucose, st(cs) detail graph

. dtroc Diabetes Glucose, st(cc) detail using(C:\test.dta)

. dtroc Diabetes Glucose, st(cc) prev(30)

Stored results

The command stores the following in r():

Scalars

r(N) valid number of observations

r(level) confidence level for confidence intervals

r(auc) area under the ROC curve

r(lb_auc) lower bound of AUC CI

r(ub_auc) upper bound of AUC CI

r(prev) prevalence (sample or provided)

Matrices

r(efficiency) optimal cutoff point(s) for maximum efficency

r(roc) optimal cutoff point(s) based on ROC curve

r(ratio) optimal cutoff point(s) for FNcost/FPcost ratio and prevalence
(st(cs) and st(cc) with prev option only)

r(hypothetical) optimal cutoff points for hypothetical prevalence and FNcost/FPcost ratio

Version

Version 1.1.5 -- 15 December 2022

Authors

JM.Doménech

Programmer: R.Sesma

Laboratori d'Estadística Aplicada

Universitat Autònoma de Barcelona

leam@uab.cat

Vancouver reference

Doménech JM. ROC Analysis & Optimal Cutoff Point: User-written command dtroc for Stata [computer program].

V1.1.5. Bellaterra: Universitat Autònoma de Barcelona; 2022.

Available executing from Stata: net from http://metodo.uab.cat/stata

References

Doménech JM. Fundamentos de Diseño y Estadística. UD 3. Teoría y cálculo de probabilidades.
Pruebas diagnósticas. 16ª ed. Barcelona: Signo; 2015.

Zweig MH, Campbell C. Receiver-Operating Characteristic (ROC) Plots: A Fundamental Evaluation Tool in Clinical Medicine.
Clin Chem. 1993;39:561-77. [Erratum in Clin Chem. 1993;39(8):1589].