nhejazi / medoutcon

:package: R/medoutcon: Efficient Causal Mediation Analysis with Natural and Interventional Direct/Indirect Effects
https://codex.nimahejazi.org/medoutcon
Other
13 stars 5 forks source link

Outcome regression #22

Closed idiazst closed 4 years ago

idiazst commented 4 years ago

https://github.com/nhejazi/medoutcon/blob/4d0a908922a23f5a324d6fc16cece4e75e1844f6/R/estimate.R#L221

It seems like this is a bug? Why are outcome predictions being computed from a v fit?

nhejazi commented 4 years ago

Seems a bit like one but this is actually correct. Perhaps interestingly, the first point at which the counterfactual outcome quantities m(M, Z = 0, A = a', W) and m(M, Z = 1, A = a', W) must be computed is https://github.com/nhejazi/medoutcon/blob/tmle/R/fit_mechanisms.R#L700-L701, as they are used in the discrete integral (over Z) of the pseudo-outcome regression V. The labeling is challenging to follow (and should be cleaned up) but it does not appear to be an error.