data bone_marrow;
  input g t1 t2 dind rind dfree ta aind tc cind tp pind age dage sex dsex cmv dcmv wait fab
        hosp mtx; 
  label g = "Disease Group"
      t1 = "Time To Death Or On Study Time"
      T2 = "Disease Free Survial Time"
      dind = "Death indicator"
      rind = "Relapse indicator"
      dfree = "Disease Free Survial"
      ta = "Time to Acute GVHD"
      aind = "Acute GVHD indicator"
      tc = "Time to chronic GVHD"
      cind = "Chronic GVHD indicator"
      tp = "Time to normal Platelets"
      pind = "Platelet Recovery Indicator"
      age = "Patient Age"
      dage = "Donor Age"
      sex = "Patient sex"
      dsex = "Donor Sex"
      cmv = "Patient CMV Status"
      dcmv = "Donor CMV"
      wait = "Waiting time: days"
      fab = "FAB"
      hosp = "Hospital"
      mtx = "MTX";
datalines;
1  2081  2081  0  0  0    67  1   121  1    13  1  26  33  1  0  1  1    98  0  1  0
1  1602  1602  0  0  0  1602  0   139  1    18  1  21  37  1  1  0  0  1720  0  1  0
1  1496  1496  0  0  0  1496  0   307  1    12  1  26  35  1  1  1  0   127  0  1  0
1  1462  1462  0  0  0    70  1    95  1    13  1  17  21  0  1  0  0   168  0  1  0
1  1433  1433  0  0  0  1433  0   236  1    12  1  32  36  1  1  1  1    93  0  1  0
1  1377  1377  0  0  0  1377  0   123  1    12  1  22  31  1  1  1  1  2187  0  1  0
1  1330  1330  0  0  0  1330  0    96  1    17  1  20  17  1  0  1  1  1006  0  1  0
1   996   996  0  0  0    72  1   121  1    12  1  22  24  1  0  0  0  1319  0  1  0
1   226   226  0  0  0   226  0   226  0    10  1  18  21  0  1  0  0   208  0  1  0
1  1199  1199  0  0  0  1199  0    91  1    29  1  24  40  1  1  0  1   174  0  3  1
1  1111  1111  0  0  0  1111  0  1111  0    22  1  19  28  1  1  0  1   236  0  3  1
1   530   530  0  0  0    38  1    84  1    34  1  17  28  1  1  0  0   151  0  3  1
1  1182  1182  0  0  0  1182  0   112  1    22  1  24  23  0  0  0  1   203  0  2  1
1  1167  1167  0  0  0    39  1   487  1  1167  0  27  22  0  1  1  1   191  0  2  1
1   418   418  1  0  1   418  0   220  1    21  1  18  14  1  1  0  0   110  0  1  0
1   417   383  1  1  1   417  0   417  0    16  1  15  20  1  1  0  0   824  0  1  0
1   276   276  1  0  1   276  0    81  1    21  1  18   5  0  0  0  0   146  0  1  0
1   156   104  1  1  1    28  1   156  0    20  1  20  33  1  1  0  1    85  0  1  0
1   781   609  1  1  1   781  0   781  0    26  1  27  27  1  0  1  1   187  0  1  0
1   172   172  1  0  1    22  1   172  0    37  1  40  37  0  0  0  1   129  0  1  0
1   487   487  1  0  1   487  0    76  1    22  1  22  20  1  1  0  0   128  0  1  0
1   716   662  1  1  1   716  0   716  0    17  1  28  32  1  1  0  0    84  0  1  0
1   194   194  1  0  1   194  0    94  1    25  1  26  32  0  1  0  0   329  0  1  0
1   371   230  1  1  1   371  0   184  1     9  1  39  31  0  1  0  1   147  0  1  0
1   526   526  1  0  1   526  0   121  1    11  1  15  20  1  1  0  0   943  0  1  0
1   122   122  1  0  1    88  1   122  0    13  1  20  26  1  0  0  1  2616  0  1  0
1  1279   129  1  1  1  1279  0  1279  0    22  1  17  20  0  0  0  0   937  0  3  1
1   110    74  1  1  1   110  0   110  0    49  1  28  25  1  0  1  0   303  0  3  1
1   243   122  1  1  1   243  0   243  0    23  1  37  38  0  1  1  1   170  0  3  1
1    86    86  1  0  1    86  0    86  0    86  0  17  26  1  0  1  0   239  0  3  1
1   466   466  1  0  1   466  0   119  1   100  1  15  18  1  1  0  0   508  0  3  1
1   262   192  1  1  1    10  1    84  1    59  1  29  32  1  1  1  0    74  0  3  1
1   162   109  1  1  1   162  0   162  0    40  1  36  43  1  1  1  0   393  0  2  1
1   262    55  1  1  1   262  0   262  0    24  1  23  16  0  1  1  1   331  0  2  1
1     1     1  1  0  1     1  0     1  0     1  0  42  48  1  1  0  0   196  0  2  1
1   107   107  1  0  1   107  0   107  0   107  0  30  19  1  1  1  1   178  0  2  1
1   269   110  1  1  1   269  0   120  1    27  1  29  20  0  1  1  1   361  0  2  1
1   350   332  1  0  1   350  0   350  0    33  1  22  20  1  0  0  0   834  0  2  1
2  2569  2569  0  0  0  2569  0  2569  0    21  1  19  13  1  1  1  0   270  1  1  0
2  2506  2506  0  0  0  2506  0  2506  0    17  1  31  34  1  1  0  0    60  0  1  0
2  2409  2409  0  0  0  2409  0  2409  0    16  1  35  31  1  1  1  1   120  0  1  0
2  2218  2218  0  0  0  2218  0  2218  0    11  1  16  16  1  1  1  0    60  1  1  0
2  1857  1857  0  0  0  1857  0   260  1    15  1  29  35  0  0  1  0    90  0  1  0
2  1829  1829  0  0  0  1829  0  1829  0    19  1  19  18  1  1  1  0   210  0  1  0
2  1562  1562  0  0  0  1562  0  1562  0    18  1  26  30  1  1  1  1    90  0  1  0
2  1470  1470  0  0  0  1470  0   180  1    14  1  27  34  1  1  0  1   240  0  1  0
2  1363  1363  0  0  0  1363  0   200  1    12  1  13  24  1  1  1  0    90  0  1  0
2  1030  1030  0  0  0  1030  0   210  1    14  1  25  29  0  0  0  0   210  0  1  0
2   860   860  0  0  0   860  0   860  0    15  1  25  31  0  1  0  1   180  0  1  0
2  1258  1258  0  0  0  1258  0   120  1    66  1  30  16  0  1  1  0   180  0  2  1
2  2246  2246  0  0  0    52  1   380  1    15  1  45  39  0  0  0  0   105  0  4  0
2  1870  1870  0  0  0  1870  0   230  1    16  1  33  30  0  0  1  1   225  0  4  0
2  1799  1799  0  0  0  1799  0   140  1    12  1  32  23  1  0  0  0   120  0  4  0
2  1709  1709  0  0  0    20  1   348  1    19  1  23  28  0  1  1  0    90  1  4  0
2  1674  1674  0  0  0  1674  0  1674  0    24  1  37  34  1  1  0  0    60  1  4  0
2  1568  1568  0  0  0  1568  0  1568  0    14  1  15  19  1  0  0  0    90  0  4  0
2  1527  1527  0  0  0  1527  0  1527  0    13  1  22  12  0  1  0  1   450  1  4  0
2  1324  1324  0  0  0    25  1  1324  0    15  1  46  31  1  1  1  1    75  0  4  0
2   957   957  0  0  0   957  0   957  0    69  1  18  17  1  1  0  0    90  0  4  0
2   932   932  0  0  0    29  1   932  0     7  1  27  30  0  0  0  0    60  1  4  0
2   847   847  0  0  0   847  0   847  0    16  1  28  29  1  1  0  0    75  0  4  0
2   848   848  0  0  0   848  0   155  1    16  1  23  26  1  1  0  0   180  0  4  0
2  1850  1850  0  0  0  1850  0  1850  0     9  1  37  36  0  0  0  1   180  0  3  1
2  1843  1843  0  0  0  1843  0  1843  0    19  1  34  32  0  0  1  1   270  0  3  1
2  1535  1535  0  0  0  1535  0  1535  0    21  1  35  32  0  1  0  0   180  1  3  1
2  1447  1447  0  0  0  1447  0   220  1    24  1  33  28  0  1  1  1   150  0  3  1
2  1384  1384  0  0  0  1384  0   200  1    19  1  21  18  0  0  0  0   120  0  3  1
2   414   414  1  0  1   414  0   414  0    27  1  21  15  1  1  0  1   120  1  1  0
2  2204  2204  1  0  1  2204  0  2204  0    12  1  25  19  0  0  0  1    60  0  1  0
2  1063  1063  1  0  1  1063  0   240  1    16  1  50  38  1  0  1  0   270  1  1  0
2   481   481  1  0  1    30  1   120  1    24  1  35  36  1  0  1  1    90  1  1  0
2   105   105  1  0  1    21  1   105  0    15  1  37  34  1  0  1  1   120  0  1  0
2   641   641  1  0  1   641  0   641  0    11  1  26  24  1  1  0  0    90  0  1  0
2   390   390  1  0  1   390  0   390  0    11  1  50  48  1  1  0  0   120  0  1  0
2   288   288  1  0  1    18  1   100  1   288  0  45  43  1  1  1  1    90  0  1  0
2   522   421  1  1  1    25  1   140  1    20  1  28  30  1  1  0  1    90  1  1  0
2    79    79  1  0  1    16  1    79  0    79  0  43  43  0  0  0  0    90  0  1  0
2  1156   748  1  1  1  1156  0   180  1    18  1  14  19  1  0  0  0    60  0  1  0
2   583   486  1  1  1   583  0   583  0    11  1  17  14  0  1  0  0   120  0  1  0
2    48    48  1  0  1    48  0    48  0    14  1  32  33  0  1  1  0   150  1  1  0
2   431   272  1  1  1   431  0   431  0    12  1  30  23  0  1  1  0   120  1  1  0
2  1074  1074  1  0  1  1074  0   120  1    19  1  30  32  1  1  1  0   150  1  1  0
2   393   381  1  1  1   393  0   100  1    16  1  33  28  0  0  0  0   120  1  1  0
2    10    10  1  0  1    10  0    10  0    10  0  34  54  1  0  1  1   240  0  2  1
2    53    53  1  0  1    53  0    53  0    53  0  33  41  0  1  1  1   180  0  2  1
2    80    80  1  0  1    10  1    80  0    80  0  30  35  0  0  0  1   150  0  2  1
2    35    35  1  0  1    35  0    35  0    35  0  23  25  0  1  1  1   150  0  2  1
2  1499   248  0  1  1  1499  0  1499  0     9  1  35  18  1  1  0  1    30  0  4  0
2   704   704  1  0  1    36  1   155  1    18  1  29  21  0  1  1  0   105  0  4  0
2   653   211  1  1  1   653  0   653  0    23  1  23  16  1  0  0  0    90  1  4  0
2   222   219  1  1  1   222  0   123  1    52  1  28  30  1  1  1  1   120  1  3  1
2  1356   606  0  1  1  1356  0  1356  0    14  1  33  22  1  1  1  0   210  1  3  1
3  2640  2640  0  0  0  2640  0  2640  0    22  1  18  23  1  1  0  0   750  0  1  0
3  2430  2430  0  0  0  2430  0  2430  0    14  1  29  26  1  1  0  1    24  0  1  0
3  2252  2252  0  0  0  2252  0   150  1    17  1  35  31  1  0  0  0   120  0  1  0
3  2140  2140  0  0  0  2140  0   220  1    18  1  27  17  1  1  1  1   210  0  1  0
3  2133  2133  0  0  0  2133  0   250  1    17  1  36  39  0  1  0  0   240  0  1  0
3  1238  1238  0  0  0  1238  0   250  1    18  1  24  28  1  0  1  1   240  0  1  0
3  1631  1631  0  0  0  1631  0   150  1    40  1  27  21  1  0  1  0   690  1  2  1
3  2024  2024  0  0  0  2024  0   180  1    16  1  35  41  0  1  0  0   105  1  4  0
3  1345  1345  0  0  0    32  1   360  1    14  1  50  36  1  1  1  1   120  0  4  0
3  1136  1136  0  0  0  1136  0   140  1    15  1  47  27  1  0  1  0   900  0  3  1
3   845   845  0  0  0   845  0   845  0    20  1  40  39  0  0  1  1   210  1  3  1
3   491   422  1  1  1   491  0   180  1   491  0  22  21  0  0  0  0   210  1  1  0
3   162   162  1  0  1   162  0   162  0    13  1  22  23  1  0  0  1   300  0  1  0
3  1298    84  1  1  1  1298  0  1298  0  1298  0   8   2  0  0  1  0   105  1  1  0
3   121   100  1  1  1    28  1   121  0    65  1  39  48  1  1  1  1   210  1  1  0
3     2     2  1  0  1     2  0     2  0     2  0  20  19  1  1  0  0    75  1  1  0
3    62    47  1  1  1    62  0    62  0    11  1  27  25  1  1  0  0    90  1  1  0
3   265   242  1  1  1   265  0   210  1    14  1  32  32  1  0  0  0   180  1  1  0
3   547   456  1  1  1   547  0   130  1    24  1  31  28  1  0  1  1   630  1  1  0
3   341   268  1  1  1    21  1   100  1    17  1  20  23  0  1  1  1   180  1  1  0
3   318   318  1  0  1   318  0   140  1    12  1  35  40  0  1  1  1   300  0  1  0
3   195    32  1  1  1   195  0   195  0    16  1  36  39  1  1  0  0    90  1  1  0
3   469   467  1  1  1   469  0    90  1    20  1  35  33  0  0  1  0   120  0  1  0
3    93    47  1  1  1    93  0    93  0    28  1   7   2  1  1  0  0   135  1  1  0
3   515   390  1  1  1   515  0   515  0    31  1  23  25  1  1  1  0   210  1  1  0
3   183   183  1  0  1   183  0   130  1    21  1  11  7  0  1  0  0    120  1  1  0
3   105   105  1  0  1   105  0   105  0   105  0  14  18  1  0  0  0   150  1  1  0
3   128   115  1  1  1   128  0   128  0    12  1  37  35  0  0  1  1   270  0  1  0
3   164   164  1  0  1   164  0   164  0   164  0  19  32  0  0  0  1   285  1  1  0
3   129    93  1  1  1   129  0   129  0    51  1  37  34  0  1  1  0   240  1  1  0
3   122   120  1  1  1   122  0   122  0    12  1  25  29  0  1  1  1   510  1  1  0
3    80    80  1  0  1    21  1    80  0     0  1  35  28  1  0  0  0   780  1  1  0
3   677   677  1  0  1   677  0   150  1     8  1  15  14  1  1  1  0   150  1  1  0
3    73    64  1  1  1    73  0    73  0    38  1  45  42  0  1  1  0   180  1  2  1
3   168   168  1  0  1   168  0   200  1    48  1  32  43  0  1  1  1   150  1  2  1
3    74    74  1  0  1    29  1    74  0    24  1  41  29  0  1  1  1   750  0  2  1
3    16    16  1  0  1    16  0    16  0    16  0  27  36  0  0  1  0   180  0  4  0
3   248   157  1  1  1   248  0   100  1    52  1  33  39  0  0  1  1   180  1  4  0
3   732   625  1  1  1   732  0   732  0    18  1  39  43  0  1  1  1   150  1  4  0
3   105    48  1  1  1   105  0   105  0    30  1  17  14  0  1  0  0   210  1  4  0
3   392   273  1  1  1   392  0   122  1    24  1  43  50  1  1  1  0   240  0  3  1
3    63    63  1  0  1    38  1    63  0    16  1  44  37  1  1  0  0   360  1  3  1
3    97    76  1  1  1    97  0    97  0    97  0  48  56  1  1  1  1   330  0  3  1
3   153   113  1  1  1   153  0   153  0    59  1  31  25  0  1  1  1   240  0  3  1
3   363   363  1  0  1   363  0   363  0    19  1  52  48  1  1  1  0   180  0  3  1
;
run;


