Description Usage Arguments Details Value

View source: R/LogisticRegression.R

A method of judging the predictive performance of a model by plotting and/or averaging the probability of predicting the positive class correctly, over multiple thresholds. See 'Details'.

1 |

`lrfit` |
an object of class " |

`newdata` |
an optional data frame to predict from. If ignored, the default data frame is that used to fit the original model. |

`plot` |
logical; if |

`len` |
optional; number of different thresholds to use. |

A positive prediction from a logistic regression model is made when

*
f(x; β) := X β ≥ t.
*

where *t* is some threshold. See `predict.lr`

for details. A different threshold
*t_0* will yield a different set of predictions. For a given sequence *t_j in [min(t), max(t)]*,
for *j=1,…,J*, the True Positive Rate (TPR) and False Positive Rate (FPR) can be calculated as

*
TPR(j) = ∑ I(f(x_i;β) ≥q t_j)/∑ I(y_i = 1),
*

*
FPR(j) = \frac{∑ I(f(x_i;β) < t_j)}{∑ I(y_i = 1)}.
*

The ROC curve is plotted from the pairs *(FPR(j), TPR(j))*, and the AUC is calculated as the area under this curve, i.e.

*
AUC = \int_{j=1}^J TPR(FPR(j))dj.
*

the AUC value, and a plot of the ROC curve if `plot=TRUE`

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.