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

73 Views Asked by At

I would like to perform a moderation analysis after Propensity Score Matching with a binary outcome model. I estimate a logistic regression outcome model (following the this vignette). I am wondering, whether the hypothesis test I perform (hypothesis = "pairwise") to compare the subgroup ATTs is the correct specification when using a logistic regression model and Risk Ratios.

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
0

There are 0 best solutions below