# Wei-Lachin Test

Menu location: **Analysis_Survival_Wei-Lachin**.

This function gives a two sample distribution free method for the comparison of two multivariate distributions of survival (time-to-event) data that may be censored (incomplete, e.g. alive at end of study or lost to follow up). Multivariate methods such as this should be used only with expert statistical guidance.

Wei and Lachin generalise the Log-rank and Gehan generalised Wilcoxon tests (using a random censorship model) for multivariate survival data with two main groups. (Makuch and Escobar, 1991; Wei and Lachin, 1984).

__Data preparation__

StatsDirect asks you for a group identifier, this could be a column of 1 and 2 representing the two groups. You then select k pairs of survival time (time-to-event) and censorship columns for k repeat times. Censored data are coded as 0 and uncensored data are coded as 1.

Repeat times may represent separate factors or the observation of the same factor repeated on k occasions. For example, time to develop symptoms could be analysed for k different symptoms in a group of patients treated with drug x and compared with a group of patients not treated with drug x.

Missing data can be code either by entering a missing data symbol * as the time, or by setting censored equal to 0 and time less than the minimum uncensored time in your data set.

For further details please refer to Makuch and Escobar (1991) and Wei and Lachin (1984).

__Technical Validation__

Wei and Lachin's multivariate tests are calculated for the case to two multivariate distributions, and the intermediate univariate statistics are given. The algorithm used for the method is that given by Makuch and Escobar (1991).

The general univariate statistic for comparing the time to event (of component type k out of m multivariate components) of the two groups is calculated as:

- where n_{1} is the number of event times per component in group 1; n^{2} is the number of event times per component in group 2; n is the total number of event times per component; r_{ik} is the number at risk at time t(i) in the kth component; Δ is equal to 0 if an observation is censored or 1 otherwise; e_{ik} is the expected proportion of events in group i for the kth component; and w_{j} is equal to 1 for the log-rank method or (r_{1k}+r_{2k})/n for the Gehan-Breslow generalised Wilcoxon method.

The univariate statistic for the kth component of the multivariate survival data is calculated as:

- where σ hat_{kk} is the kth diagonal element of the estimated variance-covariance matrix that is calculated as described by Makuch and Escobar (1991).

An omnibus test that the two multivariate distributions are equal is calculated as:

- where **T'** is the transpose of the vector of univariate test statistics and **Σ**^{-1} is the generalised inverse of the estimated variance-covariance matrix.

A stochastic ordering test statistic is calculated as:

Note that the P value given with the stochastic ordering (linear combination) statistic is two sided, some authors prefer one sided inference (Davis, 1994). If you make a one sided inference then you are considering only ascending or only descending ordering, and you are assuming that observing an order in the opposite direction to that expected would be unimportant to your conclusions.

The test statistics are all asymptotically normally distributed.

__Example__

From Makuch and Escobar (1991).

Test workbook (Survival worksheet: Treatment Gp, Time m1, Censor m1, Time m2, Censor m2, Time m3, Censor m3, Time m4, Censor m4).

The following data represent the times in days it took in vitro cultures of lymphocytes to reach a level of p24 antigen expression. The cultures where taken from patients infected with HIV-1 who had advanced AIDS or AIDS related complex. The idea was that patients whose cultures took a short time to express p24 antigen had a greater load of HIV-1. The two groups represented patients on two different treatments. The culture was run for 30 days and specimens which remained negative or which became contaminated were called censored (=0). The tests were run over four 30 day periods.

Treatment Gp | time m1 | censor m1 | time m2 | censor m2 | time m3 | censor m3 | time m4 | censor m4 |

1 | 8 | 1 | 0 | 0 | 25 | 0 | 21 | 1 |

1 | 6 | 1 | 4 | 1 | 5 | 1 | 5 | 1 |

1 | 6 | 1 | 5 | 1 | 28 | 0 | 18 | 1 |

1 | 14 | 0 | 35 | 0 | 23 | 1 | 19 | 0 |

1 | 7 | 1 | 0 | 0 | 13 | 1 | 0 | 0 |

1 | 5 | 1 | 4 | 1 | 27 | 1 | 8 | 1 |

1 | 5 | 1 | 21 | 0 | 6 | 1 | 14 | 1 |

1 | 6 | 1 | 10 | 1 | 14 | 1 | 18 | 1 |

1 | 7 | 1 | 4 | 1 | 15 | 1 | 8 | 1 |

1 | 6 | 1 | 5 | 1 | 5 | 1 | 5 | 1 |

