**[R] rocfit** -- Parametric ROC models

__Syntax__

**rocfit** *refvar* *classvar* [*if*] [*in*] [*weight*] [**,** *rocfit_options*]

*rocfit_options* Description
-------------------------------------------------------------------------
Model
__cont__**inuous(***#***)** divide *classvar* into *#* groups of approximately
equal length
__g__**enerate(***newvar***)** create *newvar* containing classification groups

SE
**vce(***vcetype***)** *vcetype* may be **oim** or **opg**

Reporting
__l__**evel(***#***)** set confidence level; default is **level(95)**

Maximization
*maximize_options* control the maximization process; seldom used
-------------------------------------------------------------------------
**fp** is allowed; see prefix.
**fweight**s are allowed; see weight.
See **[R] rocfit postestimation** for features available after estimation.

__Menu__

**Statistics > Epidemiology and related > ROC analysis >** **Parametric ROC**
**analysis without covariates**

__Description__

**rocfit** fits maximum-likelihood ROC models assuming a binormal
distribution of the latent variable.

The two variables *refvar* and *classvar* must be numeric. The reference
variable indicates the true state of the observation, such as diseased
and nondiseased or normal and abnormal, and must be coded as 0 and 1.
The rating or outcome of the diagnostic test or test modality is recorded
in *classvar*, which must be at least ordinal, with higher values
indicating higher risk.

See **[R] roc** for other commands designed to perform receiver operating
characteristic (ROC) analyses with rating and discrete classification
data.

__Options__

+-------+
----+ Model +------------------------------------------------------------

**continuous(***#***)** specifies that the continuous *classvar* be divided into *#*
groups of approximately equal length. The option is required when
*classvar* takes on more than 20 distinct values.

**continuous(.)** may be specified to indicate that *classvar* be used as
it is, even though it could have more than 20 distinct values.

**generate(***newvar***)** specifies the new variable that is to contain values
indicating the groups produced by **continuous(***#***)**. **generate()** may be
specified only with **continuous()**.

+----+
----+ SE +---------------------------------------------------------------

**vce(***vcetype***)** specifies the type of standard error reported. *vcetype* may
be either **oim** or **opg**; see **[R] ***vce_option*.

+-----------+
----+ Reporting +--------------------------------------------------------

**level(***#***)**; see **[R] estimation options**.

+--------------+
----+ Maximization +-----------------------------------------------------

*maximize_options*: __dif__**ficult**, __tech__**nique(***algorithm_spec***)**, __iter__**ate(***#***)**,
[__no__]__lo__**g**, __tr__**ace**, __grad__**ient**, **showstep**, __hess__**ian**, __showtol__**erance**,
__tol__**erance(***#***)**, __ltol__**erance(***#***)**, __nrtol__**erance(***#***)**, __nonrtol__**erance**, and
**from(***init_specs***)**; see **[R] maximize**. These options are seldom used.

Setting the optimization type to **technique(bhhh)** resets the default
*vcetype* to **vce(opg)**.

__Examples__

Setup
**. webuse hanley**

Fit a smooth ROC curve assuming a binormal model
**. rocfit disease rating**

Divide **rating** into 10 groups
**. rocfit disease rating, cont(10)**

**group** is to contain values indicating groups produced by **cont()**
**. rocfit disease rating, cont(10) generate(group)**

Use **rating** as is
**. rocfit disease rating, cont(.)**

__Stored results__

**rocfit** stores the following in **e()**:

Scalars
**e(N)** number of observations
**e(k)** number of parameters
**e(k_eq)** number of equations in **e(b)**
**e(k_eq_model)** number of equations in overall model test
**e(k_dv)** number of dependent variables
**e(df_m)** model degrees of freedom
**e(ll)** log likelihood
**e(chi2_gf)** goodness-of-fit chi-squared
**e(df_gf)** goodness-of-fit degrees of freedom
**e(p_gf)** p-value for goodness-of-fit test
**e(area)** area under the ROC curve
**e(se_area)** standard error for the area under the ROC curve
**e(deltam)** **delta(m)**
**e(se_delm)** standard area for **delta(m)**
**e(de)** **d(e)** index
**e(se_de)** standard error for **d(e)** index
**e(da)** **d(a)** index
**e(se_da)** standard error for **d(a)** index
**e(rank)** rank of **e(V)**
**e(ic)** number of iterations
**e(rc)** return code
**e(converged)** **1** if converged, **0** otherwise

Macros
**e(cmd)** **rocfit**
**e(cmdline)** command as typed
**e(depvar)** *refvar* and *classvar*
**e(wtype)** weight type
**e(wexp)** weight expression
**e(title)** title in estimation output
**e(chi2type)** **GOF**; type of model chi-squared test
**e(vce)** *vcetype* specified in **vce()**
**e(vcetype)** title used to label Std. Err.
**e(opt)** type of optimization
**e(which)** **max** or **min**; whether optimizer is to perform
maximization or minimization
**e(ml_method)** type of **ml** method
**e(user)** name of likelihood-evaluator program
**e(technique)** maximization technique
**e(properties)** **b V**

Matrices
**e(b)** coefficient vector
**e(ilog)** iteration log (up to 20 iterations)
**e(gradient)** gradient vector
**e(V)** variance-covariance matrix of the estimators

Functions
**e(sample)** marks estimation sample