hetsurr is an R package that provides functions to assess and test for heterogeneity in the utility of a surrogate marker with respect to a baseline covariate.
More details on the method are available in: Parast, L., Cai, T., Tian L (2023). 'Testing for Heterogeneity in the Utility of a Surrogate Marker.' Biometrics, 79(2): 799–810, doi:10.1111/biom.13600
A full written tutorial is available in Parast L (2025). Surrogate Marker Evaluation: A Tutorial Using R. Statistics in Medicine, 44(10-12):e70048. 10.1002/sim.70048 with a follow-up along R markdown available here, and the knitted html here. The Parast (2025) tutorial paper is available in this respository, it is called Parast2025_Tutorial.pdf.
We also have a shiny app implementing these methods here: hetsurr Shiny App.