Functions & Formulae

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

Last observation carried forward imputation and the bias it adds to an analysed mean

L(tau, mu_last, mu_end) = mu_tilde

Maps a participant's last observed value to every later scheduled visit, so that the value used at visit k is the value recorded at the last completed visit d whenever k is after d, and then maps the fraction of each arm imputed this way, with the true means at the last observed visit and at the final visit, to the expected mean and between-arm difference that the completed data return. The difference between those expected values and the true final-visit values is the bias that the imputation adds. Trapezoidal QALYs reuse HE-FM-QALY-002 and the cost-effectiveness ratio reuses HE-FM-ICER-001; this package adds the mixture mean, the between-arm bias under unequal dropout and a function that carries both into incremental QALYs and the ICER.

  • Analysed final-visit mean after LOCF as a mixture of the earlier and final means

    mu_tilde = tau * mu_last + (1 - tau) * mu_end; bias_mu = tau * (mu_last - mu_end)

    When a fraction tau of final-visit values is missing completely at random and replaced by values from an earlier visit, the completed final-visit data are a mixture of two distributions. Their expected mean, mu_tilde, is tau times the mean at the earlier visit plus one minus tau times the true final-visit mean (Lachin 2016, equation 1). The bias, mu_tilde minus mu_end, is tau times the change in the mean between the two visits, so it is zero only when the mean does not change after the last observed visit.

  • Bias of the LOCF between-arm difference with unequal dropout fractions

    Delta_tilde = (tau_T * mu_T_last + (1 - tau_T) * mu_T_end) - (tau_C * mu_C_last + (1 - tau_C) * mu_C_end); Delta = mu_T_end - mu_C_end; bias_Delta = tau_T * (mu_T_last - mu_T_end) - tau_C * (mu_C_last - mu_C_end)

    Applies the mixture mean of HE-FM-LOCF-001 to each arm with its own fraction imputed and subtracts. The analysed difference, Delta_tilde, departs from the true final difference, Delta, by the treatment arm's bias minus the control arm's bias. With equal fractions the analysed difference reduces to tau times the earlier difference plus one minus tau times the final difference (Lachin 2016, equation 5), which is too large when the earlier difference exceeds the final one and too small when it is smaller. With unequal fractions that rule no longer holds.