Two-Sample Quantile Test SAS Macro for Right Censored Survival Data

The general algorithm used for two-sample quantile testing for right censored survival data is described in detail in the paper "Two-sample quantile tests under general conditions" by Michael R. Kosorok, which appeared in Biometrika (1999) and can be downloaded by clicking here. We now discuss a simple SAS implementation of the special setting for two independent right censored survival samples. The SAS macro was written by Minjung Kwak under guidence from Michael R. Kosorok. The project was initiated at the request of Mike Mosier and fully funded by EMB Statistical Solutions, LLC. The null hypothesis tested is that the quantiles, with quantile probability p, are equal but that other aspects of the distributions may differ between the two samples. We recommend reading the paper thoroughly before using the macro described below.

To incorporate the software into SAS, insert the code obtained by clicking here into SAS. To do this in a unix environment, copy and paste this code in a SAS program window and then submit it. This procedure will define the macro. Or you can simply add this code into your SAS program ahead of any place where you actually wish to use the macro.



The macro qtest.sas will calculate the two-sample quantile statistics and the p-value for the two-sample test. The distribution for sample 1 is denoted F, while the distribution for sample 2 is denoted G.

The Input Parameters are:

Output Dataset _QTEST includes the following variables:

Example :

   %SurvQtest(data1=mydat1,data2=mydat2,time1=x,time2=x,p=0.5);



Funding for this software was provided by EMB Statistical Solutions, LLC. The software was written by Minjung Kwak under advice from Michael R. Kosorok in March, 2005.