Skip to contents

Each level gets its OWN clever covariate 1{A = a}/g_a(W) and its own fluctuation, because one logistic update cannot solve L score equations at once. min_g exposes levels with almost no support. A holds one-based level labels.

Usage

Tmlecat(Y, A, Q, G, ref = 1, gbound = 0.025, level = 0.95)

Arguments

Y

Outcome in [0, 1].

A

One-based treatment level of each observation.

Q

Initial E[Y | A = a, W], one column per level.

G

Initial P(A = a | W), rows summing to 1.

ref

One-based reference level for the contrasts.

gbound

Truncation applied to each g_a.

level

Confidence level.

Value

List with psi, se, contrast, contrast_se, ci_lower, ci_upper, min_g, ref, n, L.

Details

Formula: for each level a, fluctuate logit Q(a,W) on H_a = 1{A = a}/g_a(W); psi_a = mean(Q*(a,W))

References

Verified against the CRAN package tmle 2.1.1 (Gruber & van der Laan); the multi-level extension applies the same fluctuation per level, as in van der Laan & Rose (2011), Targeted Learning, Chapter 4.

Examples

set.seed(13)
n <- 300
A <- sample(1:3, n, TRUE)
Y <- rbinom(n, 1, c(0.3, 0.5, 0.6)[A])
Q <- matrix(rep(c(0.3, 0.5, 0.6), each = n), n)       # initial fits per level
G <- matrix(1 / 3, n, 3)
Tmlecat(Y, A, Q, G)$psi
#> [1] 0.3142857 0.4831461 0.5943396