***************************************************************
*                                                             *
*            Logrank test for two group survival difference   *
*                                                             *
*                                                             *
***************************************************************



insheet using  http://hedwig.mgh.harvard.edu/biostatistics/sites/default/files/public/education/tmp_sample_data.csv

stset recurr_day, failure(recurrence==1)

sts graph, by(gender) 

sts test gender


********************************** ANNOTATED RESULTS **********************************


         failure _d:  recurrence == 1
   analysis time _t:  recurr_day


Log-rank test for equality of survivor functions

       |   Events         Events
gender |  observed       expected
-------+-------------------------
0      |         4           1.97
1      |         8          10.03
-------+-------------------------
Total  |        12          12.00

             chi2(1) =       2.64
             Pr>chi2 =     0.1039


        Kaplan Meier Survival Curves