# How to calculate log-rank test statistic

Depending on which statistics text you read you will get 2 different formulations of the log-rank test statistic. In some texts you will see it specified as:

$$\frac{(O-E)^2}{E}$$ Example 1

Whilst in others you will see it as $$\frac{(O-E)^2}{V}$$

My questions are:

• Do these variants have specific names?
• Do they have any differences in properties?
• When should one be used over the other?

## 1 Answer

The first one is related to the chi-squared test. The second one is the log-rank test that I am aware of. The problem with running a chi-squared test in survival statistics is that the tests at various time points are not independent (i.e. to be considered for a later time point someone must survive an earlier time point), so I would not recommend using it. In general with survival analysis use the second variant (truly I think it is the primary methodology).

It can be shown that the second variant approaches a z-distribution (N(0,1)) and a chi-squared distribution with one degree of freedom when squaring the statistic as shown here.