Propensity score match with exact matching on one variable I would like to compare survival outcomes of two groups (control vs. treatment). Because of imbalances of baseline covariates, I used propensity score matching using nearest neighbor matching. After matching, covariate balance is very good except for one variable. I have heard before that in such a case, one can use exact matching only on the one variable. How is this done? Do I first do the nearest neighbor matching, and perform exact matching on this matched population? Or is there another way? Also, if someone knows an R tutorial for this, I would be delighted if someone would share it with me.

All R packages that implement matching implement an exact matching restriction. In MatchIt, you use the exact argument.
m <- matchit(A ~ X1 + X2 + X3, data = data, exact = ~X2 + X3)

This performs 1:1 nearest neighbor matching on a propensity score estimated with X1, X2, and X3 as covariates and an exact matching constraint on X2 and X3. Read the MatchIt vignettes for a full tutorial.
