如何使用逻辑回归模型在 R 中对 PSM 进行审核分析?

How to do moderation analysis after PSM in R with logistic regression models?

提问人:Isabella 提问时间:8/10/2023 最后编辑:Rui BarradasIsabella 更新时间:8/10/2023 访问量:44

问:

我想在倾向得分匹配之后使用二元结果模型进行调节分析。我估计了一个逻辑回归结果模型(遵循这个小插曲)。我想知道,在使用逻辑回归模型和风险比率时,我执行的假设检验(假设 = “成对”)来比较子组 ATT 是否是正确的规范。

match_data_exact <- matchit (treatment ~ age +kids,  
                             data = data_psm,
                             exact =  ~ male, 
                             method = "full", distance = "glm", tol = 1e-7)


md <- match.data(match_data_exact)

fit_car <- glm(car_often ~ treatment * male , md, weights = weights, family = quasibinomial()) 

#Compute effects; RR and confidence interval
comp_car <- avg_comparisons(fit_car,
                        variables = "treatment",
                        vcov = ~subclass,
                        newdata = subset(md, treatment == 1),
                        wts = "weights",
                        comparison = "lnratioavg",
                        transform = "exp",
                        by = "male")

summary(comp_car)

Term              Contrast male Estimate Pr(\>|z|) 2.5 % 97.5 %. 

treatment ln(mean(1) / mean(0))    1    0.786   0.0641 0.609  1.014. 
treatment ln(mean(1) / mean(0))    0    0.729   0.0120 0.569  0.933. 

Columns: term, contrast, male, estimate, p.value, conf.low, conf.high
comp_car_hypothesis <- avg_comparisons(fit_car,
                            variables = "treatment",
                            vcov = ~subclass,
                            newdata = subset(md, treatment == 1),
                            wts = "weights",
                            comparison = "lnratioavg",
                            transform = "exp",
                            by = "male",
                            hypothesis = "pairwise")

summary(comp_car_hypothesis)

Term Estimate Pr(\>|z|) 2.5 % 97.5 %.  
1 - 0     1.08    0.623 0.798   1.46. 

Columns: term, estimate, p.value, conf.low, conf.high
r 边际效应 倾向得分匹配

评论

0赞 MrFlick 8/10/2023
询问分析是否“正确”对于 Stack Overflow 来说有点偏离主题。如果您需要统计专业知识,您应该在交叉验证中提出您的问题。这不是一个适合 Stack Overflow 的特定编程问题。

答: 暂无答案