mewtoThresh: Optimal threshold calculation using weighted Youden's...

Description Usage Arguments Details Author(s) Examples

View source: R/mewto.R

Description

This function calculates the optimal threshold according to a weighted version of Youden's J-statistic.

Usage

1
mewtoThresh(actuals, probabilities, weight = 0.5)

Arguments

actuals

Data of factor type with two levels: "yes" for positive and "no" for negative.

probabilities

Data of numeric type which should represent the probabilities of realization of the positive category.

weight

A numeric value corresponding to the importance attributed to sensitivity, or formulated differently, to the maximization of the true positives rate. This value should be in the interval 0 ; 1.

Details

In the calculation of the optimal threshold, a weighted version of Youden's J-statistic (Youden, 1950) is employed. The optimal cut-off is the threshold that maximizes the distance to the identity (diagonal) line. The function maximizes the metric (w * sensitivity + (1 - w) * specificity), where w is the "weight" parameter. Metrics will automatically be recalculated based on the user's selection.

Author(s)

Alexandru Monahov, alexandrudezv@gmail.com

Examples

1
2
mewtoThresh(actuals, probabilities, weight = 0.5) # Original Youden's J-statistic.
mewtoThresh(actuals, probabilities, weight = 0.9) # Favor sensitivity greatly over specificity.

alexandrumonahov/mewto documentation built on March 21, 2021, 4:36 a.m.