Comparing survival curves of two groups using the log rank test.
Comparison of two survival curves can be done using a statistical hypothesis test called the log rank test. It is used to test the null hypothesis that there is no difference between the population survival curves (i.e. the probability of an event occurring at any time point is the same for each population). This function uses the Kaplan-Meier procedure to estimate the survival function (KMPLOT), so if it misses, logrank will try to download it from FEX.
Created by Giuseppe Cardillo
To cite this file, this would be an appropriate format: Cardillo G. (2008). LogRank: Comparing survival curves of two groups using the log rank test http://www.mathworks.com/matlabcentral/fileexchange/22317
Giuseppe Cardillo (2024). Logrank (https://github.com/dnafinder/logrank), GitHub. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Versions that use the GitHub default branch cannot be downloaded
inputparser; table implementation; github link
bug fixed on input data checkpoint section
Mantel-Haenszel Hazard ratio was added
It is better clarified that this is a 2-tailed test
function was adapted to the new kmplot function
hazard ratio added
correction in p-value computation (thanks to Prof. Brani Vidakovic)
Changes in code to solve an incompatibility with Mac (Thanks to Tim the cyclist)
Changes in description
Correction of a bug that occurs when data are not censored
Correction to avoid NaN in Standard error computation
correction when the first value is censored
changes in help section for correct citation