This package implements methods to estimate causal effects from observational studies when there are 2+ distinct levels of treatment (i.e., “multilevel treatment”) using matching estimators, as introduced in Yang et al. (2016) Biometrics. Matching on covariates, and matching or stratification on modeled propensity scores, are made available. These methods require matching on only a scalar function of generalized propensity scores. For more information, see the Extended Description below or the main paper:
Visit the package website
This is a brief tutorial; an extended tutorial is provided in the vignette for version 1.0.0. We will use the dataset provided with this package
library(multilevelMatching) simulated_data <- multilevelMatching::simulated_data knitr::kable(head(simulated_data), digits = 2)
We restructure the dataframe slightly, and use identifying names for the observations:
outcome <- simulated_data$outcome treatment <- simulated_data$treatment covar_matrix <- as.matrix( simulated_data[ ,names(simulated_data) %in% paste0("covar", 1:6)] ) identifying_names <- paste0( rep(letters[1:25],each = 12), rep(letters[1:25], 12) ) names(treatment) <- identifying_names
set.seed(123) fit <- multiMatch( Y = outcome, W = treatment, X = covar_matrix, match_on = "covariates" ) fit #> -------------- Causal estimates --------------- #> Param Trt1 Trt2 Estimate Variance #> 1 EY(2)-EY(1) 1 2 0.07927361 0.1792186 #> 2 EY(3)-EY(1) 1 3 0.86264929 0.1634754 #> 3 EY(3)-EY(2) 2 3 0.78337567 0.3221616 #> --- Matching on 'covariates' with M=1, J=1 ---
Propensity scores can be estimated with either of the following options
match_on="multinom"for multinomial logistic regression from
match_on="polr"for ordinal logistic regression from
match_on <- "multinom" # match_on <- "polr" set.seed(123) fit2 <- multiMatch( Y = outcome, W = treatment, X = covar_matrix, match_on = match_on, trimming = FALSE ) fit #> -------------- Causal estimates --------------- #> Param Trt1 Trt2 Estimate Variance #> 1 EY(2)-EY(1) 1 2 0.07927361 0.1792186 #> 2 EY(3)-EY(1) 1 3 0.86264929 0.1634754 #> 3 EY(3)-EY(2) 2 3 0.78337567 0.3221616 #> --- Matching on 'covariates' with M=1, J=1 ---
Please see the vignette for an extended tutorial.
In setting with where 3 or more levels of treatment (i.e., multilevel treatment), our goal is to estimate pairwise average treatment effects from a common population using matching methods.
This goal can not be acheived by matching one treatment with another one at a time, since the pairwise matched samples may differ from the target population systematically, and thus they are not compatitable. One implication is that from this approach, it is possible that treatment A is better than treatment B, treatment B is better than treatment C, and treatment C is better than treatment A.
We focus on estimating the average values of potential outcomes for each treatment level by matching methods, which facilitate estimation of pairwise average treatment effects for a common population.
The estimation methods include generalized propensity score (GPS) matching, GPS stratification, matching with the full set of covariates, matching with the full set of GPS vector. Note that GPS matching and GPS straticication only require matching on a scalar function when estimating the average value of the potential outcome at a particular treatment level, which reduces the matching dimension to one, regardless of the number of covariates and the number of treatment levels.
In order to ensure sufficient overlap, Crump et al. (2009)’s trimming method can be extended to this setting as well.
See the News site for the changelog.
multiMatch() function may return slightly different estimates than the original 2 matching functions in certain circumstances. We attempt to ensure that the functions implement are identical methods up to perhaps random number generation. Please file an issue if you have any questions or concerns.