Functions & Formulae

Each applied formula has its own function page, with a signature, implementations, and tests.

Function for the negative likelihood ratio of a negative result on two tests with conditional dependence

f(Se_1, Se_2, Sp_1, Sp_2, C_pos, C_neg) = LR_neg_12

Takes the sensitivities Se_1 and Se_2 and specificities Sp_1 and Sp_2 of two tests and their conditional covariances, C_pos among people with the condition and C_neg among people without it, and returns the negative likelihood ratio LR_neg_12 of a negative result on both, through the combined sensitivity and specificity of the rule that calls a person positive when either test is positive. LR_neg = (1 minus Se) / Sp is live as HE-FM-DXA-002, and the post-test probability after a negative result, one minus the negative predictive value of HE-FM-DXA-003, is the odds update that HE-VT-DXA-006 checks. The highest pre-test probability at which a negative result brings the risk down to p*, p* / (p* + (1 minus p*) LR_neg), and the largest ratio that does so at a pre-test probability p, p* (1 minus p) / ((1 minus p*) p), are that live update with one minus the negative predictive value set to p* and solved for p or for the ratio, so they are cited here and not drafted (derived). In the article's example the first is about 21.9%, and it is also the pre-test probability above which confirming everyone beats testing first when the triage test is free (derived). The article's threshold p* = C_conf / L_miss is the decision-curve threshold HE-FM-DCA-004 with G = L_miss minus C_conf and L = C_conf (derived). The pathway's net monetary benefit against confirming everyone and its break-even pre-test probability are HE-FM-DXA-005 and HE-CF-DXA-001 with confirming everyone entered as a test of sensitivity 1, specificity 0 and no cost (derived), which returns the article's 19.0%. Deeks and Altman note that likelihood ratios can be treated like risk ratios for confidence intervals, so the interval for LR_neg is HE-FM-PWMA-001 with a = FN, n1 = TP + FN, c = TN and n2 = TN + FP, exponentiated as in HE-FM-HR-006. Notation follows the Negative Likelihood Ratio article, with the two-test symbols added here.

  • Negative likelihood ratio of a negative result on both of two tests with conditional covariances

    Se_par = 1 - (1 - Se_1) * (1 - Se_2) - C_pos; Sp_par = Sp_1 * Sp_2 + C_neg; LR_neg_12 = (1 - Se_par) / Sp_par

    When two tests are combined so that a person is called negative only if both are negative, the combined sensitivity Se_par and specificity Sp_par follow from the single-test values and the conditional covariances, C_pos among people with the condition and C_neg among people without it, in the joint probabilities that Wang, Lin and Nelson give. The combined ratio LR_neg_12 is then the LR_neg of HE-FM-DXA-002 applied to Se_par and Sp_par. With both covariances zero, the conditional independence that the article warns about, LR_neg_12 equals the product of the two single-test ratios (derived). A positive C_pos raises the ratio above that product, so multiplying the ratios overstates the rule-out, while a positive C_neg on its own lowers it below the product (derived).