I am conducting an analysis of the effect of COPD on particular outcomes after surgery. I have found that utilizing the matchit
package with the genetic
method produces the best balance:
df_match <- MatchIt::matchit(hxcopd ~ sex + race + age + diabetes + smoke + dyspnea + fnstatus2 + ascites + hxchf + hxmi + hxangina + hypermed + renafail + dialysis + steroid + bleeddis + wtloss, data = df_m, method = "genetic", pop.size = 1000)
summary(df_match)
Summary of balance for matched data:
Means Treated Means Control SD Control Mean Diff eQQ Med eQQ Mean eQQ Max
distance 0.1637 0.1607 0.1847 0.0030 0.0559 0.1136 0.3928
sexFALSE 0.2409 0.2409 0.4280 0.0000 0.0000 0.1168 1.0000
sexTRUE 0.7591 0.7591 0.4280 0.0000 0.0000 0.1168 1.0000
raceAsian 0.0073 0.0073 0.0852 0.0000 0.0000 0.0000 0.0000
raceBlack 0.0876 0.0949 0.2933 -0.0073 0.0000 0.0657 1.0000
raceNative Hawaiian or Pacific islander 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
raceWhite 0.8905 0.8905 0.3125 0.0000 0.0000 0.0803 1.0000
age 68.2555 68.1509 12.7220 0.1046 1.0000 1.2409 5.0000
diabetesTRUE 0.0949 0.0876 0.2829 0.0073 0.0000 0.0730 1.0000
smokeTRUE 0.3869 0.3869 0.4874 0.0000 0.0000 0.2044 1.0000
dyspneaTRUE 0.3212 0.3212 0.4673 0.0000 0.0000 0.2701 1.0000
fnstatus2Partially dependent 0.0146 0.0146 0.1200 0.0000 0.0000 0.0073 1.0000
fnstatus2Totally dependent 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
ascitesTRUE 0.0146 0.0146 0.1200 0.0000 0.0000 0.0073 1.0000
hxchfTRUE 0.0073 0.0073 0.0852 0.0000 0.0000 0.0000 0.0000
hxmiTRUE 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
hxanginaTRUE 0.0219 0.0219 0.1465 0.0000 0.0000 0.0146 1.0000
hypermedTRUE 0.5766 0.5766 0.4945 0.0000 0.0000 0.0292 1.0000
renafailTRUE 0.0073 0.0073 0.0852 0.0000 0.0000 0.0000 0.0000
dialysisTRUE 0.0146 0.0073 0.0852 0.0073 0.0000 0.0073 1.0000
steroidTRUE 0.1022 0.1022 0.3031 0.0000 0.0000 0.0803 1.0000
bleeddisTRUE 0.0657 0.0657 0.2479 0.0000 0.0000 0.0511 1.0000
wtlossTRUE 0.0073 0.0073 0.0852 0.0000 0.0000 0.0000 0.0000
Percent Balance Improvement:
Mean Diff. eQQ Med eQQ Mean eQQ Max
distance 97.8044 19.5737 15.4411 18.9160
sexFALSE 100.0000 0.0000 -100.0000 0.0000
sexTRUE 100.0000 0.0000 -100.0000 0.0000
raceAsian 100.0000 0.0000 100.0000 100.0000
raceBlack 52.3051 0.0000 -350.0000 0.0000
raceNative Hawaiian or Pacific islander 100.0000 0.0000 100.0000 100.0000
raceWhite 100.0000 0.0000 -83.3333 0.0000
age 99.0985 91.6667 89.3149 78.2609
diabetesTRUE 71.5156 0.0000 -233.3333 0.0000
smokeTRUE 100.0000 0.0000 0.0000 0.0000
dyspneaTRUE 100.0000 0.0000 7.5000 0.0000
fnstatus2Partially dependent 100.0000 0.0000 0.0000 0.0000
fnstatus2Totally dependent 100.0000 0.0000 100.0000 100.0000
ascitesTRUE 100.0000 0.0000 0.0000 0.0000
hxchfTRUE 100.0000 0.0000 0.0000 0.0000
hxmiTRUE 100.0000 0.0000 100.0000 100.0000
hxanginaTRUE 100.0000 0.0000 0.0000 0.0000
hypermedTRUE 100.0000 0.0000 87.0968 0.0000
renafailTRUE 100.0000 0.0000 0.0000 0.0000
dialysisTRUE 17.1281 0.0000 0.0000 0.0000
steroidTRUE 100.0000 0.0000 0.0000 0.0000
bleeddisTRUE 100.0000 0.0000 -40.0000 0.0000
wtlossTRUE 100.0000 0.0000 0.0000 0.0000
Sample sizes:
Control Treated
All 4490 137
Matched 611 137
Unmatched 3879 0
Discarded 0 0
This seems to be the best balance I can get. I am unsure of the best way to conduct post-matching analysis after a genetic match. How can I best assess the causality of COPD (hxcopd
)? I am particularly confused because after a nearest neighbor match, I can just use the resulting dataset to perform whatever analyses I would normally go on to perform.
But the genetic algorithm has balanced the covariates with weights; for example:
If I just check the mean of diabetes
in the resulting dataset, it is not concordant with the summary
:
df_m2 <- MatchIt::match.data(df_match)
tapply(df_m2$diabetes, df_m2$hxcopd, mean)
FALSE TRUE
0.02291326 0.09489051
But when multiplied by the weights, it is:
tapply(df_m2$diabetes*df_m2$weights, df_m2$hxcopd, mean)
FALSE TRUE
0.08029197 0.09489051
I'm therefore not even really sure how to assess the balance or how to go on and perform additional analyses with these weights. For example, can I just directly compare the rates of some outcome (such as infection) between these two groups after matching?