**[R] lroc** -- Compute area under ROC curve and graph the curve

__Syntax__

**lroc** [*depvar*] [*if*] [*in*] [*weight*] [**,** *options*]

*options* Description
-------------------------------------------------------------------------
Main
**all** compute area under ROC curve and graph curve for
all observations
__nog__**raph** suppress graph

Advanced
**beta(***matname***)** row vector containing model coefficients

Plot
*cline_options* change look of the line
*marker_options* change look of markers (color, size, etc.)
*marker_label_options* add marker labels; change look or position

Reference line
__rlop__**ts(***cline_options***)** affect rendition of the reference line

Add plots
**addplot(***plot***)** add other plots to the generated graph

Y axis, X axis, Titles, Legend, Overall
*twoway_options* any options other than **by()** documented in **[G-3]**
*twoway_options*
-------------------------------------------------------------------------
**fweight**s are allowed; see weight.
**lroc** is not appropriate after the **svy** prefix.

__Menu__

**Statistics > Binary outcomes > Postestimation >** **ROC curve after**
**logistic/logit/probit/ivprobit**

__Description__

**lroc** graphs the ROC curve and calculates the area under the curve.

**lroc** requires that the current estimation results be from **logistic**,
**logit**, **probit**, or **ivprobit**.

__Options__

+------+
----+ Main +-------------------------------------------------------------

**all** requests that the statistic be computed for all observations in the
data, ignoring any **if** or **in** restrictions specified by the estimation
command.

**nograph** suppresses graphical output.

+----------+
----+ Advanced +---------------------------------------------------------

**beta(***matname***)** specifies a row vector containing model coefficients. The
columns of the row vector must be labeled with the corresponding
names of the independent variables in the data. The dependent
variable *depvar* must be specified immediately after the command name.
See *Models other than the last fitted model* in **[R] lroc**.

+------+
----+ Plot +-------------------------------------------------------------

*cline_options*, *marker_options*, and *marker_label_options* affect the
rendition of the ROC curve -- the plotted points connected by lines.
These options 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]** *cline_options*, **[G-3]** *marker_options*, and **[G-3]**
*marker_label_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*).

__Example__

Setup
**. webuse lbw**

Fit logistic regression to predict low birth weight
**. logistic low age lwt i.race smoke ptl ht ui**

Graph ROC curve and calculate area under the curve
**. lroc**

__Stored results__

**lroc** stores the following in **r()**:

Scalars
**r(N)** number of observations
**r(area)** area under the ROC curve