MathPHP\Statistics\Experiment::likelihoodRatioSS PHP Method

likelihoodRatioSS() public static method

Used to analyze the goodness of a diagnostic tests. https://en.wikipedia.org/wiki/Likelihood_ratios_in_diagnostic_testing sensitivity LL+ = --------------- 1 - specificity 1 - sensitivity LL- = --------------- specificity
public static likelihoodRatioSS ( float $sensitivity, float $specificity ) : array
$sensitivity float
$specificity float
return array [ LL+, LL- ]
    public static function likelihoodRatioSS(float $sensitivity, float $specificity) : array
    {
        if ($sensitivity > 1.0 || $specificity > 1.0) {
            throw new Exception\OutOfBoundsException('Sensitivity and specificity must be <= 1.0');
        }
        // LL+ Positive likelihood ratio
        $LL+ = $sensitivity / (1 - $specificity);
        // LL- Negative likelihood ratio
        $LL− = (1 - $sensitivity) / $specificity;
        return ['LL+' => $LL+, 'LL-' => $LL−];
    }