**[R] lsens** -- Graph sensitivity and specificity versus probability cutoff

__Syntax__

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

*options* Description
-------------------------------------------------------------------------
Main
**all** graph all observations in the data
__genp__**rob(***varname***)** create variable containing probability cutoffs
__gense__**ns(***varname***)** create variable containing sensitivity
__gensp__**ec(***varname***)** create variable containing specificity
**replace** overwrite existing variables
__nog__**raph** suppress the graph

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

Plot
*connect_options* affect rendition of the plotted points connected by
lines

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.
**lsens** is not appropriate after the **svy** prefix.

__Menu__

**Statistics > Binary outcomes > Postestimation > Sensitivity/specificity**
**plot**

__Description__

**lsens** graphs sensitivity and specificity versus probability cutoff and
optionally creates new variables containing these data.

**lsens** 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.

**genprob(***varname***)**, **gensens(***varname***)**, and **genspec(***varname***)** specify the
names of new variables created to contain, respectively, the
probability cutoffs and the corresponding sensitivity and
specificity.

**replace** requests that existing variables specified for **genprob()**,
**gensens()**, or **genspec()** be overwritten.

**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] lsens**.

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

*connect_options* affect the rendition of the plotted points connected by
lines; see *connect_options* in **[G-2] graph twoway scatter**.

+-----------+
----+ 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 sensitivity and specificity against probability cutoff
**. lsens**

__Stored results__

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

Scalars
**r(N)** number of observations