# Matching with a continuous treatment

I am trying to match a ~60k observation data set, where the treatment (annual days of sun exposure) is continuous. The data also has several confounders, some of which are continuous and some categorical.

I was trying to use the MatchIt R package to get covariate balancing propensity scores (CBPS) but got an error message saying "The treatment must be a binary variable." Using the CBPS package directly did work and the cobalt package indicates that matching indeed yielded balance. But now I am unsure how to actually match the data.

library(CBPS)
cbps_out <- CBPS(days_of_sun ~ gender + race + age + state + history_of_cancer,
method = "exact",
data = df)


I was looking everywhere online, but there is such little information about matching with continuous treatments. I did find a great Gary King lecture where he advocated for coarsened exact matching (CEM) over propensity score matching and said it can work with continuous treatments if they are first coarsened. But unfortunately I couldn't find any additional information on this either.

If anyone has actually matched on a continuous treatment using either propensity scores or CEM and could share how it's done that would be so helpful.

Matching is not well developed for continuous treatments, but weighting is. The CBPS package implements weighting for categorical or continuous treatments using the CBPS method. There are many other weighting methods for continuous treatments implemented in the WeightIt package, including entropy balancing and propensity score weighting using propensity scores estimated from parametric or nonparametric methods. To my knowledge, there aren't comprehensive tutorial articles explaining how to use weighting for continuous treatments, but reading Austin (2019) (ignoring section 2.3.1), Zhu et al. (2015), and Vegetabile et al. (2020) can be helpful.