**********************************************************;
* Analyze two samples using nonparametric and parametric procedures
**********************************************************;

title 'TWO SAMPLES BY VARIOUS METHODS';
options ls=75 ps=60 pageno=1 nocenter;

data twosamp;
     retain group;
     input zz$ @@;
     if zz='XX' or zz='YY' then  group=zz;
     else do;  tval=input(zz,12.0);
               days=abs(tval);  status=(tval<0);
               output;  end;
datalines;
  XX
   1  2  4  -8  14  -17
  YY
   3  9  -17  22  35
   run;


**********************************************************;
* Draw `s', `ls', and `lls' plots for the two groups and
*   see if the LogRank, Wilcoxon, and -logLR tests are significant.
**********************************************************;

* Change the page height for nicer lineprinter plots;
options ps=35;

proc lifetest plots=(s,ls,lls) notable lineprinter;
     title2 'S, LS, and LLS PLOTS AND NONPARAMETRIC TESTS';
     strata group;
     time days*status(1);
     run;

* Restore the page height;
options ps=60;


proc lifereg;
     class group;
     title2 'APPLYING AN AFT MODEL FOR AN EXPONENTIAL DISTRIBUTION';
     model days*status(1) = group / dist=exponential;
     run;


proc lifereg;
     class group;
     title2 'APPLYING AN AFT MODEL FOR A WEIBULL DISTRIBUTION';
     model days*status(1) = group / dist=Weibull;
     run;



