*! version 1.0.0 29Dec2015

Title

roctabi -- Nonparametric ROC analysis using summarized data

Syntax

roctabi #1_1 #1_2 [...] \ #2_1 #2_2
[...] [, options]

options

Main
rowlabel(string) create a label for row variable; default label is row

collabel(string) create label for column variable; default label is col

lorenz report Gini and Pietra indices

binomial calculate exact binomial confidence intervals

detail show details on sensitivity/specificity for each
cutpoint

bamber calculate standard errors by using the Bamber
method

hanley calculate standard errors by using the Hanley
method

graph graph the ROC curve

norefline suppress plotting the 45-degree reference line

summary report the area under the ROC curve

specificity graph sensitivity versus specificity

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

Plot
plotopts(plot_options) affect
rendition of the ROC curve

Reference line
rlopts(cline_options) affect rendition of the reference
line

Add plots
"addplot(addplot_option:plot)" add other plots to generated
graph

Y axis, X axis, Titles, Legend, Overall
twoway_options any options other than by() documented
in [G-3] twoway_options

plot_options

Description

roctabi is the immediate form of the official Stata command [R] roctab. roctabi is used to perform receiver operating characteristic
(ROC) analyses with rating and discrete classification data.

In roctabi, row values indicate the true (binary) state of the observation, such as diseased and nondiseased, or normal and abnormal. Column values represent
the rating or outcome of the diagnostic test, or predicted class from a classification algorithm, and must be at least ordinal, with higher values indicating higher risk.
As such, the data must be entered in a 2 X k format representing the reference [row] variable, and classifier [column] variable. Rows are separated by '\'.

roctabi performs nonparametric ROC analyses. By default, roctabi calculates the area under the ROC curve, and displays the data in tabular form. Optionally,
roctabi can plot the ROC curve, and produce Lorenz-like plots.

See [R] roctab for the non-immediate form of roctabi and [R] rocfit for a command that fits maximum-likelihood ROC models.

Options

Main

rowlabel(string) creates a label for the row (reference) variable; default label is row.

collabel(string) creates a label for the column (classification) variable; default label is column.

lorenz specifies that the Gini and Pietra indices be reported.
Optionally, graph will plot the Lorenz-like curve.

binomial specifies that exact binomial confidence intervals be
calculated.

detail outputs a table displaying the sensitivity, specificity, the
percentage of subjects correctly classified, and two likelihood ratios for
each possible cutpoint of classvar.

bamber specifies that the standard error for the area under the
ROC curve be calculated using the method suggested by
Bamber (1975).
Otherwise, standard errors are obtained as suggested by
DeLong, DeLong, and Clarke-Pearson (1988).

hanley specifies that the standard error for the area under the
ROC curve be calculated using the method suggested by
Hanley and McNeil (1982).
Otherwise, standard errors are obtained as suggested by
DeLong, DeLong, and Clarke-Pearson (1988).

graph produces graphical output of the ROC curve. If lorenz
is specified, the graphical output of a Lorenz-like curve will be produced.

norefline suppresses plotting the 45-degree reference line
from the graphical output of the ROC curve.

summary reports the area under the ROC curve, its standard error,
and its confidence interval. If lorenz is specified, Lorenz indices are
reported. This option is needed only when also specifying graph.

specificity produces a graph of sensitivity versus specificity
instead of sensitivity versus (1 - specificity). specificity implies
graph.

level(#) specifies the confidence level, as a percentage,
for the confidence intervals. The default is level(95) or as set by
set level.

Plot

plotopts(plot_options)
affects the rendition of the plotted ROC curve -- the curve's plotted points
connected by lines. The plot_options can affect the size and color of
markers, whether and how the markers are labeled, and whether and how the
points are connected; see [G-3] marker_options,
[G-3] marker_label_options, and [G-3] cline_options.

Reference line

rlopts(cline_options) affects the rendition of the reference line; see
[G-3] cline_options.

Add plots

addplot(plot) provides a way to add other plots to the
generated graph; see [G-3] addplot_option.

Y axis, X axis, Titles, Legend, Overall

twoway_options are any of the options documented in
[G-3] twoway_options, excluding by(). These include options for
titling the graph (see [G-3] title_options) and for saving the
graph to disk (see [G-3] saving_option).

Examples

Nonparametric ROC analysis example

A 2 x 5 table (produces the same results as those in the [R] roctab help file).

. roctabi 33 6 6 11 2 \ 3 2 2 11 33, row(true disease status of subject) col(classification value assigned by reviewer)

. roctabi 33 6 6 11 2 \ 3 2 2 11 33, row(true disease status of subject) col(classification value assigned by reviewer) graph summary

. roctabi 33 6 6 11 2 \ 3 2 2 11 33, row(true disease status of subject) col(classification value assigned by reviewer) lorenz graph

. roctabi 33 6 6 11 2 \ 3 2 2 11 33, row(true disease status of subject) col(classification value assigned by reviewer) detail

Stored results

roctabi stores the following in r():

Scalars

r(N) number of observations

r(se) standard error for the area under the ROC curve

r(lb) lower bound of CI for the area under the ROC curve

r(ub) upper bound of CI for the area under the ROC curve

r(area) area under the ROC curve

r(pietra) Pietra index

r(gini) Gini index

References

Bamber, D. 1975. The area above the ordinal dominance graph and the area below
the receiver operating characteristic graph.
Journal of Mathematical Psychology 12: 387-415.

DeLong, E. R., D. M. DeLong, and D. L. Clarke-Pearson. 1988. Comparing the
areas under two or more correlated receiver operating characteristic curves:
A nonparametric approach. Biometrics 44: 837-845.

Hanley, J. A., and B. J. McNeil. 1982. The meaning and use of the area under
a receiver operating characteristic (ROC) curve. Radiology 143: 29-36.

Citation of roctabi

roctabi is not an official Stata command. It is a free contribution
to the research community, like a paper. Please cite it as such:

Linden, Ariel (2016). roctabi: Stata module for performing nonparametric ROC analysis using summarized data.
http://ideas.repec.org/c/boc/bocode/s458131.html

Author

Ariel Linden

President, Linden Consulting Group, LLC

alinden@lindenconsulting.org

http://www.lindenconsulting.org

Also see

Online: roctab, classtabi (if installed) looclass (if installed)