Skip to contents

Computes the relative treatment effect from aggregate-level data using event counts. For binomial data, calculates: $$ \log\left( \frac{n_B/(N_B-n_B)}{n_C/(N_B-n_{B})} \right) = \log(n_B n_{\bar{C}}) - \log(n_C n_{\bar{B}}) $$ where \(\bar{C}\) is the compliment of \(C\) so e.g. \(n_{\bar{C}} = N_C - n_c\).

Usage

marginal_treatment_effect(ald, treatments = list("B", "C"), scale, family)

Arguments

ald

Aggregate-level data

treatments

A list of treatment labels. Last variable is reference; default B, C (common; e.g. placebo)

scale

A scaling parameter for the calculation.

family

A character string specifying the family distribution (e.g., "binomial").

Value

The relative treatment effect.

Examples

if (FALSE) { # \dontrun{
ald <- data.frame(trial = 1:5, n_B = c(10, 20, 15, 30, 25), n_C = c(12, 18, 20, 25, 22))
marginal_treatment_effect(ald, treatments = list("B", "C"), scale = "log", family = "binomial")
} # }