proc format;
  VALUE  g  1 = "ALL"
            2 = "AML Low Risk"
            3 = "AML High Risk" ;
  value dind  0 = "Alive"
              1 = "Dead";
  value rind  0 = "Disease Free"
              1 = "Relapsed";
  value dfree 0 = "Alive Disease Free"
              1 = "Dead or Relapsed";
  value aind  0 = "Never Developed Acute GVHD"
              1 = "Developed Acute GVHD";
  value cind  0 = "Never Developed Chronic GVHD"
              1 = "Developed Chronic GVHD";
  value pind  0 = "Platelet Never Returned to Normal"
              1 = "Returned to Normal";
  value sex   0 = "Female"
              1 = "Male";
  value dsex  0 = "Female"
              1 = "Male";
  value cmv   0 = "CMV Negative"
              1 = "CMV Positive";
  value dcmv  0 = "CMV Negative"
              1 = "CMV Positive";
  value fab   0 = "Otherwise"
              1 = "FAB Grade 4 or 5 and AML";
  value hosp  1 = "Ohio State Univ"
              2 = "Alferd"
              3 = "St. Vincent"
              4 = "Hahnemann";
  value mtx   0 = "No"
              1 = "Yes";

/********************************************************************************/              

/* 4.2a */
/* Estimate the survival functions and their standard errors */
proc sql;
  create table raw_data as
  select  t1, t2, sum(dfree) as num_event, count(t2) as sub_total
  from bone_marrow
  where g = 2
  group by t2;
  quit;
