I have a propensity score weighted population (using IPTW) and I want to compute risk ratios on my weighted population. For this, I am using a weighted Poisson regression.
Let's suppose that "married" is the outcome and I want to see the risk ratio of treated vs non treated considering married as outcome.
library(WeightIt)
library(survey)
W.out <- weightit(treat ~ age + educ + race + nodegree + re74 + re75,
data = lalonde, estimand = "ATE", method = "ps")
d.w <- svydesign(~1, weights = W.out$weights, data = lalonde)
fit <- svyglm(married ~ treat , design = d.w, family="poisson")
exp(coefficients(fit))
exp(confint.default(fit))
For instance, in this case the weighted rate of "married
" for each group is:
married_treated <- with(lalonde, weighted.mean(married[treat == 1], W.out$weights[treat == 1]))
married_nontreated <- with(lalonde, weighted.mean(married[treat == 0], W.out$weights[treat == 0]))
The result of the Poisson regression is basically equal to the ratio between married_treated
/ married_nontreated
.
This should be correct because RR is risk of outcome in exposed people / risk of outcome in unexposed.
The risk of outcome in exposed patients is equal to the frequency of married people in the total exposed group divided by the total n° of people in the exposed group (married/total n° exposed). Subsequently, the weighted rate of married in the treated group should be the weighted risk in the exposed while the weighted rate of married in the non treated group should be the weighted risk in the non exposed. Therefore, RR = weighted risk treated / weighted risk non treated. However, I would like a confirmation.
Is this the correct way of computing risk ratios in a population balanced through IPTW?