1 | 4 | 1 | 5 | 1 | 6 | 1 | 3 | 1 |

1 | 5 | 1 | 4 | 1 | 7 | 1 | 5 | 1 |

1 | 21 | 0 | 5 | 1 | 0 | 0 | 6 | 1 |

1 | 13 | 1 | 27 | 0 | 21 | 0 | 8 | 1 |

1 | 4 | 1 | 27 | 0 | 7 | 1 | 6 | 1 |

1 | 6 | 1 | 3 | 1 | 7 | 1 | 8 | 1 |

1 | 6 | 1 | 0 | 0 | 5 | 1 | 5 | 1 |

1 | 6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 | 1 | 12 | 1 |

2 | 3 | 1 | 6 | 1 | 7 | 1 | 9 | 1 |

To analyse these data in StatsDirect you must first prepare them in 9 workbook columns as shown above. Alternatively, open the test workbook using the file open function of the file menu. Then select Wei-Lachin from the Survival Analysis section of the analysis menu. Select the column marked "Treatment GP" when asked for the group identifier. Next, enter the number of repeat times as four. Select "time m1" and "censor m1" for time and censorship for repeat time one. Repeat this selection process for the other three repeat times.

For this example:

__Wei-Lachin Analysis__

__Univariate Generalised Wilcoxon (Gehan)__

total cases = 47 by group = 23 24

Observed failures by group = 20 23

repeat time = 1

Wei-Lachin t = -0.527597

Wei-Lachin variance = 0.077575

z = -1.89427

chi-square = 3.588261, P = .0582

Observed failures by group = 14 21

repeat time = 2

Wei-Lachin t = 0.077588

Wei-Lachin variance = 0.056161

z = 0.327397

chi-square = 0.107189, P = .7434

Observed failures by group = 18 19

repeat time = 3

Wei-Lachin t = -0.11483

Wei-Lachin variance = 0.060918

z = -0.465244

chi-square = 0.216452, P = .6418

Observed failures by group = 20 16

repeat time = 4

Wei-Lachin t = 0.335179

Wei-Lachin variance = 0.056281

z = 1.412849

chi-square = 1.996143, P = .1577

__Multivariate Generalised Wilcoxon (Gehan)__

Covariance matrix:

0.077575 | |||

0.026009 | 0.056161 | ||

0.035568 | 0.020484 | 0.060918 | |

0.023525 | 0.016862 | 0.026842 | 0.056281 |

Inverse of covariance matrix:

19.204259 | |||

-5.078483 | 22.22316 | ||

-8.40436 | -3.176864 | 25.857118 | |

-2.497583 | -3.020025 | -7.867237 | 23.468861 |

repeat times = 4

chi squared omnibus statistic = 9.242916 P = .0553

stochastic ordering z = -0.30981 one sided P = 0.3784, two sided P = 0.7567

__Univariate Log-Rank__

total cases = 47 by group = 23 24

Observed failures by group = 20 23

repeat time = 1

Wei-Lachin t = -0.716191

Wei-Lachin variance = 0.153385

z = -1.828676

chi-square = 3.344058, P = .0674

Observed failures by group = 14 21

repeat time = 2

Wei-Lachin t = -0.277786

Wei-Lachin variance = 0.144359

z = -0.731119

chi-square = 0.534536, P = .4647

Observed failures by group = 18 19

repeat time = 3

Wei-Lachin t = -0.372015

Wei-Lachin variance = 0.150764

z = -0.9581

chi-square = 0.917956, P = .338

Observed failures by group = 20 16

repeat time = 4

Wei-Lachin t = 0.619506

Wei-Lachin variance = 0.143437

z = 1.635743

chi-square = 2.675657, P = .1019

__Multivariate Log-Rank__

Covariance matrix:

0.153385 | |||

0.049439 | 0.144359 | ||

0.052895 | 0.050305 | 0.150764 | |

0.039073 | 0.047118 | 0.052531 | 0.143437 |

Inverse of covariance matrix:

7.973385 | |||

-1.779359 | 8.69056 | ||

-1.892007 | -1.661697 | 8.575636 | |

-0.894576 | -1.761494 | -2.079402 | 8.555558 |

repeat times = 4

chi squared omnibus statistic = 9.52966, P = .0491

stochastic ordering z = -0.688754, one sided P = 0.2455, two sided P = 0.491

Here the multivariate log-rank test has revealed a statistically significant difference between the treatment groups which was not revealed by any of the individual univariate tests. For more detailed discussion of each result parameter see Wei and Lachin (1984).