Closed lorenzoFabbri closed 1 year ago
The denominator of the weights is the conditional density of the treatment given the covariates evaluated at the observed values of the treatment. The conditional density of the treatment given the covariates is the density of the errors of the treatment model. The GPS are predicted values from the treatment model, and subtracting them from the treatment gives us the residuals of the treatment model. The distribution of the residuals is an estimate of the distribution of errors, which is equal to the conditional distribution of the treatment given the covariates.
This is described in Zhu et al. (2015, p4):
and in Robins et al. (2000):
where $a_{0i}$ is the observed treatment and $\hat\alpha_0 + \hat\alpha1 l{0i}$ is the linear predictor in the treatment model with covariate $l_{0}$.
This is not an issue/bug. I am just trying to understand how the weights are estimated from the PS, in the case of continuous exposures. In the
get_cont_weights
function (line 866) , the PS is subtracted from the treatment values, and the result is used to the estimate the weights. Why so? I looked into the referenced literature but could not find anything.