data table4_2a;
    set raw_data nobs=all;
    total1 = lag(sub_total);
    retain num_left 54; /*We have 54 obs in AML low group*/
   if _n_ > 1 then do;
   num_left = - total1 + num_left; end;
   retain surv 1 delta 0;
   /*Product-Limit Estimator of Survival Function*/
   surv = surv*(1-(num_event/num_left));
   /*Variance of Product-Limit Estimator (Greenwoods Formula)*/
   delta= delta + num_event/(num_left*(num_left-num_event));
   var =(surv**2)*delta;
   stderr = var**.5;
   keep t1 t2 num_left num_event surv stderr ;
   if num_event~=0 or _n_ = all;
run;
proc print data=table4_2a noobs;
    var t2 num_left num_event surv stderr;
    title1 '4.2 A';
    title2 'Estimated Survival Functions and their Standard Errors for AML low risk';
run;

  
/********************************************************************************/    
    
  
/* 4.2b */
/* Estimated cumulative hazard rates and their standard errors for AML low risk */
data table4_2b;
    set raw_data nobs=all;
    total1 = lag(sub_total);
    retain num_left 54;
   if _n_ > 1 then do;
   num_left = - total1 + num_left; end;
   retain surv 1 delta  h sigma2 0;
   surv = surv*(1-num_event/num_left);
   delta= delta + num_event/(num_left*(num_left-num_event));
   var =(surv**2)*delta;
   stderr = var**.5;
   /*Nelson-Aalen estimator of cumulative hazard*/
   H = H + num_event / num_left;
   /*Estimated variance of the Nelson-Aalen Estimator*/
   sigma2 = sigma2 + num_event /(num_left)**2;
   stderrh = sigma2**.5;
   keep t1 num_left num_event h stderrh;
   if num_event~=0 or _n_ = all;
