I am using R version 3.2.2 and RStudio version Version 0.99.486. Which R code can I use to test the equality of 2 survival curves using the maximum difference between the curves? This is like a Kolmogorov–Smirnov test statistic but not for goodness of fit. Previously I have used proportion hazards test statistics from the survival package. I want to see if the difference in survival is significant at the time when it is maximum -- without knowing advance the time when the maximum will be seen. I have already explored the survival package for the Mantel-Haenszel test and the Wilcoxon test. Both these test incorporate the differences over the entire curve rather than at the time when the difference is maximum.