# One-Sample Log-rank test statistic

Ok, I am totally confused, this is probably a pure math rather than a statistic question but please enlighten me.

I found the logrank statistic formula being reported in the literature in 2 ways, but I am not sure which one is correct. When I plug the same number in both formula, i get different results for the chi-square.

Which one should I use?

$O$ = total of observed events

$E$ = total of expected events

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

2. $$\frac{O-E}{\sqrt{E}}$$

Which one should be used? The main reason I am asking is because when I apply the weights (W) as in the formula below, it looks like the weights are being cancelled out: • That zero in #1 ('0') is meant to be an 'O' as in observed events, right? – Matt Krause Jul 25 '15 at 18:01
• yes, sorry my bad, edited – Paris Char Jul 26 '15 at 17:16
• I think both are correct. – Deep North Jul 27 '15 at 1:13
• The first thing you mention is simply the square of the second. Neither is exactly a log rank statistic, since that would involve some kind of sum of terms. Compare your second proposal with the statistic here for example and note several differences. – Glen_b -Reinstate Monica Jul 27 '15 at 1:15
• O and E are sums. Sorry my bad. – Paris Char Jul 27 '15 at 1:59 • Do you mean you try to cancel W for this ratio $\frac{\left \{ \sum_i^DW(t_i)\frac{d_i}{Y(t_i)}-\int_{0}^{r}W(s)b_0(s)ds \right \}^2}{\int_{0}^{r}W^2(s)\frac{b_0(s)}{y(s)}ds}$ ?W is a function or a random variable, I don't understand how you cancel them out? Now, i even don't know how to show it is a $\chi^2$ distribution. – Deep North Jul 28 '15 at 14:01
• No, I think $\int_{0}^{r}W^2(s)\frac{b_0(s)}{Y(s)}ds$ itself is the variance when the Expected value $E(W(s))$ is zero. Also, do you remember the definition of variance is $E(X^2)-[E(X)]^2$ and $E(X^2)=\int_{-\infty}^{\infty}x^2f(x)dx$ this is exactly the same when E(X)=0. I think you cannot factor out W here. It is not a constant, it is a random variable(function). – Deep North Jul 29 '15 at 0:01