# The ICLIFETEST Procedure

### Example 62.4 Outputting Scores for Permutation Tests

Recall the breast cancer data in the example in the section Getting Started: ICLIFETEST Procedure. The following statements perform the generalized log-rank test to compare the survival distributions between two treatments by using Finkelstein’s weights and save the corresponding scores to a SAS data set named `Out`:

```proc iclifetest data=bcs impute(seed=123);
time (ltime,rtime);
test trt/weight=finkelstein outscore=out;
run;
```

Fay (1999) describes how to perform permutation tests by using these generated scores. PROC NPAR1WAY can do such tests and compute p-values based on normal theory approximation or Monte Carlo simulation. You need to specify the input data and specify SCORES=DATA, as follows:

```proc npar1way data=out scores=data;
class trt;
var score;
exact scores=data / mc seed=1234;
run;
```

The variable `Trt` is specified in the CLASS statement so that permutations are done for the groups formed by different levels of the variable. The MC option performs a Monte Carlo version of the permutation test and computes the p-values by using Monte Carlo samples. Output 62.4.1 shows the results from the test based on normal theory approximation.

Output 62.4.1: Asymptotic Permutation Test

The NPAR1WAY Procedure

Data Scores Two-Sample Test
Statistic (S) -9.9442
Z -2.6839
One-Sided Pr < Z 0.0036
Two-Sided Pr > |Z| 0.0073

Output 62.4.2 displays the p-values that are calculated from the Monte Carlo samples.

Output 62.4.2: Monte Carlo Permutation Test

Monte Carlo Estimates for the Exact Test
One-Sided Pr <= S
Estimate 0.0033
99% Lower Conf Limit 0.0018
99% Upper Conf Limit 0.0048

Two-Sided Pr >= |S - Mean|
Estimate 0.0064
99% Lower Conf Limit 0.0043
99% Upper Conf Limit 0.0085

Number of Samples 10000
Initial Seed 1234

Output 62.4.3 displays the results of the generalized log-rank statistics from using Finkelstein’s weights. As you can see, it matches the two-sample test statistic of the permutation test.

Output 62.4.3: Generalized Log-Rank Statistics Using Finkelstein’s Weights

The ICLIFETEST Procedure

Generalized Log-Rank
Statistics
trt Log-Rank
RT -9.94418
RCT 9.944182