Functions & Formulae

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

Non-inferiority and superiority decision function for an active control trial

ni(p_T, p_C, n_T, n_C, z, M) = (L_d, U_d, NI, SUP)

Maps the proportions of patients with a favourable outcome in the test and active control arms of a two-arm randomised trial, the arm sizes, a normal critical value and a margin fixed in the protocol to the two-sided interval for the risk difference and to the readings for non-inferiority and superiority. The steps before the decision are live records. The risk difference d is the test proportion minus the control proportion, the difference of HE-FM-ARR-001 with its sign reversed, because HE-FM-ARR-001 subtracts the intervention risk of an adverse event from the comparator risk and HE-AS-ARR-002 reverses the subtraction for a beneficial outcome. Each arm's standard error is HE-FM-BINOM-004, the variance of a difference of two independent arm estimates is the sum of their variances as in HE-VR-AN-002 and HE-FM-NMA-001, and the interval limits are the Wald limits of HE-FM-AN-001. HE-FM-ACTR-001 adds the comparison of the lower limit with minus the margin and with zero. The article's economic check is a citation of live records, the incremental net health benefit being HE-FM-CET-002, its break-even shortfall in cures being HE-FM-CET-002 solved for the shortfall under the article's illustrative linear cost and QALY model (compare the break-even price of HE-FM-BEA-001), and the probability of a positive net health benefit following the z statistic of HE-FM-AN-004. Bioequivalence on the ratio scale is HE-FM-ANDA-001, and the least-cost choice once outcomes are shown to be equivalent is HE-FM-CMA-001. Notation follows the Active Control Trial article.

  • Non-inferiority and superiority readings of a risk difference against a margin

    d = p_T - p_C; SE_d = sqrt(p_T * (1 - p_T) / n_T + p_C * (1 - p_C) / n_C); L_d = d - z * SE_d; U_d = d + z * SE_d; NI = (L_d > -M); SUP = (L_d > 0)

    Forms the difference in the proportion of patients with a favourable outcome, test minus active control, and its two-sided Wald interval, then reads the lower limit against minus the non-inferiority margin M and against zero. The chained steps are live records, d as HE-FM-ARR-001 with the subtraction reversed for a favourable outcome, as HE-AS-ARR-002 states, SE_d as the sum of the two arm variances of HE-FM-BINOM-004 (the rule of HE-VR-AN-002 and HE-FM-NMA-001), and L_d and U_d as HE-FM-AN-001. The new step is the decision, which ICH E9 section 3.3.2 and CPMP/EWP/482/99 section II.3 state as the interval lying wholly above minus the margin, and which the FDA guidance writes as the upper bound for control minus test lying below M. NI and SUP equal 1 when the reading is shown and 0 otherwise, so a trial can show non-inferiority without superiority, and when both are shown the superiority claim is allowed by CPMP/EWP/482/99 section IV.1.