2. Rank Test (Reliability)
The Rank Test is the most widely used method for comparing survival curves. It is useful for comparing a new process with an old one, comparing two products in terms of lifetime or, more generally, checking whether the survival curves of two or more groups differ significantly.
Input fields
| Field | Description |
|---|---|
| Times | Numeric column with the times to failure or censoring. |
| Groups | Column with the groups to compare. |
| Censorship Indicator | Column with 1 for failure and 0 for censoring. |
| Frequencies (optional) | Column with the number of items in each row (summarized data). |
| Weighted Log Rank (LRP) | Computes the Log-rank test with the weight chosen in Type. |
| Cramér-von Mises (CVM) | Computes the Cramér-von Mises test, which is sensitive to differences in any part of the curves. |
| Covariance matrix | Classic or Optimized. |
| Type | Test weight: Log-rank, Gehan, Tarone-Ware, Fleming-Harrington, Peto-Peto, Modified Peto-Peto, Fit Quality, or All. |
| Gamma and Rho | Constants of the Fleming-Harrington weight. For the other weights, the values are fixed by the method. |
| Comparison Selection | Enables multiple comparisons (Combination 2 to 2 or Treatment x Control) when there are more than two groups. |
| FWER or FDR | Level and correction method for multiple comparisons: Simes-Hochberg, Holm, Bonferroni, or Hommel (FWER); Benjamini-Hochberg or Benjamini-Yekutieli (FDR). |
Details
The test evaluates the hypotheses
$$H_0: S_1(t) = S_2(t) \text{ for all } t \qquad \text{versus} \qquad H_1: S_1(t) \neq S_2(t) \text{ for some } t$$
where $S_1(t)$ and $S_2(t)$ are the survival functions of groups 1 and 2. At each failure time, the Log-rank statistic compares the observed number of failures in each group with the number expected under $H_0$. The weights (Gehan, Tarone-Ware, Peto-Peto, etc.) give more importance to differences at the beginning or at the end of the curves. The Cramér-von Mises test measures the distance between the curves over the whole period and is better at detecting differences when the curves cross.
Example 1: packaging, complete data
A cream cheese (requeijão) producer runs a durability test on the product, which is sold at room temperature and without preservatives. The event of interest is the appearance of mold. Twenty units were evaluated in each of two packages, A and B, with time measured in hours. Units without mold at the end of the test are censored.
Is there a difference between the two packages in terms of product durability?
The data are in three columns: Tempos, Censura (1 = mold appeared, 0 = censored), and Grupo (A or B). Load the example Confiabilidade — embalagens teste rank in Data upload › Examples.

Open Reliability › Rank Test (Reliability) and fill in:
- Times:
Tempos; Groups:Grupo; Censorship Indicator:Censura. - Keep Weighted Log Rank (LRP) and Cramér-von Mises (CVM) checked, with the Classic covariance matrix and the Log-rank type.
- Since there are only two groups, there is no need to check Comparison Selection.
- Click Calculate.

Results
Group comparison
| Weight | Statistic | P-value | |
|---|---|---|---|
| Cramér-von Mises (CVM) 1 | LogRank | 47.4731 | 0.1103 |
| Weighted Log Rank (LRP) 1 | LogRank | 0.0064 | 0.9362 |
Group comparison summary
| Groups | Time | Number of events | Number at risk | Standard Deviation | Survival Function | Lower limit | Upper limit | Intensity Function | Lower limit | Upper limit |
|---|---|---|---|---|---|---|---|---|---|---|
| A | 31 | 1 | 20 | 0.0487 | 0.95 | 0.854 | 1 | 0.05 | 0.0452 | 0.0548 |
| A | 40 | 1 | 19 | 0.0671 | 0.9 | 0.769 | 1 | 0.1 | 0.0869 | 0.1131 |
| A | 43 | 1 | 18 | 0.0798 | 0.85 | 0.694 | 1 | 0.15 | 0.1265 | 0.1735 |
| A | 44 | 1 | 17 | 0.0894 | 0.8 | 0.625 | 0.975 | 0.2 | 0.1649 | 0.2351 |
| A | 46 | 2 | 16 | 0.102 | 0.7 | 0.499 | 0.901 | 0.3 | 0.2397 | 0.3603 |
| A | 47 | 1 | 14 | 0.107 | 0.65 | 0.441 | 0.859 | 0.35 | 0.2768 | 0.4232 |
| A | 48 | 2 | 13 | 0.111 | 0.55 | 0.332 | 0.768 | 0.45 | 0.3519 | 0.5481 |
| A | 49 | 1 | 11 | 0.112 | 0.5 | 0.281 | 0.719 | 0.5 | 0.3904 | 0.6096 |
| A | 50 | 2 | 10 | 0.11 | 0.4 | 0.185 | 0.615 | 0.6 | 0.4712 | 0.7288 |
| A | 60 | 4 | 8 | 0.0894 | 0.2 | 0.0247 | 0.375 | 0.8 | 0.6598 | 0.9402 |
| B | 48 | 2 | 20 | 0.0671 | 0.9 | 0.769 | 1 | 0.1 | 0.0869 | 0.1131 |
| B | 49 | 4 | 18 | 0.102 | 0.7 | 0.499 | 0.901 | 0.3 | 0.2397 | 0.3603 |
| B | 50 | 4 | 14 | 0.112 | 0.5 | 0.281 | 0.719 | 0.5 | 0.3904 | 0.6096 |
| B | 53 | 2 | 10 | 0.11 | 0.4 | 0.185 | 0.615 | 0.6 | 0.4712 | 0.7288 |
| B | 54 | 3 | 8 | 0.0968 | 0.25 | 0.0602 | 0.44 | 0.75 | 0.6077 | 0.8923 |
| B | 55 | 1 | 5 | 0.0894 | 0.2 | 0.0247 | 0.375 | 0.8 | 0.6598 | 0.9402 |
Interpretation
- The Log-rank test has a p-value of 0.9362. At the 5% significance level, we do not reject $H_0$: there is no evidence of a difference between the two packages in terms of product durability.
- The Cramér-von Mises test also does not reject $H_0$ (p-value of 0.1103), but its p-value is much smaller. This happens because the curves cross: package A has earlier failures (31 to 47 hours), while B only has failures from 48 hours on, yet ends the test with similar survival. The Log-rank test offsets differences of opposite sign and loses power in this case.
- For each group and time, the summary table gives the Kaplan-Meier survival function, the cumulative intensity, and the corresponding confidence intervals.
Example 2: packaging, summarized data
With summarized data, each row gives the number of units with the same time, the same censoring status, and the same group:
| Tempos | Censura | Grupo | Frequencia |
|---|---|---|---|
| 31 | 1 | A | 1 |
| 46 | 1 | A | 2 |
| 49 | 1 | B | 4 |
| ⋮ | ⋮ | ⋮ | ⋮ |
| 55 | 0 | B | 4 |
| 60 | 1 | A | 4 |
| 60 | 0 | A | 4 |
Load the example Confiabilidade — embalagens teste rank resumido, repeat the settings of Example 1, and select Frequencia in Frequencies (optional).

The results are the same as in Example 1 (Log-rank with a p-value of 0.9362 and Cramér-von Mises with a p-value of 0.1103).
References
- J. F. Lawless (1982). Statistical Models and Methods for Lifetime Data. John Wiley & Sons.
- T. R. Fleming and D. P. Harrington (1991). Counting Processes and Survival Analysis. John Wiley & Sons.