run;
proc print data=table4_2b noobs;
   var t1 num_left num_event H stderrh ;
   title1 '4.2 B';
   title2 'Estimated Cumulative Hazard Rates and their Standard Errors for AML Low Risk';
run;  

  
/********************************************************************************/      

    
/* 4.2 C */
/* Provide a crude estimate fof the hazard rates for AML Low Risk based on the estimates obtained in b */
data table4_2c;
    set raw_data nobs=all;
    total1 = lag(sub_total);
    retain num_left 54;
   if _n_ > 1 then do;
   num_left = - total1 + num_left; end;
   retain surv 1 delta  h sigma2 0;
   surv = surv*(1-num_event/num_left);
   delta= delta + num_event/(num_left*(num_left-num_event));
   var =(surv**2)*delta;
   stderr = var**.5;
   /*Nelson-Aalen estimator of cumulative hazard*/
   H = H + num_event / num_left;
   /* Crude estimate of hazard rate is slope of Nelson-Aalen estimate 
        OR  change in cumulative hazard/change in time*/
   t1_0 = lag(t1);
   H_0 = lag(H);
   h_rate= (H-H_0)/(t1-t1_0);
   if t1=10 then h_rate=(H/t1);
   keep t1 num_left num_event h h_rate;
   if num_event~=0 or _n_ = all;
