Skip to contents

The parts sum to a constant, so an effect read off the parts is confounded by the closure. Estimating on clr coordinates removes the constraint; the returned effects sum to zero for the same reason. Each coordinate is targeted separately with the shared propensity.

Usage

Comptml(Yc, A, Q1, Q0, g1W, gbound = 0.025, level = 0.95)

Arguments

Yc

Compositional outcome, one composition per row.

A

Binary treatment.

Q1, Q0

Initial E[clr(Y)_j | A = 1/0, W].

g1W

Initial propensity.

gbound

Propensity truncation.

level

Confidence level.

Value

List with effect, se, ci_lower, ci_upper, sum_effect, perturbation, n, D.

Details

Formula: Z = clr(Y); for each coordinate j target psi_j = E[Z_j(1)] - E[Z_j(0)]; sum_j psi_j = 0; the perturbation on the simplex is C(exp(psi))

References

Targeting machinery verified against the CRAN package tmle 2.1.1 (Gruber & van der Laan); the bounded-continuous-outcome transform is Gruber & van der Laan (2010), International Journal of Biostatistics 6(1), Article 26. The compositional geometry is Aitchison (1986), Chapters 2 and 4, matching the sibling modules aitclr and aitprt. No source combining the two was found; the combination is documented here as this package's own.

Examples

set.seed(7)
n <- 300
A <- rbinom(n, 1, 0.5)
Yc <- t(sapply(A, function(a) { p <- c(0.5, 0.3, 0.2) * if (a == 1) c(1.5, 1, 1) else 1; p / sum(p) }))
clr <- function(p) log(p) - mean(log(p))
Q1 <- matrix(clr(c(0.75, 0.3, 0.2) / 1.25), n, 3, byrow = TRUE); Q0 <- matrix(clr(c(0.5, 0.3, 0.2)), n, 3, byrow = TRUE)
r <- Comptml(Yc, A, Q1, Q0, g1W = rep(0.5, n))
round(c(r$effect, sum = r$sum_effect), 3)   # clr effects sum to zero
#>                         sum 
#>  0.270 -0.135 -0.135  0.000