After conducting the following genetic
match using the MatchIt
package, I would like to conduct a post-match analysis of treatment effect:
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
I can accomplish that with the following:
df_m2 <- MatchIt::match.data(df_match)
fit <- glm(outcome ~ hxcopd, data = df_m2, weights = weights)
lmtest::coeftest(fit, vcov. = sandwich::vcovHC)
lmtest::coefci(fit, vcov. = sandwich::vcovHC)
The weights = weights
are weights produced by by the genetic
match and appropriately account for the fact that multiple control units are matched to the same treated unit and that each treated unit might have multiple controls.
I have a few questions regarding the post match analysis, feel free to answer as few as you would like:
- If my outcome is binary, can I simply adjust my model by adding
family = "binomial"
?
df_m2 <- MatchIt::match.data(df_match)
fit <- glm(outcome ~ hxcopd, data = df_m2, weights = weights, family = "binomial")`
lmtest::coeftest(fit, vcov. = sandwich::vcovHC)
lmtest::coefci(fit, vcov. = sandwich::vcovHC)
- Do I need to include any additional covariates in the formula
outcome ~ hxcopd
? My outcome is binomial but I am also interested to hear if the answer to this question depends on if my outcome is either binomial or continuous. Additionally, the explanatory variables are a mix of binomial, categorial, and continuous.
This cross-validated answer suggests that they do not need to be included if balance is obtained by pre-processing - but how can I validate that in my own data quantitatively to say that I am "balanced enough" not to include the covariates. The user then goes on to say doing it anyway is not a bad idea because it is "doubly robust", so does that make this discussion a moot point?
- If I set
replace = FALSE
andties = FALSE
so that my genetic matching is essentially nearest neighbor, would I even need the use ofglm
? Would it be valid just to directly compare the sample populations via hypothesis testing the outcome of interest (such as chi-square)?