run;
proc print data=table4_2c noobs;
   var t1 num_left num_event H h_rate ;
   title1 '4.2 C';
   title2 'Crude Estimate for the Hazard Rate AML Low Risk';
run;

        
/********************************************************************************/    


/* 4.2 D */
/* Estimate the mean time to death and find 95% confidence intervals for the mean survival time for AML low risk */

/* Calculations for Survival Function & Variance */
data work4_2d;
  set raw_data nobs = all;
  total1 = lag(sub_total);
   retain num_left 54;
   if _n_ > 1 then do;
   num_left = num_left  - total1; end;
   retain surv 1 delta  H sigma2 0;
   surv = surv*(1-num_event/num_left);
   delta= delta + num_event/(num_left*(num_left-num_event));
   var =(surv**2)*delta;
   stderr = sqrt(var);
   if num_event~=0 or _n_ = all;
   keep t2 surv num_event num_left;
run;


/* Note our greatest obs time is t1=2569 */

proc sort data=work4_2d;
  by t2 descending t2;
run;
data table4_2d;
  set work4_2d nobs = last;
  lagt = lag(t2);
  if _n_ = 1 then 
  med = surv*(2569 - t2);
  else med = surv*(lagt- t2); output;
  if _n_ =last then do; med = 10; output; end;
run;

data table4_2d;
  set table4_2d nobs=last;
  retain sumd vmean 0 ;
  sumd = sumd + med;
  vmean = vmean + ( sumd**2 ) * num_event/(num_left*(num_left-num_event));
  if _n_ =last then vmean=sqrt(vmean);
run;

proc print data=table4_2d;
run;

data table4_2d;
  set table4_2d nobs=last;
  if _n_ =last then do;
  se_mean = vmean;
  clow = sumd - 1.96*se_mean;
  chigh = sumd + 1.96*se_mean;
  end;
  if _n_ ~= last then delete;
run;
proc print data = table4_2d noobs ;
  var sumd se_mean clow chigh;
    title1 '4.2 D';
   title2 'Estimate of the Mean Time to Death & 95% Confidence Intervals for the Mean Survival Time for AML Low Risk';
run;

  
/********************************************************************************/      
  

/* 4.2 E */
/* Work out estimates of the median time to death and find 95% confidence intervals for the median survival time */

/* t2=2204 sumd=1263.27 vmean=126132.00 */

data table4_2e;
  /*From table 4.2a*/
    t2=2240;
    sumd_med=1263.27;
    se_med=sqrt(126132);
  clow = sumd_med - 1.96*se_med;
  chigh = sumd_med + 1.96*se_med;
run;

proc print data = table4_2e noobs;
  var  sumd_med se_med clow chigh;
    title1 '4.2 E';
   title2 'Estimate of the Median Time to Death & 95% Confidence Intervals for the Median Survival Time for AML Low Risk';
run;

proc print data=table4_2a;
run;

PROC LIFEREG DATA = table4_2a ;
MODEL t2*surv(0)= / DIST=exponential COVB ;
OUTPUT OUT=myq Q=0.75 TO 0.95 BY .10 P=qest STD=se ;
RUN ;

DATA out; 
SET myq ;
loci = qest - 1.96 * se ;
hici = qest + 1.96 * se ;
RUN ;

