Log-Rank test with propensity score matched data

Let's assume that I have two groups that I would like to compare in terms of death rates. One group (group A) got a specific treatment and the other group (group B) did not get any treatment. I matched the groups using full propensity score matching because the groups differed systematically from one another. Now I would like to perform a log-rank test in the basis of the matched groups and I cannot find how to do that in SPSS or R. I matched the groups with R and am left with the propensity score, weights and subclasses. Now I would like to compare the mean time until death. Who can help?

Instead of using matching, you can calculate inverse probability of treatment weights from your estimated propensity scores. These weights can then be used to perform a weighted log-rank test, as described in this article:

Xie, Jun and Chaofeng Liu (2005). “Adjusted Kaplan-Meier Estimator and Log-Rank Test with Inverse Probability of Treatment Weighting for Survival Data”. In: Statistics in Medicine 24, pp. 3089–3110.

This is implemented in the ipw.log.rank function in the RISCA R-package. Adjusted survival curves can be plotted in a similar fashion using the ipw.survial function of that same package. Note that the latter function is rather limited in terms of customizability (does not support confidence interval calculation etc.). You can find a more flexible implementation in the adjustedCurves R-package I developed.

• Thank you so much for your help. So I will calculate the inverse probability (1/PSM-score) and then following up on the log-rank test. This is brilliant. However, I am wondering whether I use the weights or subclasses that I have gotten from PSM in the first place at all?
– user389026
Commented Jun 2, 2023 at 20:25
• Be careful, IP weights are not just 1/PS. It's 1 divided by the probability of receiving the treatment that they did get, in R code: ifelse(treatment=="experimental", 1/ps, 1/(1-ps)). (If you want to be safe, use the get_w_from_ps function from the WeightIt package to calculate the IP weights.) I don't see the need for PSM here. The weighted log rank test does all you need. Commented Jun 2, 2023 at 20:43
• True! Ok so, no PSM at all as you said I could calculate the IPTW from the propensity scores. But I will just do a log regression, thereby get the probabilities for each person and so on. No PSM. Thanks again
– user389026
Commented Jun 2, 2023 at 20:54
• That worked out great. I now have the plotted KM curves and am wondering how I can get the (restricted) mean as well as the median. There is no way to do that in the RISCA R-package, is there?
– user389026
Commented Jun 3, 2023 at 13:24
• I have also tried using the adjsurv function of the adjustedCurves package but I am stuck on this error message: Arguments 'variable', 'ev_time', 'event' and 'method' must be character strings, specifying variables in 'data'.
– user389026
Commented Jun 4, 2023 at 13:12