Code covered by the BSD License  

Highlights from
Logrank

Be the first to rate this file! 4 Downloads (last 30 days) File Size: 2.66 KB File ID: #20388

Logrank

by Fan Lin

 

21 Jun 2008 (Updated 26 Jun 2008)

Compare the survival distributions of two samples by performing Log-rank test

| Watch this File

File Information
Description

Log-rank test(Approximate)
The logrank test is a hypothesis test to compare the survival distributions of two samples. It is a nonparametric test and appropriate to use when the data are right censored (technically, the censoring must be non-informative).
logrank(x,y,2)
return p value and graph K-M curves

Required Products Statistics Toolbox
MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
23 Jun 2008 Jos x@y.z

Why zip a single m-file? And there is no penalty for using spacing and indents, which making the text so much more readable.
The help section is a little vague mentioning only two arguments for its syntax and then talk about a three more variables : "Syntax: p=logrank(x,y) Input: x and y - two groups; show -0:don't show the result ..."

And maybe you can provide an example what this test is all about: when to use it for what, and what are its advantages over other tests.

24 Jun 2008 Fan Lin

Thanks for your suggestions. I will improve it next time.

Logrank test is a classic method to compare two populations with censored survival data
and there is an example in the The help section

26 Jun 2008 Fan Lin

John D'Errico?
Thankyou,I had updated this file.

Please login to add a comment or rating.
Updates
26 Jun 2008

fix bugs

Tag Activity for this File
Tag Applied By Date/Time
statistics Fan Lin 22 Oct 2008 10:06:42
probability Fan Lin 22 Oct 2008 10:06:42
log rank survival Fan Lin 22 Oct 2008 10:06:42

Contact us at files@mathworks.com