ROC and AUC | R Documentation |

Receiver operating curve and area under the curve.

auc(group, preds, roc = FALSE, cutoffs = NULL)

`group` |
A numerical vector with the predicted values of each group as 0 and 1. |

`preds` |
The predicted values of each group. |

`roc` |
If you want the ROC to appear set it to TRUE. |

`cutoffs` |
If you provide a vector with decreasing numbers from 1 to 0 that will be used for the ROC, otherwise, the values from 1 to 0 with a step equal to -0.01 will be used. |

The ara under the curve is returned. The user has the option of getting the receiver operating curve as well.

A list including:

`cutoffs` |
The cutoff values. |

`sensitivity` |
The sensitivity values for each cutoff value. |

`specificity` |
The specificity value for each cutoff value. |

`youden` |
The pair of of 1- specificity and sensitivity where the Youden's J appears on the graph and the Youden index which is defined as the maximum value of sensitivity - specificity + 1. |

`auc` |
The area under the curve, plus a circle with the point where Youden's J is located. If "roc" is set to FALSE, this is the only item in the list to be returned. |

Michail Tsagris

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr

```
bbc, testIndLogistic
```

g <- rbinom(150, 1, 0.6) f <- rnorm(150) auc(g, f, roc = FALSE)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.