Stata 15 help for lsens

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


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

options Description ------------------------------------------------------------------------- Main all graph all observations in the data genprob(varname) create variable containing probability cutoffs gensens(varname) create variable containing sensitivity genspec(varname) create variable containing specificity replace overwrite existing variables nograph 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 ------------------------------------------------------------------------- fweights are allowed; see weight. lsens is not appropriate after the svy prefix.


Statistics > Binary outcomes > Postestimation > Sensitivity/specificity plot


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.


+------+ ----+ 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).


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

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index