Computes the total variance of marginal treatment effects using the delta method. For binomial data, calculates: $$\frac{1}{n_C} + \frac{1}{n_{\bar{C}}} + \frac{1}{n_B} + \frac{1}{n_{\bar{B}}}$$.
Usage
marginal_variance(ald, treatments = list("B", "C"), scale, family)
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_variance(ald, treatments = list("B", "C"), scale = "log", family = "binomial")
} # }