PROC PRINT DATA=out ;
VAR t2 _PROB_  loci hici ;
RUN ;  
##                                                4.2 A
##               Estimated Survival Functions and their Standard Errors for AML low risk
## 
##                                                num_
##                            t2     num_left    event      surv      stderr
## 
##                             10       54         1      0.98148    0.01835
##                             35       53         1      0.96296    0.02570
##                             48       52         1      0.94444    0.03117
##                             53       51         1      0.92593    0.03564
##                             79       50         1      0.90741    0.03945
##                             80       49         1      0.88889    0.04277
##                            105       48         1      0.87037    0.04571
##                            211       47         1      0.85185    0.04834
##                            219       46         1      0.83333    0.05072
##                            248       45         1      0.81481    0.05286
##                            272       44         1      0.79630    0.05481
##                            288       43         1      0.77778    0.05658
##                            381       42         1      0.75926    0.05818
##                            390       41         1      0.74074    0.05964
##                            414       40         1      0.72222    0.06095
##                            421       39         1      0.70370    0.06214
##                            481       38         1      0.68519    0.06320
##                            486       37         1      0.66667    0.06415
##                            606       36         1      0.64815    0.06499
##                            641       35         1      0.62963    0.06571
##                            704       34         1      0.61111    0.06634
##                            748       33         1      0.59259    0.06686
##                           1063       26         1      0.56980    0.06807
##                           1074       25         1      0.54701    0.06905
##                           2204        6         1      0.45584    0.10118
##                           2569        1         0      0.45584    0.10118
##  
##                                                                                                    
##  
##                                                4.2 B
##            Estimated Cumulative Hazard Rates and their Standard Errors for AML Low Risk
## 
##                                                num_
##                            t1     num_left    event       h       stderrh
## 
##                             10       54         1      0.01852    0.01852
##                             35       53         1      0.03739    0.02644
##                             48       52         1      0.05662    0.03269
##                             53       51         1      0.07623    0.03812
##                             79       50         1      0.09623    0.04305
##                             80       49         1      0.11663    0.04764
##                            105       48         1      0.13747    0.05200
##                            653       47         1      0.15874    0.05618
##                            222       46         1      0.18048    0.06024
##                           1499       45         1      0.20270    0.06421
##                            431       44         1      0.22543    0.06811
##                            288       43         1      0.24869    0.07197
##                            393       42         1      0.27250    0.07581
##                            390       41         1      0.29689    0.07964
##                            414       40         1      0.32189    0.08347
##                            522       39         1      0.34753    0.08732
##                            481       38         1      0.37384    0.09120
##                            583       37         1      0.40087    0.09512
##                           1356       36         1      0.42865    0.09909
##                            641       35         1      0.45722    0.10313
##                            704       34         1      0.48663    0.10724
##                           1156       33         1      0.51694    0.11144
##                           1063       26         1      0.55540    0.11789
##                           1074       25         1      0.59540    0.12449
##                           2204        6         1      0.76206    0.20803
##                           2569        1         0      0.76206    0.20803
##  
##                                                                                                    
##  
##                                                4.2 C
##                           Crude Estimate for the Hazard Rate AML Low Risk
## 
##                                               num_
##                           t1     num_left    event       h         h_rate
## 
##                            10       54         1      0.01852     0.001852
##                            35       53         1      0.03739     0.000755
##                            48       52         1      0.05662     0.001479
##                            53       51         1      0.07623     0.003922
##                            79       50         1      0.09623     0.000769
##                            80       49         1      0.11663     0.020408
##                           105       48         1      0.13747     0.000833
##                           653       47         1      0.15874     0.000039
##                           222       46         1      0.18048    -0.000050
##                          1499       45         1      0.20270     0.000017
##                           431       44         1      0.22543    -0.000021
##                           288       43         1      0.24869    -0.000163
##                           393       42         1      0.27250     0.000227
##                           390       41         1      0.29689    -0.008130
##                           414       40         1      0.32189     0.001042
##                           522       39         1      0.34753     0.000237
##                           481       38         1      0.37384    -0.000642
##                           583       37         1      0.40087     0.000265
##                          1356       36         1      0.42865     0.000036
##                           641       35         1      0.45722    -0.000040
##                           704       34         1      0.48663     0.000467
##                          1156       33         1      0.51694     0.000067
##                          1063       26         1      0.55540     0.001166
##                          1074       25         1      0.59540     0.003636
##                          2204        6         1      0.76206     0.000499
##                          2569        1         0      0.76206     0.000000
##  
##                                                                                                    
##  
##                                                4.2 C
##                           Crude Estimate for the Hazard Rate AML Low Risk
## 
##                       num_
##       Obs     t2     event    num_left      surv     lagt         med      sumd         vmean
## 
##         1      10      1         54       0.98148       .     2511.61    2511.61      2204.12
##         2      35      1         53       0.96296      10      -24.07    2487.54      4449.34
##         3      48      1         52       0.94444      35      -12.28    2475.26      6759.64
##         4      53      1         51       0.92593      48       -4.63    2470.63      9153.37
##         5      79      1         50       0.90741      53      -23.59    2447.04     11597.45
##         6      80      1         49       0.88889      79       -0.89    2446.15     14141.51
##         7     105      1         48       0.87037      80      -21.76    2424.39     16746.86
##         8     211      1         47       0.85185     105      -90.30    2334.09     19266.74
##         9     219      1         46       0.83333     211       -6.67    2327.43     21883.61
##        10     248      1         45       0.81481     219      -23.63    2303.80     24564.15
##        11     272      1         44       0.79630     248      -19.11    2284.69     27323.03
##        12     288      1         43       0.77778     272      -12.44    2272.24     30181.87
##        13     381      1         42       0.75926     288      -70.61    2201.63     32996.72
##        14     390      1         41       0.74074     381       -6.67    2194.96     35934.45
##        15     414      1         40       0.72222     390      -17.33    2177.63     38974.23
##        16     421      1         39       0.70370     414       -4.93    2172.70     42159.55
##        17     481      1         38       0.68519     421      -41.11    2131.59     45391.19
##        18     486      1         37       0.66667     481       -3.33    2128.26     48791.71
##        19     606      1         36       0.64815     486      -77.78    2050.48     52128.59
##        20     641      1         35       0.62963     606      -22.04    2028.44     55586.23
##        21     704      1         34       0.61111     641      -38.50    1989.94     59115.53
##        22     748      1         33       0.59259     704      -26.07    1963.87     62767.79
##        23    1063      1         26       0.56980     748     -179.49    1784.38     67666.29
##        24    1074      1         25       0.54701    1063       -6.02    1778.37     72937.27
##        25    2204      1          6       0.45584    1074     -515.10    1263.27    126132.00
##        26    2569      0          1       0.45584    2204     -166.38    1096.88    126132.00
##        27    2569      0          1       0.45584    2204       10.00    1106.88       355.15
##  
##                                                                                                    
##  
##                                                4.2 D
## Estimate of the Mean Time to Death & 95% Confidence Intervals for the Mean Survival Time for AML Lo
## 
##                                sumd     se_mean      clow      chigh
## 
##                              1106.88    355.151    410.789    1802.98
##  
##                                                                                                    
##  
##                                                4.2 E
## Estimate of the Median Time to Death & 95% Confidence Intervals for the Median Survival Time for AM
## 
##                              sumd_med     se_med      clow      chigh
## 
##                               1263.27    355.151    567.175    1959.37
##  
##                                                                                                    
##  
##                                                4.2 E
## Estimate of the Median Time to Death & 95% Confidence Intervals for the Median Survival Time for AM
## 
##                                           num_
##                   Obs     t1      t2     event    num_left      surv      stderr
## 
##                     1      10      10      1         54       0.98148    0.01835
##                     2      35      35      1         53       0.96296    0.02570
##                     3      48      48      1         52       0.94444    0.03117
##                     4      53      53      1         51       0.92593    0.03564
##                     5      79      79      1         50       0.90741    0.03945
##                     6      80      80      1         49       0.88889    0.04277
##                     7     105     105      1         48       0.87037    0.04571
##                     8     653     211      1         47       0.85185    0.04834
##                     9     222     219      1         46       0.83333    0.05072
##                    10    1499     248      1         45       0.81481    0.05286
##                    11     431     272      1         44       0.79630    0.05481
##                    12     288     288      1         43       0.77778    0.05658
##                    13     393     381      1         42       0.75926    0.05818
##                    14     390     390      1         41       0.74074    0.05964
##                    15     414     414      1         40       0.72222    0.06095
##                    16     522     421      1         39       0.70370    0.06214
##                    17     481     481      1         38       0.68519    0.06320
##                    18     583     486      1         37       0.66667    0.06415
##                    19    1356     606      1         36       0.64815    0.06499
##                    20     641     641      1         35       0.62963    0.06571
##                    21     704     704      1         34       0.61111    0.06634
##                    22    1156     748      1         33       0.59259    0.06686
##                    23    1063    1063      1         26       0.56980    0.06807
##                    24    1074    1074      1         25       0.54701    0.06905
##                    25    2204    2204      1          6       0.45584    0.10118
##                    26    2569    2569      0          1       0.45584    0.10118
##  
##                                                                                                    
##  
##                                                4.2 E
## Estimate of the Median Time to Death & 95% Confidence Intervals for the Median Survival Time for AM
## 
##                                        The LIFEREG Procedure
## 
##                                          Model Information
## 
##               Data Set                    WORK.TABLE4_2A                             
##               Dependent Variable                 Log(t2)    Disease Free Survial Time
##               Censoring Variable                    surv                             
##               Censoring Value(s)                       0                             
##               Number of Observations                  26                             
##               Noncensored Values                      26                             
##               Right Censored Values                    0                             
##               Left Censored Values                     0                             
##               Interval Censored Values                 0                             
##               Number of Parameters                     1                             
##               Name of Distribution           Exponential                             
##               Log Likelihood                -42.68008057                             
## 
## 
##                               Number of Observations Read          26
##                               Number of Observations Used          26
## 
## 
##                                       Parameter Information
##  
##                                       Parameter    Effect
## 
##                                       Intercept    Intercept
## 
## 
##                                           Fit Statistics
## 
##                          -2 Log Likelihood                         85.360
##                          AIC (smaller is better)                   87.360
##                          AICC (smaller is better)                  87.527
##                          BIC (smaller is better)                   88.618
## 
## 
##                                 Fit Statistics (Unlogged Response)
## 
##                          -2 Log Likelihood                        378.378
##                          Exponential AIC (smaller is better)      380.378
##                          Exponential AICC (smaller is better      380.545
##                          Exponential BIC (smaller is better)      381.636
## 
## 
##             Algorithm converged.                                                       
## 
## 
##                         Analysis of Maximum Likelihood Parameter Estimates
##  
##                                         Standard   95% Confidence     Chi-
##               Parameter     DF Estimate    Error       Limits       Square Pr > ChiSq
## 
##               Intercept      1   6.2765   0.1961   5.8921   6.6609 1024.26     <.0001
##               Scale          0   1.0000   0.0000   1.0000   1.0000                   
##               Weibull Scale  1 531.9231 104.3187 362.1717 781.2377                   
##               Weibull Shape  0   1.0000   0.0000   1.0000   1.0000                   
## 
## 
##                                   Lagrange Multiplier Statistics
##  
##                               Parameter     Chi-Square    Pr > ChiSq
## 
##                               Scale             0.2681        0.6046
##  
##                                                                                                    
##  
##                                                4.2 E
## Estimate of the Median Time to Death & 95% Confidence Intervals for the Median Survival Time for AM
## 
##                             Obs     t2     _PROB_      loci       hici
## 
##                               1      10     0.75     453.954    1020.85
##                               2      10     0.85     621.228    1397.02
##                               3      10     0.95     980.978    2206.02
##                               4      35     0.75     453.954    1020.85
##                               5      35     0.85     621.228    1397.02
##                               6      35     0.95     980.978    2206.02
##                               7      48     0.75     453.954    1020.85
##                               8      48     0.85     621.228    1397.02
##                               9      48     0.95     980.978    2206.02
##                              10      53     0.75     453.954    1020.85
##                              11      53     0.85     621.228    1397.02
##                              12      53     0.95     980.978    2206.02
##                              13      79     0.75     453.954    1020.85
##                              14      79     0.85     621.228    1397.02
##                              15      79     0.95     980.978    2206.02
##                              16      80     0.75     453.954    1020.85
##                              17      80     0.85     621.228    1397.02
##                              18      80     0.95     980.978    2206.02
##                              19     105     0.75     453.954    1020.85
##                              20     105     0.85     621.228    1397.02
##                              21     105     0.95     980.978    2206.02
##                              22     211     0.75     453.954    1020.85
##                              23     211     0.85     621.228    1397.02
##                              24     211     0.95     980.978    2206.02
##                              25     219     0.75     453.954    1020.85
##                              26     219     0.85     621.228    1397.02
##                              27     219     0.95     980.978    2206.02
##                              28     248     0.75     453.954    1020.85
##                              29     248     0.85     621.228    1397.02
##                              30     248     0.95     980.978    2206.02
##                              31     272     0.75     453.954    1020.85
##                              32     272     0.85     621.228    1397.02
##                              33     272     0.95     980.978    2206.02
##                              34     288     0.75     453.954    1020.85
##                              35     288     0.85     621.228    1397.02
##                              36     288     0.95     980.978    2206.02
##                              37     381     0.75     453.954    1020.85
##                              38     381     0.85     621.228    1397.02
##                              39     381     0.95     980.978    2206.02
##                              40     390     0.75     453.954    1020.85
##                              41     390     0.85     621.228    1397.02
##                              42     390     0.95     980.978    2206.02
##                              43     414     0.75     453.954    1020.85
##                              44     414     0.85     621.228    1397.02
##                              45     414     0.95     980.978    2206.02
##                              46     421     0.75     453.954    1020.85
##                              47     421     0.85     621.228    1397.02
##                              48     421     0.95     980.978    2206.02
##                              49     481     0.75     453.954    1020.85
##                              50     481     0.85     621.228    1397.02
##                              51     481     0.95     980.978    2206.02
##                              52     486     0.75     453.954    1020.85
##                              53     486     0.85     621.228    1397.02
##                              54     486     0.95     980.978    2206.02
##                              55     606     0.75     453.954    1020.85
##                              56     606     0.85     621.228    1397.02
##                              57     606     0.95     980.978    2206.02
##                              58     641     0.75     453.954    1020.85
##                              59     641     0.85     621.228    1397.02
##                              60     641     0.95     980.978    2206.02
##                              61     704     0.75     453.954    1020.85
##                              62     704     0.85     621.228    1397.02
##                              63     704     0.95     980.978    2206.02
##                              64     748     0.75     453.954    1020.85
##                              65     748     0.85     621.228    1397.02
##                              66     748     0.95     980.978    2206.02
##                              67    1063     0.75     453.954    1020.85
##                              68    1063     0.85     621.228    1397.02
##                              69    1063     0.95     980.978    2206.02
##                              70    1074     0.75     453.954    1020.85
##                              71    1074     0.85     621.228    1397.02
##                              72    1074     0.95     980.978    2206.02
##                              73    2204     0.75     453.954    1020.85
##                              74    2204     0.85     621.228    1397.02
##                              75    2204     0.95     980.978    2206.02
##                              76    2569     0.75     453.954    1020.85
##                              77    2569     0.85     621.228    1397.02
##                              78    2569     0.95     980.978    2206.02