The logrank test statistic compares estimates of the
hazard functions of the two groups at each observed event time. It is constructed by computing the observed and expected number of events in one of the groups at each observed event time and then adding these to obtain an overall summary across all-time points where there is an event. Consider two groups of patients, e.g., treatment vs. control. Let 1, \ldots, J be the distinct times of observed events in either group. Let N_{1,j} and N_{2,j} be the number of subjects "at risk" (who have not yet had an event or been censored) at the start of period j in the groups, respectively. Let O_{1,j} and O_{2,j} be the observed number of events in the groups at time j. Finally, define N_j = N_{1,j} + N_{2,j} and O_j = O_{1,j} + O_{2,j}. The
null hypothesis is that the two groups have identical hazard functions, H_0 : h_1(t) = h_2(t). Hence, under H_0, for each group i = 1, 2, O_{i,j} follows a
hypergeometric distribution with parameters N_j, N_{i,j}, O_j. This distribution has expected value E_{i,j} = O_j \frac{N_{i,j}}{N_j} and variance V_{i,j} = E_{i,j} \left( \frac{N_j - O_j}{N_j} \right) \left( \frac{N_j - N_{i,j}}{N_j - 1} \right). For all j = 1, \ldots, J, the logrank statistic compares O_{i,j} to its expectation E_{i,j} under H_0. It is defined as :Z_i = \frac {\sum_{j=1}^J (O_{i,j} - E_{i,j})} {\sqrt {\sum_{j=1}^J V_{i,j}}}\ \xrightarrow{d}\ \mathcal N(0,1) (for i=1 or 2) It is easy to see that for all j, O_{2,j} - E_{2,j} = -(O_{1,j} - E_{1,j}) and V_{2,j} = V_{1,j}, so Z_2 = -Z_1. By the
central limit theorem, the distribution of each Z_i converges to that of a standard normal distribution as J approaches infinity and therefore can be approximated by the standard normal distribution for a sufficiently large J. An improved approximation can be obtained by equating this quantity to Pearson type I or II (beta) distributions with matching first four moments, as described in Appendix B of the Peto and Peto paper. ==Asymptotic distribution==