Learn R Programming

MDMA (version 2.0.0)

roc: Receiver operator characteristic

Description

Calculate ROC curve statistics.

[Stable]

Usage

roc(response, group, levels, state)

Value

Returns a list with the following elements:

data

data.frame with two columns, containing the response and group variable for each level in levels without missings.

rdf

ROC dataframe. This is a data.frame containing sensitivity and specificity values for all threshold values.

auc

Area under the ROC curve.

response

Response variable from input data.

group

Group variable from the input data.

levels

Used levels.

state

State level.

Arguments

response

response variable for which thresholds will be calculated.

group

group variable.

levels

relevant levels of group variable. Should have length 2.

state

state level of levels..

Author

Mathijs Deen

Examples

Run this code
roc(QIDS$QIDS, QIDS$depression, c("No","Yes"), "Yes") |>
  plot(ylim.3=c(0,.2))

Run the code above in your browser using DataLab