Suppose I have two matched sets with n = 50 each. I've arranged them by an ID variable such that each ID variable has 2 subjects. I'd like to compare overall survival with a kaplan meier accounting for their paired nature. I understand the best way to do this is through a stratified log rank test. What is the best way to do this in R? The two methods I've tried:
1) Using the survdiff function along the lines of survdiff(Surv(follow up, event) ~ variable + cluster(ID), data = dataframe)
2) Using the coxPH function along the lines of coxph(Surv(follow up, event) ~ variable + cluster(ID), data = dataframe)
However, I'm getting drastically different results using these two methods. Using a standard non-stratified log-rank test with my data, I get a p value of ~ 0.7. With method 2 (coxPH), I get a similar p value of ~ 0.7 albeit with a different robust standard error. Using method 1 (survdiff), my p value is DRASTICALLY different (p <0.0001). Why is this? Does clustering not work in the survdiff function?
I wonder how to perform the stratified log-rank test in R? Have you got the data or corresponding functions?
Code Kevin Blighe posted in his answer is for R.