Nonparametric Techniques
On this page

Book

7 Nonparametric Techniques

91 min read

All basic statistical procedures—the T test, the F test, the analysis of variance (ANOVA), among others—rely heavily on the assumption that the sample data (or sufficient statistics) are distributed according to a specific distribution. But for every classic test, there is a non-parametric alternative with fewer assumptions about the data. Even if the hypotheses based on a parametric model are modest and not very restrictive, they will undoubtedly be false, in the purest sense.

Parametric tests assume that the probability distribution of the population from which we draw data is known and that only the values ​​of certain parameters, such as the mean and standard deviation, are unknown. If the data does not satisfy the assumptions made by traditional techniques, non-parametric methods of statistical inference should be used. Non-parametric techniques make little or no assumptions about the probability distribution of the population from which we draw data.

From the 1940s onwards, the idea of rank tests gained strength in statistical literature. Hotelling and Pabst (1936) wrote one of the first articles on the subject, order correlations. Since then, we have non-parametric tests for one sample, for comparing two or more samples, for paired samples, bivariate correlation and much more. The key to evaluating data in a nonparametric framework is to compare observations based on their rank within the sample. The following table shows the analogies of non-parametric tests to known parametric procedures.

Parametric Non-Parametric
Pearson Coefficient for Correlation Spearman Coefficient for Correlation
1-Sample t-test Wilcoxon 1-Sample Test
Paired t-test Paired Wilcoxon Test
2 Sample t-test Wilcoxon-Mann-Whitney Independent Samples Test
ANOVA Kruskal-Wallis test
ANOVA factorial experiment in blocks Friedman test

Wilcoxon.png

Figure: Frank Wilcoxon (1892-1965). Henry Berthold Mann (1905-2000) and Professor Emeritus Donald Ransom Whitney.

In general, non-parametric methods are applied to inference problems in which the distributions of the populations involved do not need to belong to a specific family of probability distributions such as Normal, Uniform, Exponential, etc. Therefore, non-parametric tests are also called distribution free tests.

7.1 Wilcoxon Test - Single Sample

Let us consider a population P with continuous and symmetrical distribution from which we take a random sample $X_{1}$, $X_{2}$, …, $X_{n}$ . Our interest is to study the behavior of the population median in relation to a value $θ_{0}$ specified.

populacao_amostra_0.png

The Wilcoxon test is based on the ranks of the values ​​obtained. Ranks are the positions, represented by numbers, that values ​​occupy when placed in ascending order. For example, consider the following set of values:

12 17 15 19 14 16 11

Putting in ascending order and assigning each value its rank, we have

Value 11 12 14 15 16 17 19
Post 1 2 3 4 5 6 7

The following hypotheses are necessary for the development of this hypothesis test:

  1. The observations $X_{i}$’s are independent.

  2. Each observation $X_{i}$ is obtained from a population that is continuous and symmetric about $θ_{0}$. In this way, we admit that the probability (in theory) that two sample values ​​coincide is zero.

To perform the Wilcoxon test, we established one of the following hypotheses:

Screenshot_1

which are equivalent to the hypotheses

Screenshot_2

Initially we must subtract $θ_{0}$ of each value $X_{i}$, i = 1, …, n, of the sample and thus we obtain a new set of data, $Z_{1}$, $Z_{2}$, …, $Z_{n}$ where $Z_{i}$ = $X_i-θ_{0}$.

We sort the new data set in ascending order {$|Z_{1}|, |Z_{2}|, …, |Z_{n}|$} (note that we ordered the set of absolute values, that is, we did not consider the sign of the element $Z_{i}$) and we associate it with each value $Z_{i}$ the post $R_{i}$ corresponding. Next, we define the indicator variables $ψ_{i}$, i = 1, 2, …, n, given by

Screenshot_3

that is, if $X_i-θ_{0 }$> 0, then $ψ_{i }$= 1, otherwise $ψ_{i}$ = 0.

We get the n products $R_1ψ_{1}$, …, $R_nψ_{n}$. Each product $R_iψ_{i}$ is called positive rank $Z_{i}$. In this case, if $Z_{i}$ > 0, $R_iψ_{i}$ is the same as the position $R_{i}$ corresponding and if $Z_{i}$ < 0, $R_iψ_{i}$ é igual a 0.

Definimos a estatística $T^{+}$ como a soma dos postos que têm sinal positivo, ou seja, $$T^+=\sum_i^n R_i\psi_i$$

Exemplo 1.1

Considere a seguinte amostra

126 142 156 228 245 246
370 419 433 454 478 503

Suponha que os dados da amostra são distribuídos simetricamente em torno da mediana $θ_{0}$ = 220.

Subtraindo o valor 220 de cada valor da amostra temos um novo conjunto de dados:

-94 -78 -64 8 25 26 150 199 213 234 258 283

Colocando em ordem crescente os valores absolutos, associamos à cada valor o posto correspondente $(R_{i}$) e as variáveis indicadoras $ψ_{i}$.

Valor 8 25 26 -64 -78 -94 150 199 213 234 258 283
Posto 1 2 3 4 5 6 7 8 9 10 11 12
ψi 1 1 1 0 0 0 1 1 1 1 1 1

Tabela 1.1: Postos combinados para uma amostra única.

Neste caso, a estatística $T^{+}$ é a soma dos postos positivos, isto é $$T^+=\sum_{i=1}^{12} R_i\psi_i = 1 + 2 + 3 + 7 + 8 + 9 + 10 + 11 + 12 = 63.$$

7.1.1 Um estimador do parâmetro de posição

Na tentativa de estimar o parâmetro de posição θ, consideraremos as médias ($X_i$+$X_j$)/2 entre as observações $X_i$ e $X_j$ tais que i ≤ j. Neste caso, se temos n observações da população, segue que temos M = n(n+1)/2 médias desse tipo. O estimador de θ associado com a estatística $T^{+}$ do teste de Wilcoxon é

Screenshot_4

Be $W^{(1)}$, $W^{(2)}$, …, $W^{(M)}$ the ordered values of $(X_i+X_j)/2$ with i ≤ j. So, if M is odd, i.e. M = 2k + 1, then k = (M-1)/2 and $$\hat{\theta}=W^{(k+1)},$$

which is the value that occupies position k + 1 in the list of averages ($X_i+X_j$)/2. If M is even, that is, M = 2k, then k = M/2 and $$\hat{\theta}=\frac{W^{(k)}+W^{(k+1)}}{2}.$$

That is, when M is even, $\hat{\theta}$ is the average of the two values ($X_i+X_j$)/2 that occupy positions k and k + 1.

Definition 1.1.1

The estimator $\hat{\theta}$ is called the pseudo-median.

Example 1.1.1

Find the pseudo-median for the following data set

-4 -3 -1 2 5 6

We have the averages ($X_i+X_j$)/2 between observations $X_i$ and $X_j$ such that i ≤ j ordinates are given in the table below

-4 -3,5 -3 -2,5 -2 -1 -1
-0,5 0,5 0,5 1 1 1,5 2
2 2,5 3,5 4 5 5,5 6

Since we have 6 observations, we have 6(6+1)/2 = 21 averages between observations $X_i$ and $X_j$ with i ≤ j. As M = 21 is an odd number, then we have that the pseudo-median will be observation 11, that is $$\hat{\theta}=1.$$

7.1.2 Exact distribution of the Wilcoxon statistic

To find the exact distribution of $T^{+}$ under $H_0$, consider B the number of $Z_i’s$ positive ($Z_i = X_i - θ_0$) and are $r_1$ < … < $r_B$ os ranks (posições) ordenadas dos valores absolutos destes $Z_i’s$ positivos. Podemos obter a distribuição diretamente da representação $T^+=\sum_{i=1}^Br_i$. Sob a hipótese de que as distribuições de cada $Z_i$ são todas contínuas, a probabilidade de que os valores absolutos de $Z_i’s$ sejam iguais ou que algum $Z_i$ seja 0 é zero. Além disso, sob $H_0$ as distribuições de todos os $Z_i’s$ são simétricas em torno de θ = $θ_0$. Portanto, se temos uma amostra de n elementos, temos 2^n possibilidades para a configuração ($r_1, r_2, …, r_B$) e cada uma delas ocorre com probabilidade (1/2)^n. Neste caso, temos que

$$P(T^+=t)=\frac{u(t)}{2^n}$$

onde u(t) é o número de maneiras de atribuir valores para as configurações ($r_1, r_2, …, r_B$) de forma que $$\sum_{i=1}^Br_i=t.$$

Exemplo 1.2.1

Considere o caso em que temos uma amostra de n = 3 elementos.

Neste caso, temos $2^3$ = 8 possíveis configurações para ($r_1, r_2, …, r_B$) e os valores associados de $T^{+}$ são dados na seguinte tabela.

B (r1, r2, …, rB) Probability under $H_0$ $ T^+=\sum_{i=1}^Br_i $
0 1/8 0
1 r1 = 1 1/8 1
1 r1 = 2 1/8 2
1 r1 = 3 1/8 3
2 r1 = 1, r2 = 2 1/8 3
2 r1 = 1, r2 = 3 1/8 4
2 r1 = 2, r2 = 3 1/8 5
3 r1 = 1, r2 = 2, r3 = 3 1/8 6

Assim, para este exemplo, a probabilidade de $T^{+}$ ser igual a 3 (P[$T^{+}$ = 3]) é igual a 2/8 já que o evento $T^{+}$ = 3 ocorre quando B = 1 ($r_1 = 3$) ou quando B = 2 ($r_1 = 1, r_2 = 2$) e cada uma dessas ocorrências ocorre com probabilidade 1/8.

$T^{+}$ Probabilidade sob $H_0$
0 1/8
1 1/8
2 1/8
3 2/8
4 1/8
5 1/8
6 1/8

Em um teste de Wilcoxon em que o tamanho amostral n é pequeno (geralmente n < 50) utilizamos a distribuição exata da estatística $T^{+}$ e, a partir desta distribuição, calculamos os valores críticos do teste, o p-valor e o intervalo de confiança.

  1. Cálculo dos valores críticos.

Se estamos realizando um teste bilateral, então devemos encontrar os valores críticos $t_1$ e $t_2$ tais que $$P[T^+ \ < \ t_1] = P[T^+ \ > \t_2]\approx \frac{\alpha}{2}.$$

Se o teste é unilateral à direita, então devemos encontrar o valor crítico t tal que $$P[T^+ \ > \ t] \approx \alpha$$

e se o teste é unilateral à esquerda, então devemos encontrar o valor crítico t tal que $$PT^+ \ < \ t] \approx \alpha.$$

  1. Critério.

Se o teste é bilateral e

$$T^{+}_{obs} < t_1$$

ou $$T^{+}_{obs} > t_2$$

então rejeitamos $H_0$, caso contrário não rejeitamos $H_0$. Ou seja, se $t_1$ ≤ $T^{+}_{obs}$ ≤ $t_2$, não rejeitamos a hipótese nula $H_0$.

No caso do teste unilateral à direita, se $T^{+}$ > t, rejeitamos a hipótese $H_0$, caso contrário não rejeitamos $H_0$. Isto é, se $T^{+}$ ≤ t não rejeitamos a hipótese nula $H_0$.

Se o teste é unilateral à esquerda e $T^{+}$ < t, rejeitamos a hipótese $H_0$, caso contrário não rejeitamos $H_0$. Isto é, se $T^{+}$ ≥ t não rejeitamos a hipótese nula $H_0$.

  1. Cálculo do p-valor.

Se o teste é bilateral, o p-valor do teste exato é dado por

Screenshot_5

Se o teste é unilateral à direita, o p-valor do teste exato é dado por $$P-value=P(T^+ \ > \ T^+_{obs}-1)$$

e se o teste é unilateral à esquerda, o p-valor do teste exato é dado por $$P-value=P(T^+ \leq \ T^+_{obs}).$$

  1. Intervalo de Confiança para o parâmetro de posição.

De forma análoga à estimativa do parâmetro de posição, consideramos as médias $(X_i+X_j)/2$ entre as observações $X_i$ e $X_j$ tal que i ≤ j. Neste caso, se temos n observações da população, segue que temos M = n(n+1)/2 médias desse tipo.

Sejam $W^{(1)}, W^{(2)}, …, W^{(M)}$ os valores ordenados desta médias.

Se o teste é bilateral e o nível de significância é α encontramos os valores L e U tais que $$P(T^+ \leq L)\approx \frac{\alpha}{2} \qquad U = \frac{n(n+1)}{2}-L$$

e o intervalo de confiança 100(1-α)% para o parâmetro de posição θ é então dado por $$IC_{1-\alpha}(\theta)=(W^{(L)},W^{(U+1)}).$$

Se o teste é unilateral à direita, encontramos o valor L tal que $$P(T^+ \leq L)\approx \alpha$$

e o intervalo de confiança 100(1-α)% para o parâmetro de posição θ é então dado por $$IC_{1-\alpha}(\theta)=(W^{(L)},\infty).$$

Se o teste é unilateral à esquerda, encontramos os valores L e U tais que $$P(T^+ \leq L)\approx \alpha \qquad U = \frac{n(n+1)}{2}-L$$

e o intervalo de confiança 100(1-α)% para o parâmetro de posição θ é então dado por $$IC_{1-\alpha}(\theta)=(-\infty,W^{(U+1)}).$$

Exemplo 1.2.2

Considere a seguinte amostra

126 142 156 228 245 246
370 419 433 454 478 503

Vamos testar, com um nível de significância α = 0,05, se os dados estão distribuídos simetricamente em torno de $θ_0$ = 220.

  1. Estabelecemos as hipóteses

Screenshot_6

já que queremos testar se os dados estão ou não distribuídos simetricamente em torno $θ_0$ = 220.

Como já vimos no Exemplo 1.1, o valor da estatística $T^{+}$ é dado por $T^{+}$ = 63.

  1. Cálculo dos valores críticos.

Como estamos realizando um teste bilateral, devemos encontrar os valores $t_1$ e $t_2$ tais que $$PT^+ \ < \ t_1) = P(T^+ \ > \t_2)\approx \frac{\alpha}{2}.$$

Neste caso, temos que os valores $t_1$ e $t_2$ são dados por $t_1$ = 14 e $t_2$ = 64. Como $t_1$ = 14 < $T^{+}_{obs}$ = 63 < $t_2$ = 64, então não rejeitamos a hipótese nula de que os dados estão distribuídos simetricamente em torno de $θ_0$ = 220.

  1. Cálculo do p-valor.

Como o teste é bilateral, o p-valor do teste exato é dado por

Screenshot_7

Temos que n(n+1)/4 = 52 e como $T^{+}_{obs}$ = 63 > 52, segue que

$$P-value = 2P(T^+ \ > \ T^+_{obs}-1) = 2P(T^+ \ > \ 62) = 0.06396484.$$

  1. Intervalo de confiança.

Para se calcular o intervalo de confiança, consideramos os valores ordenados das médias $(X_i+X_j)/2$ com i ≤ j. Estes valores estão calculados na tabela abaixo:

Médias ordenadas $(Xi+Xj)/2$:

126 134 141 142 149 156
177 185 185,5 186 192 193,5
194 200,5 201 228 236,5 237
245 245,5 246 248 256 263
272,5 279,5 280,5 287,5 287,5 290
294,5 298 299 302 305 307,5
308 310 314,5 317 322,5 323,5
329,5 330,5 332 332,5 339 339,5
341 349,5 350 353 361,5 362
365,5 370 374 374,5 394,5 401,5
412 419 424 426 433 436,5
436,5 443,5 448,5 454 455,5 461
466 468 478 478,5 490,5 503

Encontramos agora os valores L e U tais que $$P(T^+\leq L)\approx\alpha/2 \qquad U = \frac{n(n+1)}{2}-L.$$

Neste caso, temos que L = 14 e U = 64 e o intervalo de confiança com será dado por $$IC_{1-\alpha}(\theta)=(W^{(14)},W^{(65)})=(200,5;433).$$

  1. Estimador para o parâmetro de posição (pseudo-mediana)

A partir da tabela das médias acima, temos que a quantidade total dessas médias é M = 78 = 2k com k = 39. Neste caso, segue que $$\hat{\theta}=\frac{W^{(k)}+W^{(k+1)}}{2}=\frac{314.5+317}{2}=315.75.$$

Utilizando o software Action, os resultados são dados a seguir

resultado_wilcoxon.png

resultado_wilcoxon_grafico1.png

resultado_wilcoxon_grafico2.png

7.1.3 Aproximação Normal

Para amostras de tamanho n > 50, utilizamos uma aproximação normal. Consideremos a estatística $T^{+}$ como dada anteriormente, ou seja, $T^{+}$ é a soma de todos os postos positivos.

Teorema 1.3.1

Sob a hipótese nula, ou seja, sob a hipótese de que os valores $X_{i }$estão igualmente distribuídos em torno do valor $θ_{0}$ temos que o valor esperado de $T^{+}$, $E_{0}$($T^{+}$), e a variância de $T^{+}$, $Var_{0}$($T^{+}$), são dados pelas fórmulas abaixo $$E(T^+ \mid \theta=\theta_0)=\frac{n(n+1)}{4} \quad \hbox{e} \quad Var(T^+ \mid \theta=\theta_0)=\frac{n(n+1)(2n+1)}{24}$$

Demonstração

Para cada i, considere a variável aleatória $V_{i}$ dada por

Screenshot_10

Under the hypothesis $H_{0}$, we have that the values of $X_{i}$ are equally distributed around $θ_{0}$, in this way the random variables $V_{i}$ are equally distributed with the following probability distribution $$P(V_i=i) =P(V_i=0)=\frac{1}{2}$$

for i = 1, 2, …, n. In this way, we have to $$E(T^+ \mid \theta=\theta_0)=E\left[\sum_{i=1}^n V_i \mid \theta=\theta_0\right]=\sum_{i=1}^n E [V_i \mid \theta=\theta_0]= \frac{1}{2} \sum_{i=1}^n i=\frac{1}{2}\left[\frac{n(n+1)}{2}\right]=\frac{n(n+1)}{4}$$

and $$Var(T^+\mid\theta=\theta_0)=\sum_{i=1}^n Var(V_i \mid \theta=\theta_0)=\sum_{i=1}^n E(V_i^2 \mid \theta=\theta_0)-[E(V_i \mid \theta=\theta_0)]^2=$$

$$\sum_{i=1}^n \left(\frac{i^2}{2}-\frac{i^2}{4}\right)=\frac{i^2}{4}$$

i.e. $$Var(T^+ \mid \theta=\theta_0)=\frac{1}{4}\sum_{i=1}^n i^2= \frac{1}{4}\left[\frac{n(n+1)(2n+1)}{6}\right] = \frac{n(n+1) (2n+1)} {24}$$

as we wanted to demonstrate.

Normal Approximation

Using asymptotic results, we have that the Z statistic, given by $$Z = \frac{T^+-E_0(T^+)}{\sqrt{Var_0(T^+)}}=\frac{T^+-\frac{1}{4}n(n+1)}{\sqrt{[n(n+1) (2n+1)/24]}} \qquad (1.3.1)$$

has an approximately Normal distribution with mean 0 and variance 1. So the test is reduced to a standard normal test.

The steps to carry out this test:

  1. We establish the following hypotheses:

Screenshot_8

which are equivalent to the hypotheses

Screenshot_9

  1. First we must subtract $θ_{0}$ of each value $X_{i}$, i = 1, 2, …, n, of the sample and thus we obtain a new set of data, $(X_1-θ_{0}$, $X_2-θ_{0}$, …, $X_n-θ_{0}$).

  2. We order the values of this new data set in increasing order of magnitude and associate each value with the corresponding rank, with each rank having the same sign as the value it represents.

  3. We calculate the value of the statistic $T^{+}$.

  4. We calculate the value of $Z_{obs}$ through equation (1.3.1). Next, we set the significance level α.

  5. We find the critical values ​​referring to the fixed significance level α.

  • If the test is two-sided, the critical values are $-Z_{\alpha/2}$ and $Z_{\alpha/2}$.

  • If the test is right-sided, the critical value is $Z_{\alpha}$.

  • If the test is left-tailed, the critical value is $-Z_{\alpha}$.

  1. Rejection criteria:
  • If the test is two-sided, we reject the null hypothesis if $Z_{obs} \ > \ Z_{\alpha/2}$ or if $Z_{obs} \ < \ -Z_{\alpha/2}$, otherwise we do not reject the null hypothesis.

  • If the test is right-tailed, we reject the null hypothesis if $Z_{obs} \ > \ Z_{\alpha}$, otherwise we do not reject the null hypothesis.

  • If the test is left-tailed, we reject the null hypothesis if $Z_{obs} \ < \ -Z_{\alpha}$, otherwise we do not reject the null hypothesis.

  1. Calculation of p-value
  • If the test is two-sided, then the p-value is given by $$P-valor = P[|Z| \ > \ |Z_{obs}||H_0] = 2 P[Z \ > |Z_{obs}|].$$

  • If the test is right-sided, then the p-value is given by $$P-valor = P[Z \ > \ Z_{obs}|H_0].$$

  • If the test is left-tailed, then the p-value is given by $$P-valor = P[Z \ < \ Z_{obs}|H_0].$$

Normal approximation with continuity correction

As we are using a continuous distribution, it is convenient to use a continuity correction, according to the type of test being performed.

  • If the test is two-sided, we calculate A given by $$A = T^+-\frac{n(n+1)}{4}.$$

If A ≥ 0, the statistic will be given by $$Z_{cor}=\frac{T^+-\frac{1}{2}-\frac{n(n+1)}{4}}{\sqrt{\frac{n(n+1)(2n+1)}{24}}}$$

and if A < 0, a estatística será dada por $$Z_{cor}=\frac{T^++\frac{1}{2}-\frac{n(n+1)}{4}}{\sqrt{\frac{n(n+1)(2n+1)}{24}}}.$$

  • Se o teste é unilateral à direita, a estatística será dada por $$Z_{cor}=\frac{T^+-\frac{1}{2}-\frac{n(n+1)}{4}}{\sqrt{\frac{n(n+1)(2n+1)}{24}}}.$$

  • Se o teste é unilateral à esquerda, a estatística será dada por $$Z_{cor}=\frac{T^++\frac{1}{2}-\frac{n(n+1)}{4}}{\sqrt{\frac{n(n+1)(2n+1)}{24}}}.$$

Os passos utilizados são análogos aos anteriores, porém utilizamos $Z_{cor}$ ao invés de $Z_{obs}$.

Exemplo 1.3.1

Considere a seguinte amostra de 60 elementos

221 106 272 136 353 331
242 335 257 248 312 211
81 321 336 318 186 169
328 355 114 184 264 322
363 284 299 323 228 245
365 268 270 131 138 196
259 293 152 202 300 199
260 263 185 311 240 325
124 162 142 346 163 261
343 123 362 95 132 281

Vamos testar se os elementos estão distribuídos simetricamente em torno de $θ_{0}$ = 220.

  1. Para realizar este teste, estabelecemos as hipóteses

Screenshot_6.png

  1. Subtracting $θ_{0}$ = 220 of each element in the sample and placing all values in increasing order of magnitude, we obtain:
1 8 -9 -18 20 -21
22 -24 25 28 -34 -35
-36 37 39 40 41 43
44 48 50 -51 52 -57
-58 61 64 -68 73 -78
79 80 -82 -84 -88 -89
91 92 -96 -97 98 101
102 103 105 -106 108 111
-114 115 116 123 -125 126
133 135 -139 142 143 145
  1. Associating the corresponding ranks of these values, we have

Posts:

1 2 -3 -4 5 -6
7 -8 9 10 -11 -12
-13 14 15 16 17 18
19 20 21 -22 23 -24
-25 26 27 -28 29 -30
31 32 -33 -34 -35 -36
37 38 -39 -40 41 42
43 44 45 -46 47 48
-49 50 51 52 -53 54
55 56 -57 58 59 60
  1. From the values of the positions above, we calculate the value $T^{+}$ which will be given by $$T^+=1222.$$

  2. We calculate the value of the Z statistic given in equation (1.3.1) $$Z = \frac{T^+-\frac{1}{4}n(n+1)}{\sqrt{[n(n+1)(2n+1)/24]}}=\frac{1222-915}{135,84}=2,260012.$$

We set the significance level α = 0.05.

  1. We find the critical values ​​of the Normal distribution. In this case, as the test is two-sided, the values are $Z_{α/2}$ = 1.96 and $-Z_{α/2}$ = -1,96.

  2. Criterion.

How $Z_{obs }$= 2.260012 > 1.96, we reject the null hypothesis that the data are symmetrically distributed around $θ_{0}$ = 220.

  1. Calculation of p-value

In this case, with the test being two-sided, the p-value is given by $$P-valor = 2P(Z \ > \ Z_{obs})=2P(Z \ > \ 2.260012)=0,0238.$$

Using the Action software, we have the following results:

resultado_wilcoxon_assintotico.png

resultado_wilcoxon_assintotico_grafico1.png

resultado_wilcoxon_assintotico_grafico2.png

If we wanted to carry out the test with continuity correction, we calculated the value A given by $$A = T^+-\frac{n(n+1)}{4}= 1222-915=307.$$

Since A = 307 ≥ 0, the statistic is given by $$Z_{cor}=\frac{T^+-\frac{1}{2}-\frac{n(n+1)}{4}}{\sqrt{\frac{n(n+1)(2n+1)}{24}}}=\frac{306,5}{135,84}=2,256331.$$

And in this case, the p-value is given by $$P-valor = 2P(Z \ > \ 2.256331)=0,02405.$$

Using the Action software, we have the following results:

resultado_wilcoxon_assintotico_correcao.png

7.1.4 Repeated Observations

Now we will see the case in which, when observing a sample, we find repeated values.

Let us consider a sample of sizes n. The steps for carrying out this test are analogous to the previous case. What will change in this case are the ranks: when the modules of the numbers are repeated, we will have equal ranks for the numbers. The rank of these numbers will be the average between the ranks they would assume in the common case. The positions of the numbers that are not repeated continue to be the numbers associated with the position in which the value is found in the list.

For greater clarity, consider the following sequence of numbers:

-8 9 -15 15 16 18 32 32 32 -39

The positions in the common case would be:

Value -8 9 -15 15 16 18 32 32 32 -39
Post 1 2 3 4 5 6 7 8 9 10

But notice that in this sequence the number 15 appears 2 times and the number 32 appears 3 times. So we have repetitions. Therefore, the rank of the two numbers 15 will be the average of the numbers that correspond to their placement in the list, that is, (3+4)/2 = 3.5. Similarly, the rank of the three numbers 32 will be (7+8+9)/3 = 8. The values ​​that are not repeated continue with the same ranks. So, we have that the observed values and their respective ranks are

Value -8 9 -15 15 16 18 32 32 32 -39
Post 1 2 3,5 3,5 5 6 8 8 8 10

If we have 0 values in the sample, we eliminate these values and perform the test for the remaining values.

Example 1.4.1

Suppose that in a Wilcoxon test we have the following deviations:

0 0 3 -7 9 9 -11 11 11 14 16 17 17 18

Since we have two 0 values in the data set, these values are eliminated and we are left with the remaining data, i.e.

3 -7 9 -9 -11 11 11 14 16 17 17 18

Next, we calculate the modulus of each element in the dataset and assign it its corresponding rank. In this way, the positions will be:

$Z_i$ 3 -7 9 -9 -11 11 11 14 16 17 17 18
Post 1 2 3,5 3,5 6 6 6 8 9 10,5 10,5 12

Note

For samples that have repeated values or zero values, the p-value and confidence interval for a Wilcoxon test are not calculated exactly and the tests performed are always asymptotic (using normal approximation).

Repeated observations

If there are r different sets of repetitions, let $d_{i}$, i = 1, …, r the number of repeated observations in set i. We define $d_{0}$ as the number of zeros in the sample. In this case, the Z statistic, given by

$$Z = \frac{T^{+}-\frac{n(n+1)}{4}}{\sqrt{\frac{n(n+1)(2n+1)-d_{0}(d_{0}+1)(2d_{0}+1)}{24} - \frac{\sum_{i=1}^{r}(d_{i}^3-d_{i})}{48}}}.~~~(1.4.1)$$

has an approximately normal distribution, for large values of n.

Let’s look at the steps to apply the Wilcoxon Test for repeated observations.

  1. Establish a hypothesis:

Screenshot_11

  1. First, we subtract $θ_{0}$ of each value $X_{i}$, i = 1, …, n of the sample and thus we obtain a new set of data, $(X_{1}$ - $θ_{0}$, …, $X_{n }$- $θ_{0}$).

  2. We order the modules of the values of this new data set in ascending order and associate each value with the corresponding rank, this rank being as defined above.

  3. We calculate the value of the statistic $T^{+}$, which was defined as the sum of the ranks of the elements that have a positive sign.

  4. Be $d_{i}$, i = 1, …, r the number of repeated observations, if there are r sets of different repetitions. We calculate the value of Z using equation (1.4.1). Next, we set the significance level α.

  5. We find the critical values ​​in the Normal distribution table.

  • If the test is two-sided, we find the values $Z_{α/2}$ and $-Z_{α/2}$.

  • If the test is right-sided, we find the critical value $Z_{α}$.

  • If the test is left-tailed, we find the critical value $-Z_{α}$.

  1. Criteria:
  • In the two-sided case, we reject the null hypothesis if $Z_{obs} \ > \ Z_{\alpha/2}$ or $Z_{obs} \ < \ -Z_{\alpha/2}$, otherwise we do not reject the null hypothesis.

  • In the right-sided case, we reject the null hypothesis if $Z_{obs} \ > \ Z_{\alpha}$, otherwise we do not reject the null hypothesis.

  • In the left-sided case, we reject the null hypothesis if $Z_{obs} \ < \ -Z_{\alpha}$, otherwise we do not reject the null hypothesis.

  1. Calculation of p-value
  • If the test is two-sided, the p-value is calculated as follows

$$P-valor = P[|Z| \ > \ |Z_{obs}||H_0]=2P[Z \ > \ |Z_{obs}|].$$

  • If the test is right-sided, then the p-value is given by

$$P-valor = P[Z \ > \ Z_{obs}|H_0].$$

  • If the test is left-tailed, then the p-value is given by

$$P-valor = P[Z \ > \ Z_{obs}|H_0].$$

Continuity Correction

  • If the test is two-sided, then we calculate the value A given by

$$A = T^+-\frac{n(n+1)}{4}$$

and, if A ≥ 0 it follows that the statistic will be given by

$$Z_{cor}=\frac{T^+-\frac{1}{2}-\frac{n(n+1)}{4}}{\sqrt{\frac{n(n+1)(2n+1)-d_0(d_0+1)(2d_0+1)} {24}-\frac{\sum_{i=1}^{r}(d_{i}^3-d_{i})}{48}}}$$

and if A < 0, a estatística será dada por

$$Z_{cor}=\frac{T^++\frac{1}{2}-\frac{n(n+1)}{4}}{\sqrt{\frac{n(n+1)(2n+1)-d_0(d_0+1)(2d_0+1)} {24}-\frac{\sum_{i=1}^{r}(d_{i}^3-d_{i})}{48}}}.$$

  • Se o teste é unilateral à direita, a estatística será dada por

$$Z_{cor}=\frac{T^+-\frac{1}{2}-\frac{n(n+1)}{4}}{\sqrt{\frac{n(n+1)(2n+1)-d_0(d_0+1)(2d_0+1)} {24}-\frac{\sum_{i=1}^{r}(d_{i}^3-d_{i})}{48}}}.$$

  • Se o teste é unilateral à esquerda, a estatística será dada por

$$Z_{cor}=\frac{T^++\frac{1}{2}-\frac{n(n+1)}{4}}{\sqrt{\frac{n(n+1)(2n+1)-d_0(d_0+1)(2d_0+1)} {24}-\frac{\sum_{i=1}^{r}(d_{i}^3-d_{i})}{48}}}.$$

Exemplo 1.4.2

Consideremos a amostra:

153 166 181 192 244 248 258 264 296 305 305 312
330 340 356 361 395 427 433 467 544 551 625 783

Use o teste de Wilcoxon para testar as hipóteses

Screenshot_6

Subtracting 220 from each sample value and placing all values obtained in increasing order of magnitude, we obtain:

24 -28 28 38 -39 44 -54 -67 76 85 85 92
110 120 136 141 175 207 213 247 324 331 405 563

The following table gives us the deviations obtained above, their respective positions and the values $R_iψ_{i}$.

Value 24 -28 28 38 -39 44 -54 -67 76 85 85 92
Post 1 -2,5 2,5 4 -5 6 -7 -8 9 10,5 10,5 12
$R_iψ_i$ 1 0 2,5 4 0 6 0 0 9 10,5 10,5 12
Value 110 120 136 141 175 207 213 247 324 331 405 563
Post 13 14 15 16 17 18 19 20 21 22 23 24
$R_iψ_i$ 13 14 15 16 17 18 19 20 21 22 23 24

From the values $R_iψ_{i}$, we calculate the value $T^{+}$, given by

$$T^+=\sum_{i=1}^{24}R_i\Psi_i=277,5.$$

Since we have two repetitions involving two observations, it follows that $d_{1}=d_{2}=2$ and $n=24$.

The Z statistic is given by

$$Z=\frac{277,5-150}{\sqrt{\frac{24(24+1)(48+1)}{24}-\frac{(6+6)}{48}}}=3,643229.$$

In this case, the p-value is given by

$$P-valor = P[|Z| \ > \ |Z_{obs}||H_0]=2P[Z \ > \ 3,643229]=0,000269239.$$

Conclusion

We reject $H_{0}$ if we consider any significance level greater than 0.0269239%.

Using the Action software we have the following results:

resultado_wilcoxon_umaamostra_repetido.png

resultado_wilcoxon_umaamostra_repetido_grafico1.png

resultado_wilcoxon_umaamostra_repetido_grafico2.png

Using continuity correction, as the test is two-sided, we have that A is given by

$$A = T^+-\frac{n(n+1)}{4}=277,5-\frac{24\times25}{4}=277,5-150=127,5 \ > \ 0.$$

Then, using continuity correction, the statistic $Z_{cor}$ is calculated as follows

$$Z_{cor}=\frac{277,5-0,5-150}{\sqrt{\frac{24(24+1)(48+1)}{24}-\frac{(6+6)}{48}}}=3,628942$$

and in this case, the p-value is given by

$$P-valor = P[|Z| \ > \ |Z_{obs}||H_0]=2P[Z \ > \ 3,628942]=0,000284585$$

Conclusion

We reject $H_{0}$ if we consider any significance level greater than 0.0284585%.

resultado_wilcoxon_umaamostra_repetido_correcao.png

7.2 Wilcoxon-Mann-Whitney Test - Independent Samples

Let us consider two populations $P_1$ and $P_2$ of which we do not have information regarding their distributions, but the variables involved have at least an ordinal measurement scale. In other words, we can address the case of ordinal or quantitative qualitative random variables. Let us also consider two independent samples from the two populations. We want to test whether the distributions are equal in location, that is, we will be interested in knowing whether one population tends to have larger values ​​than the other, or whether they have the same median. This test is called Wilcoxon-Mann-Whitney test.

The Wilcoxon-Mann-Whitney test is based on the ranks of the values ​​obtained by combining the two samples. This is done by ordering these values, from smallest to largest, regardless of the fact from which population each value comes from.

In the case of having an ordinal qualitative random variable, we commonly associate numbers with the various categories (or classes, or attributes), according to which the variable is classified. For example, we can have 1 for good, 2 for very good and 3 for excellent. We then see that these values ​​are posited. In this case and in other situations, it is preferable to work with ranks rather than with arbitrary values ​​associated with the qualitative variable.

Be $X_1, X_2, …, X_m$ a random sample of the population $P_1$ and $Y_1, Y_2, …, Y_n$ a random sample of the population $P_2$ so that the $X_i’s$ are independent and identically distributed and the $Y_i’s$ are independent and identically distributed. Furthermore, suppose that the $X_i’s$ and the $Y_i’s$ are mutually independent and take sample Y the one with the smallest sample size, that is, n ≤ m.

To apply the Wilcoxon-Mann-Whitney test, we assume that F and G are the distribution functions corresponding to the populations $P_1$ and $P_2$, respectively and, in this case, we consider the null hypothesis to be the hypothesis

$$H_0: F(t)=G(t) \ \hbox{para todo} \ t.$$

The alternative hypothesis is to consider that Y tends to be greater (or smaller) than X. A useful model to describe this alternative is a translation model called the position change model. In this model we have to

$$G(t)=F(t-\Delta) \ \hbox{para todo} \ t.$$

Another way of interpretation is to consider that Y has the same distribution as X+Δ. In this case, considering that the expectation E(X) of population 1 exists and taking E(Y) as the expectation of population 2, it follows that

$$\Delta = E(Y)-E(X)$$

and thus the null hypothesis $H_0$ reduces to

$$H_0:\Delta=0.$$

With this, we establish one of the following hypotheses in a Wilcoxon-Mann-Whitney test:

Screenshot_12

Then, we sort all the values (from the two samples) in ascending order and place the associated ranks. We consider $S_m$ and $S_n$ the sums of the ranks related to the elements of samples X and Y respectively. From the values $S_m$ and $S_n$, we calculate the values

$$U_{m} = S_{m}-\frac{1}{2}m(m+1)~~~(2.1)$$

and

$$U_{n} = S_{n}-\frac{1}{2}n(n+1).~~~(2.2)$$

How $S_m + S_n$ is equal to the sum of all ranks (of the two samples), that is,

$$S_{m}+S_{n} = \frac{1}{2}(m+n)(m+n+1)~~~(2.3)$$

It is easy to see that the values $U_m$ and $U_n$ are related according to the equation below

$$U_{m} = mn - U_{n}~~~(2.4)$$

therefore, only one of the $U_m, U_n$ needs to be calculated and, using equation (2.4) we find the value of the other easily. In the Wilcoxon-Mann-Whitney test, the W statistic of the test will be given by $U_n$.

Example 2.1

Two samples provided the following values for a certain variable.

Sample 1:

29 39 60 78 82 112 125 170
192 224 263 275 276 286 369 756

Sample 2:

126 142 156 228 245 246
370 419 433 454 478 503

In Table (2.1) we have all the sample values in ascending order and the associated ranks. To facilitate identification, values ​​and ranks from the second sample were underlined.

Value 29 39 60 78 82 112 125 126 142 156
Post 1 2 3 4 5 6 7 8 9 10
Value 170 192 224 228 245 246 263 275 276 286
Post 11 12 13 14 15 16 17 18 19 20
Value 369 370 419 433 454 478 503 756
Post 21 22 23 24 25 26 27 28

Table 2.1: Combined ranks for the two independent samples.

Here m = 16 and n = 12. So,

$$S_{m} = 1+2+3+4+5+6+7+11+12+13+17+18+19+20+21+28=187$$

and

$$S_n = 8+9+10+14+15+16+22+23+24+25+26+27=219$$

So,

$$U_{m}=187-(\frac{1}{2}\times 16\times 17)=51$$

and

$$U_{n}=219-(\frac{1}{2}\times 12\times 13)=141.$$

Therefore, the W statistic is given by

$$W=U_{n}=141.$$

7.2.1 An Estimator for the Difference between Positions

To estimate the difference Δ between population medians, we consider all m x n differences $y_i - x_j$ ordered in ascending order. The estimator $\hat{\Delta}$ associated with the Wilcoxon-Mann-Whitney statistic is defined by

$$\hat{\Delta}= \ \hbox{mediana}{((y_i-x_j), \ i=1,\ldots, n; j=1,\ldots,m)}.$$

Be $U^{(1)}, U^{(2)}, …, U^{(mn)}$, the ordered values of these differences. If m is an odd number, that is, mn = 2k +1, we have k = (mn-1)/2 and then we take

$$\hat{\Delta}=U^{(k+1)},$$

that is, the difference that occupies position k + 1 in the list of ordered differences. If mn is an even number, i.e. mn = 2k, then k = mn/2 and then we take

$$\hat{\Delta}=\frac{U^{(k)}+U^{(k+1)}}{2},$$

that is, $\hat{\Delta}$ is the average of the differences $y_i - x_j$ that occupy positions k and k + 1 in the list of ordered differences.

Note: The estimator $\hat{\Delta}$ is called the pseudo-median.

Example 2.1.1

Consider the data from Example 2.1.

In Table 2.1.1 we have the differences between observed values.

126 142 156 228 245 246 370 419 433 454 478 503
29 97 113 127 199 216 217 341 390 404 425 449 474
39 87 103 117 189 206 207 331 380 394 415 439 464
60 66 82 96 168 185 186 310 359 373 394 418 443
78 48 64 78 150 167 168 292 341 355 376 400 425
82 44 60 74 146 163 164 288 337 351 372 396 421
112 14 30 44 116 133 134 258 307 321 342 366 391
125 1 17 31 103 120 121 245 294 308 329 353 378
170 -44 -28 -14 58 75 76 200 249 263 284 308 333
192 -66 -50 -36 36 53 54 178 227 241 262 286 311
224 -98 -82 -68 4 21 22 146 195 209 230 254 279
263 -137 -121 -107 -35 -18 -17 107 156 170 191 215 240
275 -149 -133 -119 -47 -30 -29 95 144 158 179 203 228
276 -150 -134 -120 -48 -31 -30 94 143 157 178 202 227
286 -160 -144 -130 -58 -41 -40 84 133 147 168 192 217
369 -243 -227 -213 -141 -124 -123 1 50 64 85 109 134
736 -610 -594 -580 -508 -491 -490 -366 -317 -303 -282 -258 -233

Table 2.1.1: Differences

We have that nm = 12 x 16 = 192 which is an even number, that is 192 = 2k with k = 96. In this way, the estimator of the median between the differences $y_i - x_j$ is given by

$$\hat{\Delta}=\frac{U^{(96)}+U^{(97)}}{2}=\frac{133+134}{2}=133,5.$$

7.2.2 Exact distribution of the Wilcoxon-Mann-Whitney statistic

Suppose that under $H_0$, the distribution of W is continuous, so the probability of finding repeated values in the samples of X and Y is zero. To find the exact distribution of the W statistic under $H_0$, consider n and m the sample sizes of populations Y and X, respectively. Furthermore, consider that N = n + m. In this way, we have

Screenshot_13

possibilities for the ranks (positions) of the elements of Y and each of them has a probability

Screenshot_14

For example, in the case where m = 3 and n = 2, there are

Screenshot_15

possibilities for the ranks of the two observations of the elements of Y and the corresponding values of the W statistic are given in the following table

Ranks Probability W
1,2 1/10 3
1,3 1/10 4
1,4 1/10 5
1,5 1/10 6
2,3 1/10 5
2,4 1/10 6
2,5 1/10 7
3,4 1/10 7
3,5 1/10 8
4,5 1/10 9

So, under $H_0$, the probability that W is equal to 5 is equal to 2/10, since W = 5 when the rank configuration of Y is {1,4} or {2,3} and each of them occurs with probability 1/10. In this way, we have for distribution under $H_0$ that

W values Probability
3 0,1
4 0,1
5 0,2
6 0,2
7 0,2
8 0,1
9 0,1

So, for example, the probability under $H_0$ of W being greater than or equal to 7 is given by

$$P[W\geq 7]=P(W=7)+P(W=8)+P(W=9)=0,2+0,1+0,1=0,4$$

In a Wilcoxon-Mann-Whitey test where the sample size n is small (usually n < 50) e não temos observações repetidas ou nulas, utilizamos a distribuição exata da estatística W e, a partir desta distribuição, calculamos os valores críticos do teste, o p-valor e o intervalo de confiança.

  1. Cálculo dos valores críticos.

Se estamos realizando um teste bilateral, então sob $H_0$, devemos encontrar os valores críticos $t_1$ e $t_2$ tais que

$$P[W \ < \ t_1]=P[W \ > \t_2]=\approx\frac{\alpha}{2}.$$

Se o teste é unilateral à direita, então devemos encontrar o valor crítico t tal que

$$P[W>\t]\approx\alpha$$

e se o teste é unilateral à esquerda, então devemos encontrar o valor crítico t tal que

$$P[W\ < \ t]\approx\alpha.$$

  1. Critério.

Se o teste é bilateral e $W_{obs}$ < $t_{1}$ ou $W_{obs}$ > $t_2$ so we reject $H_0$, otherwise we do not reject $H_0$, that is, if $t_1$ < $W_{obs}$ < $t_2$, não rejeitamos a hipótese nula $H_0$.

No caso do teste unilateral à direita, se $W_{obs}$ > $t$, so we reject $H_0$, otherwise we do not reject $H_0$, that is, if $W_{obs}$ < t, não rejeitamos a hipótese nula $H_0$.

Se o teste é unilateral à esquerda e $W_{obs}$ < t, então rejeitamos $H_0$, caso contrário, não rejeitamos $H_0$, ou seja, se $W_{obs}$ > t, we do not reject the null hypothesis $H_0$.

  1. Calculation of the p-value.

If the test is two-sided, the p-value of the exact test is given by

Screenshot_16

If the test is right-sided, the p-value of the exact test is given by

$$P-valor = P(W \ > \ W_{obs}-1)$$

and if the test is left-tailed, the p-value of the exact test is given by

$$P-valor = P(W \ < W_{obs}).$$

  1. Confidence interval for the difference between the position parameters of populations Y and X.

In a similar way to that used in estimating the difference between the position parameters of populations Y and X, we consider all m x n differences $y_i$ - $x_j$ ordered in ascending order. Considering that X has m elements and Y has n elements and that n ≤ m, then we have m x n differences of this type.

Be $W^{(1)}, W^{(2)}, …, W^{(mn)}$ these ordered differences.

If the test is two-sided and the significance level is α, we find the values L and U such that

$$P(W \ < \ L)\approx \frac{\alpha}{2} \qquad U = nm-L$$

and the 100(1-α)% confidence interval is given by

$$IC_{1-\alpha}(\theta)=(W^{(L)},W^{(U+1)}).$$

If the test is right-sided, we find the value L such that

$$P(W \ < \ L)\approx\alpha$$

and the 100(1-α)% confidence interval is given by

$$IC_{1-\alpha}(\theta)=(W^{(L)},\infty)$$

and if the test is left-tailed, we find the value U such that

$$P(W \ > \ U)\approx\alpha$$

and the 100(1-α)% confidence interval is given by

$$IC_{1-\alpha}(\theta)=(-\infty,W^{(U+1)}).$$

Example 2.2.1

Consider again Example 2.1 in which two samples provide values of a certain variable.

Sample 1:

29 39 60 78 82 112 125 170
192 224 263 275 276 286 369 756

Sample 2:

126 142 156 228 245 246
370 419 433 454 478 503

We will test whether, at a significance level of 5%, there is a significant difference between the position measurements of the two populations. In this case, we establish the hypotheses

Screenshot_17

As already seen, the W statistic is given by

$$W=141.$$

  1. Calculation of critical values.

Since we are performing a two-sided test, we must find the values $t_1$ and $t_2$ such that

$$P[W \ < \ t_1]=P[W \ > \ t_2]\approx 0,025.$$

In this case, we have the values of $t_1$ and $t_2$ are given by $t_1$ = 54 and $t_2$ = 138.

  1. Criterion.

How $W_{obs}$ = 141 > $t_{2}$ = 138, then we reject the null hypothesis. In this case, we have evidence that the two populations do not have equal position measurements.

  1. Calculation of the p-value.

How $W_{obs}$ 141 > mn/2 = 96, the p-value is given by

$$P-valor = 2P(W \ > \ W_{obs}-1)=0,03733835.$$

  1. Confidence Interval.

We consider the m x n differences of the form $y_i$ - $x_j$ ordered in ascending order in the table below

-630 -614 -600 -528 -511 -510 -386 -337 -323 -302 -278 -253
-243 -227 -213 -160 -150 -149 -144 -141 -137 -134 -133 -130
-124 -123 -121 -120 -119 -107 -98 -82 -68 -66 -58 -50
-48 -47 -44 -41 -40 -36 -35 -31 -30 -30 -29 -28
-18 -17 -14 1 1 4 12 17 21 22 30 31
36 44 44 48 50 53 54 58 60 64 64 66
74 75 76 78 82 84 85 87 94 95 96 97
103 103 107 109 113 116 117 120 121 127 133 133
134 134 143 144 146 146 147 150 156 157 158 163
164 167 168 168 168 170 178 178 179 185 186 189
191 192 195 199 200 202 203 206 207 209 215 216
217 217 227 227 228 230 240 241 245 249 254 258
262 263 279 284 286 288 292 294 307 308 308 310
311 321 329 331 333 337 341 341 342 351 353 355
359 366 372 373 376 378 380 390 391 394 394 396
400 404 415 418 421 425 425 439 443 449 464 474

The values of L and U for calculating the confidence interval are given by

$$L = 54 \ \hbox{e} \ U = 138.$$

Therefore, it follows that the 95% confidence interval is given by

$$IC_{0,95}(\theta)=(W^{(L)},W^{(U+1)})=(4,230).$$

  1. To calculate the pseudo median of the difference between population Y and population X, we use the table above. Since mn = 192 and 192 = 2 x 96 is an even number, the pseudo median is given by

$$\hat{\Delta}=\frac{W^{(96)}+W^{(97)}}{2}=\frac{133+134}{2}=133,5.$$

Using the Action software, we obtain the following results:

resultado_wilcoxon_independentes.png

7.2.3 Normal Approximation

For large m and n values, generally greater than 50, a normal approximation, as we will see below, is used. Let us consider the W statistic as previously defined, that is, W = $U_{n}$.

Theorem 2.3.1

Under the null hypothesis, that is, under the hypothesis that the difference between the positions is Δ = 0, we have that the expected value of W, $E_{0}$(W) and the variance of W, $Var_{0}$(W) are given by the formulas below

$$E_0(W)=\frac{mn}{2} \ \hbox{e} \ Var_0(W)=\frac{mn(m+n+1)}{12}$$

Normal Approximation

Using asymptotic results, we have the Z statistic given by

$$Z = \frac{W-\frac{1}{2}mn}{\sqrt{\frac{mn(m+n+1)}{12}}}~~~(2.3.1)$$

has an approximately Normal distribution with mean 0 and variance 1. So the test is reduced to a standard normal test.

Let’s see how to perform this test:

  1. We establish one of the following hypotheses:

Screenshot_18

  1. We sort all the values (from the two samples) in ascending order and place the associated ranks.

  2. Then we calculate the value of $S_{n}$ (the sum of the ranks associated with the sample elements y).

  3. We obtain the value W = $U_{n}$. Next, we set the significance level α.

  4. We calculate the value

$$Z_{obs}= \frac{W-\frac{1}{2}mn}{\sqrt{\frac{mn(m+n+1)}{12}}}.$$

  1. We find the critical values of the standard Normal distribution according to the type of test.
  • If the test is two-sided, we find the critical values $Z_{\alpha/2}$ and $-Z_{\alpha/2}$ such that $P[Z \ > \ Z_{\alpha/2}]=P[Z \ < \ -Z_{\alpha/2}]=\alpha/2.$

  • If the test is right-sided, we find the critical value $Z_{\alpha}$ such that $P[Z \ > \ Z_{\alpha}]=\alpha$.

  • If the test is left-tailed, we find the critical value $-Z_{\alpha}$ such that $P[Z \ < \ -Z_{\alpha}]=\alpha$.

  1. Criteria:
  • If the test is two-sided, we reject the null hypothesis $H_{0}$ if the observed value $Z_{obs} \ > \ Z_{\alpha/2}$ or if $Z_{obs} \ < \ -Z_{\alpha/2}$, otherwise we do not reject the null hypothesis.

  • If the test is right-tailed, we reject the null hypothesis $H_{0}$ if the observed value $Z_{obs} \ > \ Z_{\alpha}$, otherwise we do not reject the null hypothesis.

  • If the test is left-tailed, we reject the null hypothesis $H_{0 }$if the observed value $Z_{obs} \ < \ -Z_{\alpha}$, otherwise we do not reject the null hypothesis.

  1. Calculation of p-value:

If the test is two-sided, the p-value is given by

$$P-valor = P(|Z| \ > \ |Z_{obs}||H_0) = 2P(Z \ > \ |Z_{obs}||H_0).$$

If the test is right-sided, the p-value is given by

$$P-valor = P(Z \ > \ Z_{obs}|H_0)$$

and if the test is left-sided, the p-value is given by

$$P-valor = P(Z \ < \ Z_{obs}|H_0).$$

where Z ~ N(0,1).

Normal approximation with continuity correction

As we are using a continuous distribution, it is convenient to use a continuity correction. As seen previously, the correction is made according to the type of test performed.

  • If the test is two-sided, we calculate A given by

$$A = W -\frac{1}{2}nm.$$

If A ≥ 0, then

$$Z_{cor}= \frac{W - \frac{1}{2}-\frac{1}{2}nm}{\sqrt{\frac{mn(m+n+1)}{12}}}.$$

If A < 0, então

$$Z_{cor}= \frac{W+\frac{1}{2}-\frac{1}{2}nm}{\sqrt{\frac{mn(m+n+1)}{12}}}.$$

  • Se o teste é unilateral à direita, a estatística é dada por

$$Z_{cor}=\frac{W-\frac{1}{2}-\frac{1}{2}nm}{\sqrt{\frac{mn(m+n+1)}{12}}}.$$

  • Se o teste é unilateral à esquerda, a estatística é dada por

$$Z_{cor}=\frac{W+\frac{1}{2}-\frac{1}{2}nm}{\sqrt{\frac{mn(m+n+1)}{12}}}.$$

Exemplo 2.3.1

Considere as duas amostras dadas abaixo. A primeira de tamanho m = 60 e a segunda de tamanho n = 50 e vamos testar se existe diferença significativa entre suas medidas de posição.

Amostra 1:

0,020783 1,190577 0,254776 0,326478 0,166423 -0,60854
-1,09347 -0,87468 -0,68062 -0,44368 1,107722 0,835386
-0,4732 0,614336 -0,14765 -0,73586 1,103766 0,304864
0,487065 1,437288 -0,01432 -0,39427 -0,0318 -0,55498
-0,92408 -0,09976 0,730077 0,698887 -1,62009 -0,61324
-1,31087 -2,12763 0,445035 0,321711 1,583911 -0,10288
-0,90719 0,390517 -0,95791 -0,13997 1,192579 0,78557
-0,70691 -0,36727 -0,36615 -0,12643 -1,55418 -1,74463
0,102534 0,29614 1,496525 0,037918 1,334108 -2,17951
-1,23783 0,43527 -0,70575 1,53077 0,773895 -0,80207

Amostra 2:

0,849954 -0,06994 0,459771 -1,39136 -0,36113
0,130024 -0,57095 0,1313 1,494435 2,012758
0,357575 0,881379 0,343893 2,295901 -0,04778
0,2508 0,767977 0,622242 -0,00538 0,823678
0,310109 -0,45953 -0,26607 -1,60654 -1,49409
-1,05302 -1,62618 0,833893 -1,75903 -0,32571
1,770791 -0,0034 -0,13192 1,438544 -0,30188
-0,00674 0,392139 1,307978 0,065984 -1,32595
-0,85192 0,653739 0,838055 0,406276 -1,11364
0,267735 0,412184 0,10388 -0,71385 -0,3809

Neste caso, temos que m = 60 e n = 50.

Como queremos testar se existe diferença significativa entre suas medidas de posição, estabelecemos as seguintes hipóteses

Screenshot_17

Ordering the values of the two samples and calculating the sum of the ranks associated with the sample elements of size n = 50, we have $S_{n}$ = 2931. Thus, the W statistic is given by

$$W = U_n = S_n-\frac{n(n+1)}{2}=2931-\frac{50\times 51}{2}= 1656.$$

Next, we calculate the value of the Z statistic given by

$$Z=\frac{W-1/2mn}{\sqrt{[mn(m+n+1)/12]}}=\frac{1656-(0,5\times60\times50)}{\sqrt{(60\times50\times111)/12}}=0,9364684.$$

Setting the significance level α = 0.05, we have that the critical values are $Z_{\alpha/2} = 1,96$ and $-Z_{\alpha/2} = -1,96$, since the test is two-sided. As the observed value was $Z_{obs}$ = 0.9364684, we do not reject the null hypothesis, that is, we conclude that there is no significant difference between the position measurements of the two samples.

We calculate the p-value as follows:

$$P-valor = P[|Z| \ > \ |Z_{obs}||H_0]= 2P[Z \ > \ |Z_{obs}||H_0]=2P[Z \ > \ 0,9364684]= 0,3490321.$$

Using the Action software we have the following results:

resultado_wilcoxon_mann_whitney_assintotico.png

If we wanted to perform the test with continuity correction, we calculated the value of A given by

$$A = W - \frac{mn}{2}=1656=\frac{3000}{2}=156.$$

Since A ≥ 0, we have

$$Z_{cor}=\frac{W - \frac{1}{2}-\frac{1}{2}nm}{\sqrt{\frac{mn(m+n+1)}{12}}}=\frac{155,5}{166,5833}=0,9334669.$$

As -1.96 = $-Z_{α/2}$ < $Z_{cor}$ = 0,9334669 < $Z_{α/2}$ = 1,96, então a um nível de significância de 5% não rejeitamos a hipótese de que os dados tem mesma medida de posição.

E, neste caso, o p-valor é dado por

$$P-valor = 2P(Z \ > \ 0,9334669 = 0,350579.$$

Utilizando o software Action, temos os seguintes resultados:

resultado_wilcoxon_mann_whitney_assintotico_correcao.png

7.2.4 Observações Repetidas

Agora vamos ver o caso em que ao observarmos duas amostras encontramos valores repetidos ou valores nulos. De forma análoga a realizada no caso de uma única amostra, quando os módulos dos números se repetem, teremos postos iguais para os números e o posto destes números será a média aritmética que os números assumiriam no caso comum.

Observação

Se as amostras possuem valores repetidos ou nulos, o p-valor e os intervalos de confiança não são calculados de forma exata e os testes realizados são sempre assintóticos (utilizando aproximação normal)

Consideremos duas amostras X e Y de duas populações $P_{1}$ e $P_{2}$, com tamanhos m e n respectivamente de modo que existam valores repetidos e/ou nulos no conjunto das duas amostras. Neste caso, a estatística será modificada para

Screenshot_20

em que $t_{j}$ é o tamanho do grupo de elementos repetidos j e g é o número total de grupos. Uma observação que não se repete é considerada como um grupo de tamanho 1.

Vejamos os passos para realizar este teste:

  1. Estabelecemos uma das hipóteses:

Screenshot_19

  1. Ordenamos os valores da duas amostras em ordem crescente.

  2. Consideramos $S_{m}$ e $S_{n}$ como anteriormente (soma dos postos correspondentes aos valores das amostras de tamanhos m e n respectivamente). Seja

$$W=U_n=S_n-\frac{n(n+1)}{2}.$$

  1. Calculamos o valor de $Z$ utilizando a equação (2.4.1), isto é

Screenshot_21

  1. Fixamos o nível de significância α.

  2. Encontramos o valor crítico utilizando a distribuição Normal Padrão.

  • Se o teste é bilateral, encontramos os valores críticos $Z_{α/2}$ e $-Z_{α/2}$ tais que P[Z > $Z_{α/2}$] = P[Z < $-Z_{α/2}$] = α/2.

  • Se o teste é unilateral à direita, encontramos o valor crítico $Z_{α}$ tal que P[Z > $Z_{α}$] = α.

  • Se o teste é unilateral à esquerda, encontramos o valor crítico $-Z_{α}$ tal que P[Z < $-Z_{α}$] = α.

  1. Critério:
  • Se o teste é bilateral e $Z_{obs}$ > $Z_{α/2}$ ou $Z_{obs}$ < $-Z_{α/2}$ rejeitamos a hipótese nula $H_{0}$, caso contrário, não rejeitamos a hipótese nula.

  • Se o teste é unilateral à direita e $Z_{obs}$ > $Z_{α}$ rejeitamos a hipótese nula $H_{0}$, caso contrário não rejeitamos a hipótese nula.

  • Se o teste é unilateral à esquerda e $Z_{obs}$ < $-Z_{α}$ rejeitamos a hipótese nula $H_{0}$, caso contrário não rejeitamos a hipótese nula.

  1. Cálculo do p-valor.
  • Se o teste é bilateral o p-valor é dado por

$$P-value = P[|Z| \ > \ |Z_{obs}||H_0]=2P[Z \ > \ |Z_{obs}||H_0].$$

  • Se o teste é unilateral à direita, o p-valor é dado por

$$P-value = P[Z \ > \ Z_{obs}|H_0].$$

  • Se o teste é unilateral à esquerda, o p-valor é dado por

$$P-value = P[Z \ < \ Z_{obs}|H_0].$$

onde Z ~ N(0,1).

Aproximação Normal com correção de continuidade

Aqui também é conveniente utilizar uma correção de continuidade. Assim como visto anteriormente, a correção é feita de acordo com o tipo de teste utilizado.

  • Se o teste é bilateral, calculamos A dado por

$$A = W -\frac{1}{2}nm.$$

Se A ≥ 0, então

Screenshot_22

If A < 0, então

Screenshot_23

  • If the test is right-sided, the statistic is given by

Screenshot_24

  • If the test is left-tailed, the statistic is given by

Screenshot_25

Example 2.4.1

Let’s consider two samples:

Sample 1:

0 19 22 30 31 37 55 56 66 66 67 67
68 71 73 75 75 78 79 82 83 83 88 96

Sample 2:

13 13 22 26 33 33 59 72 72 72 77 78
78 80 81 82 85 85 85 86 88

We used the test of normal approximation for large samples to test the hypothesis that these data can be considered as samples for identical populations against the hypothesis that the populations differ in location.

Since the sample sizes are m = 24 and n = 21, respectively, the large sample approximation will suffice.

In Table 2.3.1 we have the values ​​of samples 1 and 2 placed in ascending order with their respective ranks. The ranks of the repeated values ​​are the averages between the values ​​that the ranks would normally take. See the table:

Value 0 13 13 19 22 22 26 30 31 33 33 37
Post 1 2,5 2,5 4 5,5 5,5 7 8 9 10,5 10,5 12
Value 55 56 59 66 66 67 67 68 71 72 72 72
Post 13 14 15 16,5 16,5 18,5 18,5 20 21 23 23 23
Value 73 75 75 77 78 78 78 79 80 81 82 82
Post 25 26,5 26,5 28 30 30 30 32 33 34 35,5 35,5
Value 83 83 85 85 85 86 88 88 96

Table 2.4.1: Combined ranks for the two independent samples with repeated values.

So, we have to

$$S_n=518,5.$$

By equation (2.4) we have that

$$W= U_n = S_n-\frac{n(n+1)}{2}=518,5-\frac{21\times 22}{2}= 287,5.$$

In this case, we have 19 groups and the number of elements in each group can be seen in the table below

0 13 19 22 26 30 31 33 37 55 56 59 66 67 68 71 72 73 75 77 78 79 80 81 82 83 85 86 88 96
1 2 1 2 1 1 1 2 1 1 1 1 2 2 1 1 3 1 2 1 3 1 1 1 2 2 3 1 2 1

and then, it follows that

$$\sum_{j=1}^{19}(t_j-1)t_j(t_j+1)=126$$

Using equation (2.4.1) we have

$$Z = (287,5 - 252)/\sqrt{1929,327}= 35,5/43,9241=0,8082123.$$

At the 5% significance level, we have $Z_{0,025}$ = 1.96 and as -1.96 < 0,8082123 < 1,96, não rejeitamos a hipótese de que as populações são idênticas.

O p-valor, neste caso é dado por

$$P-valor = 2P[Z \ > \ |Z_{obs}||H_0]=2P[Z \ > \ 0.8082123|H_0]=0.4189684.$$

resultado_wilcoxon_mann_whitney_repetido.png

Se tivéssemos utilizado a correção de continuidade, teríamos

$$A = W-\frac{1}{2}nm=287.5-252 = 35.5 \ > \ 0$$

e então,

$$Z_{color}=\frac{287.5-0.5-252}{\sqrt{1929.443}}=\frac{35}{43.9241}=0.796829.$$

Deste modo, também não rejeitamos a hipótese de que as populações são idênticas, porém, neste caso, o p-valor é dado por

$$P-value = 2P[Z \ > \ |Z_{color}||H_0]=2P[Z \ > \ 0.796829]=0.4255504.$$

resultado_wilcoxon_mann_whitney_repetido_correcao.png

7.3 Teste de Wilcoxon Pareado

O teste de Wilcoxon pareado é utilizado para comparar se as medidas de posição de duas amostras são iguais no caso em que as amostras são dependentes.

Para isto, consideramos duas amostras dependentes de tamanho n vindas de duas populações $P_{1}$ e $P_{2}$, isto é, $X_{1}$, …, $X_{n}$ e $Y_{1}$, …, $Y_{n}$. Como neste caso as amostras são dependentes não podemos aplicar o Teste de Wilcoxon-Mann-Whitney.

Neste caso vamos considerar observações pareadas, isto é, podemos considerar que temos na realidade uma amostra de pares:

$${(X_1, Y_1),\ldots , (X_n, Y_n)}.$$

Vamos definir $D_{i}$ = $X_{i}$ - $Y_{i}$, para i = 1, 2, …, n. Assim, obtemos a amostra $D_{1}$, $D_{2}$, …, $D_{n}$, resultante das diferenças entre os valores de cada par.

Para realizar o Teste de Wilcoxon Pareado devemos primeiramente estabelecer as hipóteses:

Screenshot_26

In other words, we will be testing whether the populations differ in location or not using the following idea: if we accept the null hypothesis, we have that the median of the difference is null, that is, the populations do not differ in location. Now, if the null hypothesis is rejected, that is, if the median of the difference is not zero, we have that the populations differ in location.

In this way, our test became a Wilcoxon Test for a single sample - the sample $D_{1}$, …, $D_{n}$ where $θ_{0}$ = 0.

From there, we must follow the steps of the Wilcoxon Test for a single sample.

Note

In the Wilcoxon Test, the set of data analyzed is the set obtained by subtracting $θ_{0}$ of each sample value. As in this case $θ_{0}$ = 0, the set we will analyze is the set itself $D_{1}$, …, $D_{n}$.

Example 3.1

Let us consider two dependent samples whose data are in the Table below. Is there evidence of a difference between the two samples?

Sample 1 564 521 495 564 560 481 545 478 580 484 539 467
Sample 2 557 505 465 562 545 448 531 458 562 485 520 445
Difference 7 16 30 2 15 33 14 20 18 -1 19 22

We denote the observations from sample 1 by $X_{i}$, i = 1, …, 12, and from sample 2 by $Y_{i}$, i = 1, …, 12. We can write the pairs of observations $(X_1,Y_{1}$), $(X_2,Y_{2}$), …, $(X_{12},Y_{12}$). We analyze the difference $D_{i}$= $Y_{i}$$-X_{i}$. $D_{1}$, …, $D_{12}$ is a sample of 12 independent and equally distributed observations.

The Table below gives us the differences in Table 3.1 ordered in ascending order (based on the absolute values ​​of the differences) and their respective ranks.

Difference -1 2 7 14 15 16 18 19 20 22 30 33
Posts 1 2 3 4 5 6 7 8 9 10 11 12

Thus, our test now boils down to a single-sample Wilcoxon test.

We have the statistics $T^{+}$ which is the sum of positive ranks is given by

$$T^+=2+3+4+5+6+7+8+9+10+11+12 = 77.$$

Using the exact distribution of the Wilcoxon statistic for a single sample, we have that, for α = 5%, the critical values are $t_{1}$ = 14 and $t_{2}$ = 64.

Conclusion

How does the critical value $T_{obs}^{+}$ = 77 > $t_{2}$ = 64, we reject the null hypothesis. Therefore, there is evidence of differences between the two samples.

resultado_wilcoxon_pareado.png

resultado_wilcoxon_pareado_dotplot1.png

resultado_wilcoxon_pareado_dotplot2.png

7.4 Kruskal Wallis Test

The Kruskal-Wallis (KW) test is an extension of the Wilcoxon-Mann-Whitney test. It is a non-parametric test used to compare three or more populations. It is used to test the null hypothesis that all populations have equal distribution functions against the alternative hypothesis that at least two of the populations have different distribution functions.

kruskal.png

Figure 4.1: William Henry Kruskal (1919 - 2005); Wilson Allen Wallis (1912-1998).

The Kruskal-Wallis test is analogous to the F test used in 1-way ANOVA. While the analysis of variance tests depend on the hypothesis that all confronting populations are independent and normally distributed, the Kruskal-Wallis test does not place any restrictions on the comparison. Suppose the data comes from k independent random samples with sample sizes $n_{1}$, $n_{2}$, …, $n_{k}$ where N = $n_{1 }$+ $n_{2 }$+ … + $n_{k}$ the total number of elements considered in all samples.

Sample 1 $ X_{11} $ $ X_{12} $ …… $ X_{1,n_1} $
Sample 2 $ X_{21} $ $ X_{22} $ …… $ X_{2,n_2} $
⋮⋮ ⋮⋮ ⋮⋮ ⋮⋮ ⋮⋮
Sample k-1 $ X_{k-1,1} $ $ X_{k-1,2} $ …… $ X_{k-1,n_{k-1}} $
Sample k $ X_{k,1} $ $ X_{k,2} $ …… $ X_{k,n_k} $

Hypotheses

1) The N random variables ${X_{j1}, X_{j2}, \ldots, X_{j,n_j}}$ with $j=1,2,\ldots, k$ are mutually independent.

2) For each $j\in {1,\ldots,k}$ the $n_{j}$ random variables ${X_{j1},X_{j2},\ldots,X_{j,n_j}}$ are a random sample from a continuous distribution with distribution function $F_{j}$.

3) Distribution functions $F_{1}$, $F_{2}$, …, $F_{k}$ relate through the relationship

$$F_j(t)=F(t-\tau_j),\quad -\infty < t < \infty,$$

for j = 1, 2, …, k, where F is a distribution function for a continuous distribution with unknown median and $τ_{j}$ is the effect of the (unknown) treatment for population j.

In this case, the null hypothesis $H_{0}$ of interest is that there is no difference between the effects $\tau_1, \cdots , \tau_k$, that is

$$H_0: \tau_1=\tau_2=\ldots=\tau_k.$$

This null hypothesis guarantees that each distribution function $F_{1}$, $F_{2}$, …, $F_{k}$ is the same, that is, $F_1_{ }$= $F_{2}$ = … = $F_{k}$.

To apply the Kruskal-Wallis method, we first order all N observations of the k samples from smallest to largest observation and consider $r_{ij}$ as being the position of $X_{ij}$. We take

$$R_i=\sum_{j=1}^{n_i}r_{ij} \quad \hbox{e} \quad R_{i\cdot}=\frac{R_i}{n_i}, \quad i = 1,\ldots, k.$$

Thus, we have, for example, that $R_{1}$ is the sum of the ranks of the elements in sample 1 and $R_{i.}$ is the average rank of these same observations. The Kruskal-Wallis H statistic will be given by

$$H=\frac{\frac{12}{N(N+1)}\sum_{i=1}^kn_i\left(R_{i\cdot}-\frac{N+1}{2}\right)^2}{1-\frac{ \sum_{j=1}^g t_j^3-t_j}{N^3-N}}=\frac{\left(\frac{12}{N(N+1)}\sum_{i=1}^k \frac{R_i^2}{n_i} \right)-3(N+1)}{1-\frac{\sum_{j=1}^g t_j^3-t_j}{N^3-N}}$$

in which $t_{j}$ is the size of the group of repeated elements j and g is the number of groups. An observation that is not repeated is considered a group of size 1. This statistic has, approximately, a chi-square distribution with k-1 degrees of freedom.

The steps for carrying out this test are given below:

  1. We establish the hypotheses

Screenshot_27

  1. We order the values of this new data set in increasing order of magnitude and associate each value with its corresponding rank, with each rank having the same sign as the value it represents.

  2. We calculate the value of the H statistic. Then, we set the significance level α.

  3. We find the critical values ​​referring to the set significance level. In this case, we calculate the values $Q_{α}$ so that P[H > $Q_{α }$] = α (under $H_0$).

  4. Se $H_{obs}$ > $Q_{α}$ we reject the null hypothesis that the samples come from equally distributed populations.

  5. The p-value is calculated as follows

$$P-valor = P[\chi^2_{k-1} \geq H|H_0]$$

Example 4.1

The following data is from a classic agricultural experiment to evaluate the yield of crops divided into four different groups. To maintain simplicity, we identify treatments using the integers {1,2,3,4}. We want to evaluate whether the data comes from equally distributed distributions.

Groups Answer
1 83
1 91
1 94
1 89
1 89
1 96
1 91
1 92
1 90
1 84
2 91
2 90
2 81
2 83
2 84
2 83
2 88
2 91
2 89
3 101
3 100
3 91
3 93
3 96
3 95
3 94
3 81
4 78
4 82
4 81
4 77
4 79
4 81
4 80
  1. We establish the hypotheses:

Screenshot_28

  1. From the data we have the following table, listing the ranks of each element, the sample sizes of each group and the values $R_{i}$ for each group:
$j$ $r_{1j}$ $r_{2j}$ $r_{3j}$ $r_{4j}$
1 11 23 34 2
2 23 19,5 33 9
3 28,5 6,5 23 6,5
4 17 11 27 1
5 17 13,5 31,5 3
6 31,5 11 30 6,5
7 23 15 28,5 4
8 26 23 6,5
9 19,5 17
10 13,5
$R_i$ 210 139,5 213,5 32
$N$ 34 34 34 34
$ni$ 10 9 8 7
  1. Calculation of the H statistic.

$$H=\frac{\left(\frac{12}{N(N+1)}\sum_{i=1}^k \frac{R_i^2}{n_i} \right)-3(N+1)}{1-\frac{\displaystyle\sum_{j=1}^g t_j^3-t_j}{N^3-N}}=$$

$$=\frac{0,010084034*(122,5+36+675,28125+1170,035714)}{1-0,006417112}=$$

$$=20,337.$$

  1. Calculation of critical values.

Setting the significance level α = 0.05 and knowing that k = 4, we have that the critical value corresponds to the point $Q_{0,95}$ = 7,815.

  1. Rejection criteria.

How $H_{obs}$ = 20,337 > $Q_{0,95}$ = 7.815, we reject the null hypothesis.

  1. In this case, the p-value is given by

$$P-valor = P[\chi^2_{k-1}\geq H_{obs}]=P[\chi^2_{3}\geq 20,337]=0,0001445.$$

resultado_kruskal_wallis.png

resultado_kruskal_wallis_grafico.png

Multiple Comparisons

When comparing various treatments, for example in the medical field, the number of treatments is generally quite small. However, when comparing the dropout rate of undergraduate students at a university, for example, we obtain a greater number of treatments. When we reject the null hypothesis $H_0$ in the Kruskal-Wallis test, it indicates that at least one of the groups is different from the others. However, we do not have information on which ones are different. In this sense, multiple comparisons procedure allows us to determine which groups are different. There is a simple procedure to determine which pairs of groups are different.

We begin by testing differences for all pairs of groups. When the sample size is large, these differences have a standard normal asymptotic distribution. However, when we have a large number of differences and if these differences are not independent, the multiple comparison procedure must be adjusted appropriately. Suppose that the hypothesis of no difference between the $k$ groups was tested and rejected at the significance level $\alpha.$ An alternative described in Siegel and Castellan is to test the significance of pairs of differences through the following inequality,

$$|R_{i.}-R_{j.}|\geq Z_{\left(\frac{\alpha}{k(k-1)}\right)}\sqrt{\frac{N(N+1)}{12}\left(\frac{1}{n_i}+\frac{1}{n_j}\right)}~~~(4.1)$$

in which

  • $n_i$ and $n_j$ are the sample sizes of the groups $i$ and $j$ respectively;
  • $N=n_1+n_2+\dots+n_k$ the total number of elements considered in all samples;
  • $R_{i.}$ and $R_{j.}$ is the effect of the groups’ ranks $i$ and $j$ respectively;
  • $|R_{i.}-R_{j.}|$ is the observed difference;
  • $Z_{\left(\frac{\alpha}{k(k-1)}\right)}\sqrt{\frac{N(N+1)}{12}\left(\frac{1}{n_i}+\frac{1}{n_j}\right)}$ is the critical difference.

Thus, if (4.1) occurs we can reject the hypothesis $H_0:\tau_i=\tau_j$ and conclude that $H_1:\tau_i\neq\tau_j.$ It is worth remembering that in this multiple comparison test, if we have $k$ groups, then the number of comparisons is $\frac{k(k-1)}{2}.$ Now, let’s apply the concepts in the following example.

Example 4.2

Returning to example 4.1

1. Calculate the observed differences.

$j$ $r_{1j}$ $r_{2j}$ $r_{3j}$ $r_{4j}$
1 11 23 34 2
2 23 19,5 33 9
3 28,5 6,5 23 6,5
4 17 11 27 1
5 17 13,5 31,5 3
6 31,5 11 30 6,5
7 23 15 28,5 4
8 26 23 6,5
9 19,5 17
10 13,5
$\overline{R}_{i.}$ 21 15,5 26,68 4,57

Table 4.1: Posts for each group.

Screenshot_29

Table 4.2: Difference observed for each comparison $k$.

2. Consult the standard normal table for the value of Z:

$$Z_{\left(\frac{\alpha}{k(k-1)}\right)}=Z_{\left(\frac{0,05}{4(4-1)}\right)}=2,638257$$

3. Calculate critical differences:

Comparison $Z_{(\frac{\alpha}{k(k-1)})}$ $\sqrt{\frac{N(N+1)}{12}\left(\frac{1}{n_i}+\frac{1}{n_j}\right)}$ Critical Difference
1 - 2 2,638257 4,575498 12,07134
1 - 3 2,638257 4,723611 12,4621
1 - 4 2,638257 4,907477 12,94719
2 - 3 2,638257 4,838838 12,7661
2 - 4 2,638257 5,018484 13,24005
3 - 4 2,638257 5,153882 13,59727

Table 4.3: Critical Differences.

See below the results obtained by the Action software for the same example.

(image missing)

7.5 Friedman test

The Friedman test is a non-parametric alternative to the Randomized Block Design (RBD) test in regular ANOVA. It replaces the RBD when normality assumptions are not assured, or when variations are possibly different from population to population. This test uses the data ranks instead of their raw values ​​to calculate the test statistics. Because the Friedman test makes no assumptions about the distribution, it is not as powerful as the standard test if the populations are truly normal.

Milton Friedman published the first results for this type of test. He received the Nobel Prize in Economics in 1976 and one of the publications about his discovery was the article “The Use of Ranks to Avoid the Assumption of Normality Implicit in Analysis of Variance”, published in 1937.

friedman

Figure 5.1: Milton Friedman (1912-2006).

Let us remember that the RBD design requires repeated measures for each block at each treatment level. Suppose $X_{ij}$, represents the experimental result of factor (or “block”) i with treatment j, where i = 1, …, b and j = 1, …, k.

Screenshot_30

Table 5.1: Cross Table of Data.

To calculate the Friedman test statistic, we order the k observations from smallest to largest separately in each of the b blocks and assign the ranks {1, 2, …, k} to each block of the observation table. Thus, the expected position of any observation under $H_{0}$ is (k + 1)/2. Being $r(X_{ij}$) the rank of the observation $X_{ij}$ we define the sum of all ranks in column j (i.e., for each treatment) by

$$R_j=\sum^b_{i=1}r(X_{ij}), \quad 1\leq j\leq k.\quad (5.1)$$

Se $H_{0}$ is true, the expected value of $R_{j}$ is $E(R_{j}$)=b(k+1)/2. In this way, the statistics

$$\sum^k_{j=1}\left(R_j-\frac{b(k+1)}{2}\right)^2$$

It’s an intuitive way to reveal the differences between treatments.

The Friedman test statistic will be given by

$$S=\frac{12b}{k(k+1)}\sum_{j=1}^k\left(\frac{R_j}{b}-\frac{k+1}{2}\right)^2=\left[\frac{12} {bk(k+1)}\displaystyle\sum_{j=1}^k R_j^2\right]-3b(k+1)$$

Se $F_{j}$(t) = $F(t+τ_{j}$) is the distribution function of treatment j, with j = 1, 2, …, k, in the Friedman test we are interested in testing the hypothesis $H_{0}$: $τ_{1}$ = $τ_{2}$ = … = $τ_{k}$ against the alternative hypothesis that $τ_{1}$, $τ_{2}$, …, $τ_{k}$ they are not all the same. In this case, at the significance level α, we reject the hypothesis $H_{0}$ if S ≥ $s_{α}$, otherwise we do not reject the null hypothesis, in which the constant $s_{α}$ is chosen so that the probability of type I error is equal to α.

Approximation for large samples

Under $H_{0}$, the S statistic has, when n tends to infinity, a chi-square distribution $\chi^2$ with k-1 degrees of freedom. In this case, using the chi-square approximation, we reject $H_{0}$ if $S\geq \chi_{k-1,\alpha}^2$, otherwise we do not reject $H_{0}$, where $\chi_{k-1,\alpha}^2$ is such that $P[\chi^2_{k-1}\geq \chi^2_{k-1,\alpha}]=\alpha$.

Repeated observations

If there are repeated observations among the k observations of the same block, a modification to the S statistic is necessary. In this case we replace S by

$$S^{\prime}=\frac{12\displaystyle\sum_{j=1}^k R_j^2-3b^2k(k+1)^2}{bk(k+1)-[\frac{1}{k-1}]\displaystyle\sum_{i=1}^n ({(\displaystyle\sum_{j=1}^{g_1}t_{i,j}^3)-k})},$$

in which $g_{i}$ denotes the number of groups of repeated observations in the ith block and $t_{i,j}$ is the size of the jth group of repeated observations in the ith block. In particular, if there are no repeated observations among the observations in the ith block, then $g_{i}$ = k e $t_{i,j}$ = 1 for each j = 1, …, k. If in all blocks there are no repeated observations, then S' reduces to S.

The p-value is calculated as follows

$$P-valor = P[\chi^2_{k-1}\geq S^{\prime}|H_0].$$

Example 5.1

In a vehicle performance evaluation, six drivers evaluated three cars (A, B, and C) in a randomized study. The objective of the study is to study the performance of vehicles and supposedly, in the analysis of drivers, the brand of the vehicle does not influence the evaluation. In the table below, we have the ratings of each car, according to each driver, on a scale of 1 to 10.

Car Driver Answer
A 1 7
A 2 6
A 3 6
A 4 7
A 5 7
A 6 8
B 1 8
B 2 10
B 3 8
B 4 9
B 5 10
B 6 8
C 1 9
C 2 7
C 3 8
C 4 8
C 5 9
C 6 9

Initially, we set up the Ranks table

Block A B C
1 1 2 3
2 1 3 2
3 1 2,5 2,5
4 1 3 2
5 1 3 2
6 1,5 1,5 3
Total 6,5 15 14,5

In this case, we have that the numbers of groups of repeated observations in each block are $g_{1 }$= 3, $g_{2 }$= 3, $g_{3 }$= 2, $g_{4 }$= 3, $g_{5 }$= 3 and $g_{6 }$= 2. Furthermore, the sizes of each group are given by $t_{1,1 }$= $t_{1,2 }$= $t_{1,3 }$= $t_{2,1 }$= $t_{2,2 }$= $t_{2,3 }$= $t_{4,1 }$= $t_{4,2 }$= $t_{4,3 }$= $t_{5,1 }$= $t_{5,2 }$= $t_{5,3 }$= 1 and, in addition, $t_{3,1 }$= 1, $t_{3,2 }$= 2, $t_{6,1 }$= 2 and $t_{6,2 }$= 1.

In this case, we have that the statistic S' is given by

$$S^{\prime}=\frac{12(42,25+225+210,25)-3\times 36\times3(3+1)^2}{6\times 3(3+1)-\frac{1}{2}\left(6+6\right)}=8,272728$$

In this case the p-value is

$$P-valor = P[\chi^2_2\geq 8,272728]=0,01598085.$$

Multiple Comparisons

In the Friedman test, as well as in the Kruskal-Wallis test, we can perform multiple comparisons in the Friedman test. When the null hypothesis $H_0$ is rejected, we have that at least one of the groups is different from the others. However, we do not have information about which groups are different. In this sense, the multiple comparisons procedure allows us to determine which groups are different. We use a simple procedure to determine which pairs of groups are different.

We test the significance of pairs of differences between groups i and j using the following inequality.

$$|R_{i}-R_{j}|\geq Z_{\left(\frac{\alpha}{k(k-1)}\right)}\sqrt{\frac{N\times k(k+1)}{6}}~~~(5.2)$$

in which

  • $ k $ is the number of groups;

  • $ N $ is the number of blocks;

  • $R_{i} $ and $ R_{j} $ is the sum of the ranks of the groups $ i $ and $ j $ respectively, defined in equation (5.1);

  • $|R_{i}-R_{j}| $ is the observed difference;

  • $ Z_{\left(\frac{\alpha}{k(k-1)}\right)}\sqrt{\frac{N\times k(k+1)}{6}} $ is the critical difference.

Thus, if (5.2) occurs we can reject the hypothesis $H_0:\tau_i=\tau_j$ and conclude that $ H_1:\tau_i\neq\tau_j. $ It is worth remembering that, in this multiple comparison test, if we have $ k $ groups, then the number of comparisons is $ \frac{k(k-1)}{2}.$ We apply the concepts in the following example.

Example 5.2

Returning to example 5.1. We have the following set of data.

Car Driver Answer
A 1 7
A 2 6
A 3 6
A 4 7
A 5 7
A 6 8
B 1 8
B 2 10
B 3 8
B 4 9
B 5 10
B 6 8
C 1 9
C 2 7
C 3 8
C 4 8
C 5 9
C 6 9

In the multiple comparisons procedure, we will follow the following steps:

1. We set up the Ranks table.

Block A B C
1 1 2 3
2 1 3 2
3 1 2,5 2,5
4 1 3 2
5 1 3 2
6 1,5 1,5 3
Total 6,5 15 14,5

2. We calculate the observed differences:

Comparison $ R_i $ $ R_j $ $ |R_i-R_j| $
A - B 6,5 15 8,5
A - C 6,5 14,5 8
B - C 15 14,5 0,5

3. Consult the standard normal table for the value of Z:

$Z_{\left(\frac{\alpha}{k(k-1)}\right)}=Z_{\left(\frac{0,05}{3(3-1)}\right)}=2,3939$

4. Calculate the critical difference:

$ Z_{\left(\frac{\alpha}{k(k-1)}\right)}\sqrt{\frac{N\times k(k+1)}{6}}=2,3939\times \sqrt{\frac{6\times 3(3+1)}{6}}=8,29299$

See below the results obtained by the Action software for the same example.

(image missing)

7.6 Adhesion Test

In this section we will describe some techniques for carrying out adhesion tests. Adherence tests consist of verifying the suitability of a probabilistic model to a set of data.

7.6.1 Anderson-Darling test

The problem we will consider here is to test the hypothesis that a given sample was taken from a given population with a continuous cumulative distribution function. $F(x)$, that is, be $x_1,x_2,\ldots,x_n$ a random sample and assume that a likely candidate for FDA from the data is $F(x)$, then, the hypothesis test to verify the adequacy of the distribution is:

Screenshot_32

Anderson and Darling (1952, 1954) proposed the following statistic for this test $$\displaystyle A^2=n\int_{-\infty}^{\infty}\frac{[F_n(x)-F(x)]}{F(x)(1-F(x))}dF(x)$$

where $F_n(x)$ is the empirical cumulative distribution function defined as

Screenshot_33

and $x_{(1)}\leq x_{(2)}\leq\ldots\leq x_{(n)}$, are the order statistics of the random sample.

The statistic $A^2$ can be put in an equivalent form: $$A^2=-n-\frac{1}{n}\sum_{i=1}^n[(2i-1)\ln(F(x_{(i)}))+(2(n-i)+1)\ln(1-F(x_{(i)}))]$$

The transformation $F(x_{(i)})$ takes $x_{(i)}$ in $U_{(i)}$ of a sample of size n with uniform distribution in $(0,1)$. Then, $$A^2=-n-\frac{1}{n}D\qquad(\star)$$

in which $D$ is given by $$D=\sum_{i=1}^n[(2i-1)\ln(U_{(i)})+(2(n-i)+1)\ln(1-U_{(i)})]$$

To calculate the value of the statistic $A^2$ We proceed as follows:

  • We order the sample values: $x_{(1)}\leq x_{(2)}\leq \ldots\leq x_{(n)}$;
  • When necessary, estimate the parameters of the distribution of interest;
  • Calculate $U_i = F(x_{(i)})$ and calculate the value of the Anderson Darling statistic $$\displaystyle A^2=-n-\frac{1}{n}\sum_{i=1}^n[(2i-1)(\ln(U_{(i)})+(2(n-i)+1)\ln(1-U_{(i)})]$$
  • For each of the distributions, calculate, if applicable, the value of the modified statistic according to the tables given for each of them.

For a distribution with known parameters we have the values of the cumulative distribution function of the statistic $A^2$ tabulated in Peter and Lewis (1960). The problem arises when one or two of the parameters of the distribution need to be estimated. To overcome this problem Stephens (1974, 1976, 1977) used asymptotic methods to tabulate the values ​​of these probabilities when the parameters of the distributions are unknown.

In the next sections we present the Anderson-Darling test for some continuous distributions.

7.6.1.1 Log Normal Distribution

For the Log-Normal distribution with probability density function given by:

$$f(x) = \dfrac{1}{\sqrt{2 \pi}, , x \sigma} , \exp \left[-\dfrac{1}{2} \left(\dfrac{\log (x) - \mu}{\sigma} \right)^2\right] ,\qquad x~>~0, -\infty~<~\mu~<~\infty \ \text{e} \ \sigma~>~0$$

We have that the Log-normal distribution arises when the exponential of the Normal distribution is taken, this way the data can be analyzed according to a Normal distribution if we work with the logarithm of the data instead of the original values. The following table provides some quantile values and the modified Anderson Darling statistic, given by $$A^2_m=\left(1+\frac{0,75}{n}+\frac{2,25}{n^2}\right)A^2$$

Case 0: The parameter $\theta (\mu,\sigma^2)$ is fully known.

Case 1: $\mu$ is known and $\sigma^2$^ is estimated by $s^2$.

Case 2: $\sigma^2$ is known and $\mu$ is estimated by $\overline{X}$.

Case 3: None of the components of $\theta = (\mu,\sigma^2)$ is known and are estimated by ($\overline{X},s^2$)

Case Modification 15,0 10,0 5,0 2,5 1,0
Case 0 - 1,610 1,933 2,492 3,070 3,857
Case 1 - 0,784 0,897 1,088 1,281 1,541
Case 2 - 1,443 1,761 2,315 2,890 3,682
Case 3 $A^2(1+(0,75/n)+(2,25/n^2))$ 0,560 0,632 0,751 0,870 1,029

Regarding the calculation of the p-value, it depends on the value of the modified Anderson-Darling statistic $A_{m}^{2}$. From this value, an interpolation is used that approximates an exponential function. We present the calculation of the p-value in the following table.

$ A_{m}^{2} $ P-value
$ A_{m}^{2} < 0,200 $ $ p-valor = 1 - exp(-13,436 + 101,14 * A_{m}^{2} - 223,73 * (A_{m}^{2})^{2}) $
$ 0,200 < A_{m}^{2} < 0,340 $ $ p-valor = 1 - exp(-8,318 + 42,796 * A_{m}^{2} - 59,938 * (A_{m}^{2})^{2}) $
$ 0,340 < A_{m}^{2} < 0,600 $ $ p-valor = exp(0,9177 - 4,279 * A_{m}^{2} - 1,38 * (A_{m}^{2})^{2}) $
$ A_{m}^{2} > 0,600 $ $ p-valor = exp(1,2937 - 5,709 * A_{m}^{2} + 0,0186 * (A_{m}^{2})^{2}) $

Note: As we work with the logarithm of the data and consequently with the normal distribution, we have to modify the statistics $A^2$, the cited cases of the parameters and the table are the same, for both the Normal and Log-normal distributions, for more details Anderson-Darling test for the Normal distribution.

Example 6.1.1:

Below, we present the ordered data and the values used to calculate the Anderson-Darling statistics:

$ i $ $ x_i $ $ log(x_i) $ $ F_x $ $ D_i $
1 0,1366026 -1,9906790 0,0177512 -5,804454
2 0,1670097 -1,7897036 0,0297473 -13,474327
3 0,1692331 -1,7764784 0,1027915 -26,012798
$ \vdots $ $ \vdots $ $ \vdots $ $ \vdots $ $ \vdots $
50 6,6128613 1,8890164 0,9824390 -5,796058

Let’s test:

Screenshot_34

To calculate the Anderson-Darling statistic, we must take the logarithm of the data, $log(x_i)$, as given in the table above. After this, we must estimate the distribution parameters, as these are not known. The parameter estimates are given by:

$$ \overline{X}=\frac{X_1+\ldots+X_n}{n} = \frac{-1,9906790 + … + 1,8890164}{50} = -0,05284422 $$

$$ \displaystyle s^2=\sum_{i=1}^n\frac{(X_i-\overline{X})^2}{n-1} = \sum_{i=1}^{50}\frac{(-1,9906790 - 0,01)^2 + … + (1,8890164- 0,01)^2}{50-1} = 0,9216453 $$

Using the formula $(\star)$, we have to $$D = -2524,497.$$

$$A^2=-n-\frac{D}{n}=-50+\frac{-2524,497}{50}=0,4899346.$$

The modified Anderson Darling statistic for this case (Case 3, with unknown μ and σ) is given by: $$A_m^2=A^2\left(1+\frac{0,75}{n}+\frac{2,25}{n^2}\right)=0,4977246.$$

Calculating the p-value we have:

$$p-valor = exp(0,9177 - 4,279 * A_{m}^{2} + 1,38 * (A_{m}^{2})^{2})=exp(0,9177 - 4,279 * 0,4977246 + 1,38 * (0,4977246)^{2})=0,2114153$$

Adopting the significance level of $5(porcentagem)%$, we have strong evidence that the data comes from a log-normal distribution.

7.6.1.2 Exponential Distribution

For the Exponential distribution with probability density function given by:

$$f(x) = \frac{1}{\beta} exp ( { - \frac{(x - \alpha)}{\beta} ) } \ (x > \alpha), $$

The following table provides some quantile values with modified Anderson Darling statistics, which is given by:

$$A^2_m = A^2\left( 1 + \frac{0,6}{n} \right) $$

It is worth mentioning that, in our case, we have to $\alpha$ = 0.

Case 1: The parameter $\alpha$ is unknown and $\beta$ is known.

Case 2: The parameter $\alpha$ is known and $\beta$ is unknown.

Case 3: Both parameters $(\alpha, \beta)$ are unknown.

Case Modification 15,0 10,0 5,0 2,5 1,0
Case 1 - 1,610 1,933 2,492 3,070 3,880
Case 2 $ A^2_m = A^2(1 + (0,6/n)) $ 0,916 1,062 1,321 1,591 1,959
Case 3 - 0,916 1,062 1,321 1,591 1,959

Note: For Case 1, the values are valid when $n \geq 5$.

Regarding the calculation of the p-value, it depends on the value of the modified Anderson-Darling statistic $A_{m}^{2}$. From this value, an interpolation is used that approximates an exponential function. We present the calculation of the p-value in the following table.

$ A_{m}^{2} $ P-value
$ A_{m}^{2} < 0,260 $ $ p-valor = 1 - exp(-12,2204 + 67,459 \times A_{m}^{2} - 110,3 \times (A_{m}^{2})^{2}) $
$ 0,260 < A_{m}^{2} < 0,510 $ $ p-valor = 1 - exp(-6,1327 + 20,218 \times A_{m}^{2} - 18,663 \times (A_{m}^{2})^{2}) $
$ 0,510 < A_{m}^{2} < 0,950 $ $ p-valor = exp(0,9209 - 3,353 \times A_{m}^{2} + 0,3 \times (A_{m}^{2})^{2}) $
$ A_{m}^{2} > 0,950 $ $ p-valor = exp(0,731 - 3,009 \times A_{m}^{2} + 0,15 \times (A_{m}^{2})^{2}) $

Example 6.1.2:

Below, we present the ordered data and the values used to calculate the Anderson-Darling statistics:

$ i $ $ x_i $ $ F_x $ $ D_i $
1 0,0037143 0,0070976 -5,653167
2 0,0162376 0,0306586 -13,474952
3 0,0307592 0,0572802 -19,902688
$ \vdots $ $ \vdots $ $ \vdots $ $ \vdots $
50 1,8187078 0,9694286 -6,561485

Let’s test:

Screenshot_35

We have the parameter $\alpha$ is known and equal to zero, however the parameter $\beta$ It is unknown, so we must estimate it. The parameter estimate is given by:

$$ \frac{1}{\overline{X}}=\frac{1}{\frac{X_1+\ldots+X_n}{n} = \frac{0,0037143 + … + 1,8187078}{50}} = \frac{1}{0,52146462} = 1,917676$$

Using the formula $(\star)$, we have to $$D = -2510,124.$$

$$A^2=-n-\frac{D}{n}=-50+\frac{-2510,124}{50} = \ 0,2024727.$$

The Anderson Darling statistic modified for this case (Case 2, with $\alpha$ known and $\beta$ unknown) is given by: $$A^2_m = A^2\left(1+\frac{0,6}{n}\right)=0,2049024$$

Using the table of critical values, we conclude that the p-value must be greater than 15%. So, there is strong evidence that the data comes from an Exponential distribution. To calculate the p-value, the following expression is used:

$$ \text{p-valor} = 1 - \exp(-12,2204 - 67,459A^2_m - 110,30A^2_m) = 0,951628$$

Thus we have a p-value equal to 0.951628, so we have strong evidence that the data comes from an Exponential distribution.

7.6.1.3 Logistics Distribution

For the Logistic distribution with probability density function given by:

$$f(x)=\frac{\exp({\frac{x-\mu}{s})}}{s((1+\exp({\frac{x-\mu}{s})}))^2},\quad x,\mu\in \mathbb{R},~~\sigma> 0.$$

The following table provides some quantile values with modified Anderson Darling statistics, which is given by:

$$A^2_m = A^2(( 1 + \frac{0,25}{n} )) $$

Case 1: The parameter $\mu$ is unknown and $s$ is known.

Case 2: The parameter $\mu$ is known and $s$ is unknown.

Case 3: Both parameters $(\mu, s)$ are unknown.

Case Modification 25,0 10,0 5,0 2,5 1,0
Case 1 - 0,615 0,857 1,046 1,241 1,505
Case 2 - 1,043 1,725 2,290 2,880 3,685
Case 3 $ A^2(1+ (0,25/n)) $ 0,428 0,563 0,660 0,769 0,906

Example 6.1.3:

Below, we present the data and values used to calculate the Anderson-Darling statistics:

$ i $ $ x_i $ $ F_x $ $ D_i $
1 94,85255 0,0012447 -6,812172
2 97,12315 0,0236866 -13,553785
3 97,68437 0,0481041 -19,855401
$ \vdots $ $ \vdots $ $ \vdots $ $ \vdots $
50 103,05806 0,9827216 -5,783810

Let’s test:

Screenshot_36

The equations given above can be solved via iterative methods and, through these, we obtained:

$$ \hat{\mu} = 99,96753 \ \text{e}\ \hat{s}=0,76489$$

Using the formula $(\star)$, we have to $$D=-2518,056.$$

$$A^2=-n-\frac{D}{n}=-50+\frac{-2518,056}{50}=0,361104.$$

The Anderson Darling statistic modified for this case (Case 3, with $\mu$ and $s$ unknown) is given by: $$ A^2_m = A^2(( 1 + \frac{0,25}{n} )) = 0,3629095$$

Using the table of critical values, we concluded that the p-value must be greater than 25%. So, there is strong evidence that the data comes from a Logistic distribution.

7.6.1.4 Gamma Distribution

For the Gamma distribution with probability density function given by:

Screenshot_37

The following table provides some quantile values with modified Anderson Darling statistics, which is given by:

$$A^2_m = A^2(( 1 + \frac{0,25}{n} )) $$

Case 1: The parameter $\alpha$ is known and $\beta$ is unknown.

Case 2: The parameter $\beta$ is known and $\alpha$ is unknown.

Case 3: Both parameters $(\alpha, \beta)$ are unknown.

$ \alpha $ 25,0 10,0 5,0 2,5 1,0
1 0,486 0,657 0,786 0,917 1,092
2 0,477 0,643 0,768 0,894 1,062
3 0,475 0,639 0,762 0,886 1,052
4 0,473 0,637 0,759 0,883 1,048
5 0,472 0,635 0,758 0,881 1,045
6 0,472 0,635 0,757 0,880 1,043
8 0,471 0,634 0,755 0,878 1,041
10 0,471 0,633 0,754 0,877 1,040
12 0,471 0,633 0,754 0,876 1,039
15 0,470 0,632 0,753 0,876 1,038
20 0,470 0,632 0,752 0,875 1,037
$ \infty $ 0,470 0,631 0,786 0,873 1,035

Example 6.1.4:

Below, we present the data and values used to calculate the Anderson-Darling statistics:

$ i $ $ x_i $ $ F_x $ $ D_i $
1 0,0101666 0,0274852 -6,353236
2 0,0117768 0,0317676 -13,479390
3 0,0118973 0,0320875 -20,294737
$ \vdots $ $ \vdots $ $ \vdots $ $ \vdots $
50 2,046896 0,9963288 -5,971350

Screenshot_38

in which $ \psi(\alpha) $ and the dizma function. We have the parameter $\beta$ can be estimated by:

$$ \hat{\beta} = \frac{\overline{X}}{\hat{\alpha}}$$

Through iterative methods we obtained:

$$ \hat{\alpha}=0,9998007 \ \text{e}\ \hat{\beta}=2,739132 $$

Using the formula $(\star)$, we have to $$D=-2509,936.$$

$$A^2=-n-\frac{D}{n}=-50+\frac{-2509,936}{50}=0,1987166.$$

Comparing with the table of critical values of the Gamma distribution we have $\hat{\alpha} \approx 1 $ and statistics $A^2$ is lower than the tabulated value, that is, 0.1987166 is lower than 0.486. Therefore, the p-value must be greater than 0.25. Therefore, there is strong evidence that the data comes from a Gamma distribution.

7.6.1.5 Weibull Distribution

For the Weibull distribution with probability density function given by:

Screenshot_40

The following table provides some quantile values with modified Anderson Darling statistics, which is given by:

$$A^2_m = A^2(( 1 + \frac{0,2}{\sqrt{n}} )) $$

Case 1: The parameter $\alpha$ is known and $\beta$ is unknown.

Case 2: The parameter $\beta$ is known and $\alpha$ is unknown.

Case 3: Both parameters $(\alpha, \beta)$ are unknown.

Case Modification 25,0 10,0 5,0 2,5 1,0
Case 1 - 0,736 1,062 1,321 1,591 1,959
Case 2 - 1,060 1,725 2,277 2,854 3,640
Case 3 $ A^2(1+(0,75/\sqrt{n})) $ 0,474 0,637 0,757 0,877 1,038

Example 6.1.5:

Below, we present the data and values used to calculate the Anderson-Darling statistics:

$ i $ $ x_i $ $ F_x $ $ D_i $
1 0,8358289 0,0231670 -6,085545
2 0,9263182 0,0362156 -13,532898
3 0,9324390 0,0372630 -20,056397
$ \vdots $ $ \vdots $ $ \vdots $ $ \vdots $
50 2,6410101 0,9764851 -6,105903

Let’s test:

Screenshot_39

Logo:

$$ \hat{\alpha} = 4,411486 \ \text{e}\ \hat{\beta} = 1,957228$$

Using the formula $(\star)$, we have to $$D=-2515,786.$$

$$A^2=-n-\frac{D}{n}=-50+\frac{-2515,786}{50}=0,3158042.$$

The Anderson Darling statistic modified for this case (Case 3, with $\alpha$ and $\beta$ unknown) is given by: $$ A^2_m = A^2(( 1 + \frac{0,2}{\sqrt{n}} )) = 0,3170674$$

Using the table of critical values, we concluded that the p-value must be greater than 25%. Therefore, there is strong evidence that the data comes from a Weibull distribution.

7.6.1.6 Gumbel Distribution

For the Gumbel distribution with probability density function given by:

$$f(x)=\frac{1}{\sigma}\exp([\frac{x-\mu}{\sigma}-\exp((\frac{x-\mu}{\sigma})))]\qquad x\in (-\infty,\infty)$$

The following table provides some quantile values with modified Anderson Darling statistics, which is given by:

$$A^2_m = A^2(( 1 + \frac{0,2}{\sqrt{n}} )) $$

Note that the modified Anderson Darling statistic is the same for the Weibull and Gumbel distributions. It is worth mentioning that the Gumbel distribution arises when taking the logarithm of a variable with the Weibull distribution.

Case 1: The parameter $\mu$ is known and $\sigma$ is unknown.

Case 2: The parameter $\sigma$ is known and $\mu$ is unknown.

Case 3: Both parameters $(\sigma, \mu)$ are unknown.

Therefore, the table of critical values ​​for the Wiebull distribution also provides some critical values ​​for the Anderson Darling statistic when we test the Gumbel distribution.

Example 6.1.6:

Below, we present the data and values used to calculate the Anderson-Darling statistics:

$ i $ $ x_i $ $ F_x $ $ D_i $
1 987,9316 0,0410970 -7,346391
2 988,6517 0,0520598 -14,052082
3 989,3635 0,0646470 -20,043039
$ \vdots $ $ \vdots $ $ \vdots $ $ \vdots $
50 1046,4969 0,9939219 -5,706632

Screenshot_41

Logo:

$$ \hat{\sigma} = 998,7901 \ \text{e}\ \hat{\mu} = 9,35564$$

Using the formula $(\star)$, we have to $$D=-2537,886.$$

$$A^2=-n-\frac{D}{n}=-50+\frac{-2537,886}{50}=0,7577566.$$

The Anderson Darling statistic modified for this case (Case 3, with $\sigma$ and $\mu$ unknown) is given by: $$A^2_m = A^2(( 1 + \frac{0,2}{\sqrt{n}} ))=0,7791892$$

Through the table of critical values we conclude that the statistics $A^2_m$ is between 0.757 and 0.877. Therefore, through linear interpolation, we have

$$\frac{0,877-0,757}{0,025 - 0,05} = \frac{0,7791892 - 0,757}{x - 0,05}$$

So, we have

$$x = 0,04537725$$

How the $p-valor=0,04537725$, adopting a significance level of 5%, we have evidence that the data does not come from a Gumbel distribution.

7.7 Intensity Model

Discrete data arises in several common situations in reliability, economics, maintenance, social sciences, among others. A typical example of discrete data in labor economics is related to the duration of unemployment measured in complete months of unemployment, which is an example in which the answer is an integer value. A broad discussion of the consequences of discrete models for data used in economics with continuous probability distributions is presented by Grimshaw et al (2005). Another application for discrete data, we can mention the “university dropout” rates, in which the time to complete the course is measured in “semesters”. In industrial applications, some equipment operates on demand or in cycles, and in these cases, we count the number of operations or cycles until failure. Thus, although we have an abundance of studies in the literature for continuous survival time data, see Aalen (1978), Fleming and Harrington (1990), Andersen et al. (1993) and Aalen et al (2009), there is a scarcity of studies in the literature applied to data relating to discrete survival time, see Gupta et al (1997), Grimshaw et al (2005), Karlis and Patilea (2007) and Yu (2007), with this in mind, we will present the intensity model for discrete random variables in the presence of censorship based on the work of Leão and Ohashi.

7.7.1 Introduction

The motivation for intensity models for discrete data can be described through the following application described in Klein and Moeschberger (1997) in which we compare two survival functions in the presence of crossing Kaplan-Meier estimates. The Gastrointestinal Tumor Study Group (1982) reported the results of a study comparing chemotherapy versus chemotherapy combined with radiotherapy in the treatment of gastric cancer. The reported survival times in days for the 45 patients in each treatment are as follows:

Screenshot_42

Table 1: Gastrointestinal Tumors Study Dataset. The + symbol means that the data is censored.

The main motivation for these data is the crossing of empirical intensity functions. In this situation, most tests have low power (see Klein and Moeschberger (1997)), a fact that is one of the main problems in hypothesis testing for the homogeneity of survival curves. Figure (1) illustrates the crossover between the Kaplan-Meier estimates.

(image missing)

Figure 1: Estimated limit product of the survival distribution.

7.7.2 Intensity Model for discrete VA in the presence of censorship

In this section, we will cover the main ideas about the intensity model for discrete random variables. Initially, a stochastic process is a family of random variables $M={M(n):\in \mathbb{N}}$ defined over the probability space $(\Omega,\mathcal{F},P),$ in which $\Omega$ is the Cantor space (see probability content). Thus, we consider $(\Omega, \mathcal{F}, P)$ a probability space and let $\mathcal{K}={1,\dots, k}\subseteq \mathbb{N}$ finite or enumerable infinite. The sample space $\Omega$ used in this model is described in the probability content in section $\sigma$-algebra and construction of v.a. Let $Y$ a random variable with values in $\mathcal{K}$ being $\pi_i=P[Y=i]$ the probability of the response variable ($Y$) take on the $i$-th category. Assuming that the categories are mutually exclusive, we have $\pi_1+\pi_2+\dots+\pi_k=1.$ In this case, we say that $Y$ is a discrete random variable. For more details on Martingale definitions and properties, see the Stochatic Processes content.

We consider $W$ and $C$ two discrete independent random variables with values in $\mathcal{K}$. The discrete random variable $W$ describes the event of interest, while the discrete random variable $C$ denotes the censoring variable. Be $X$ the random variable assuming values in $\mathcal{K}$ as in (2.1.1) defined by $$X=\min(W,C)$$

Based on $X$ we define the counting processes (for more details see Counting Processes content)

Screenshot_48

The counting process $R$ $(R^C)$ determines the category for which the event of interest (censorship) occurs. We take $(\Omega,\mathcal{F},\mathbf{A}, P)$ the stochastic basis with filtering generated by $R$ and $R^C,$ how to follow $$\mathcal{A}_0:={\Omega,\emptyset},~~~~\mathcal{A}_i:=\sigma{\Delta R(\ell),\Delta R^C(\ell):1\leq \ell \leq i},~~~i\in \mathcal{K},$$

in which, $\mathbf{A}={\mathcal{A}_i;i=0,1,\dots,k}.$ We obtain that $R$ It’s a process $\mathbf{A}$-adapted, non-decreasing and consequently, we obtain from the Doob-Meyer decomposition that $R = Y +A,$ in which $Y$ It’s a martingale and $A$ is a predictable non-decreasing process satisfying

$$Y(i)=\sum^i_{\ell=1}(R(\ell)-E[R(\ell)|\mathcal{A}_{\ell-1}]) ~~~~{e}~~~A(i)=\sum^i_{\ell=1}(E[R(\ell)|\mathcal{A}_{\ell-1}]-R(\ell-1)),$$

with $A(0)=0, Y(0)=0.$ Calculating stochastic processes related to decomposition.

Screenshot_47

We note that, if $R(1)=1,$ then

Screenshot_49

From this, we get $$E[R(2)-R(1)|R(1),C]=0,\quad \text{se}~R(1)=0~\text{e}~C=1$$

$$E[R(2)-R(1)|R(1),C]\neq0,\quad \text{se}~R(1)=0~\text{e}~C\geq 2$$

With, $W$ and $C$ independent we get

Screenshot_50

In general, we obtain

Screenshot_46

for any $i\geq 1.$

Therefore, the intensity function $h:{0,1, \cdots , k} )→[0,1]$ associated with the counting process $R$ is given by $$h(i):=\frac{P[W=i]}{P[W\geq i]},\quad(2.1.3.1)$$

with $h(0)=0,~0~<~ h(i)~<~1,$ for any $i=1,\dots,k$ and $h(k)=1$ (case $k$ be finite). With this, we obtain that $h$ uniquely describes the probability distribution of the random variable $W$ (which describes the event of interest). Furthermore, we have to $$P[W=i]=h(i)\prod^{i-1}_{\ell=1}[1-h(\ell)].$$

In fact, $$P[W\geq i-1]=\prod^{i-2}_{\ell=1}(1-h(\ell)), \quad \text{hipótese de indução}~~~~(2.1.3)$$

By induction on $i$, we obtain that

Screenshot_45

Therefore $$P[W=i]=h(i)\prod^{i-1}_{\ell=1}(1-h(\ell))$$

Thus, we conclude that the relationship presented in equation (2.1.3) is valid. Now, let’s exemplify some intensity functions for discrete data based on known probability distributions.

Example 2.1: (Geometric Distribution)

$P[W=i]=(1-p)^i p$ with parameter $p,~ 0 ~< p~<~ 1.$ Thus, we obtain by defining the intensity function for the Geometric distribution as follows $$h(i):=\frac{P[W=i]}{P[W\geq i]}=\frac{(1-p)^i p}{1-p\underbrace{\displaystyle\sum^i_{\ell=0}(1-p)^\ell}_{\frac{(1-p)^i-1}{(1-p)-1}}}=\frac{(1-p)^i p}{(1-p)^i}=p$$

which is a constant failure rate.

Example 2.2: (Poisson Distribution)

$P[W=i]=\displaystyle\frac{e^{-\lambda}\lambda^i}{i!},~i=1,2,\dots,~~\lambda> 0.$ Thus, we obtain by defining the intensity function for the Poisson distribution as follows

Screenshot_44

Example 3: (Binomial Distribution)

$P[W=i]=\displaystyle{n \choose k}p^i(1-p)^{n-i},~~i=0,1,2,\dots,n.$ Thus, we obtain by defining the intensity function for the Binomial distribution as follows $$h(i):=\frac{P[W=i]}{P[W\geq i]}=\frac{\displaystyle{n \choose i}p^i(1-p)^{n-i}}{\displaystyle\sum^n_{j=i}{n \choose j}p^j(1-p)^{n-j}}=\displaystyle{n \choose i}((\displaystyle\sum^n_{j=i}{n \choose j}((\frac{p}{1-p}))^{j-i}))^{-1}$$

Example 2.3: (Negative Binomial Distribution)

$P[W=i]=\displaystyle{k+i-1 \choose i}p^k(1-p)^{i},~~~~0<~p<~1,~n> 0,~i=0,1,2,\dots,n.$ Thus, we obtain by defining the intensity function for the Negative Binomial distribution as follows $$h(i):=\frac{P[W =i]}{P[W\geq i]}=\frac{\displaystyle{k+i-1 \choose i}p^k(1-p)^{i}}{\displaystyle\sum^n_{j=i}{k+j-1 \choose j}p^k(1-p)^{j}}=\displaystyle{k+i-1 \choose i}((\displaystyle\sum^n_{j=i}{k+j-1 \choose j}(1-p)^{j-i}))^{-1}$$

Example 2.4: (Logarithmic Series Distribution)

$P[W=i]=\displaystyle-\frac{\theta^i}{i~\log(1-\theta)},~~0<\theta< 1,~i=1,2,\dots. $ Thus, we obtain by defining the intensity function for the Logarithmic Series distribution as follows

Screenshot_43

Screenshot_51

So, we have to $$R(i)=Y(i)+A(i)=$$

$$=\sum^i_{\ell=1}(R(\ell)-E[R(\ell)|\mathcal{A}_{\ell-1}])+\sum^i_{\ell=1}V(\ell)\Delta H(i)=$$

$$=\sum^i_{\ell=1}(R(\ell)-E[R(\ell)|\mathcal{A}_{\ell-1}])+(V.H)(i),~~~~~i=0,1,\dots,k,$$

Furthermore, we have to represent $A(i)$ is a predictable process represented in multiplicative form, in which $\Delta H(\ell)=H(\ell)-H(\ell-1)=h(\ell).$ How $V$ is predictable, the process $A$ is determined by the intensity function $h$ (or, by the accumulated intensity function $H$). In this way, we have a one-to-one relationship between the intensity function $h$ and the random variable $W$ via relation (2.1.3). Therefore, to compare discrete distributions, we will evaluate the intensity functions involved.

The process (2.1.4) is called the multiplicative intensity model (see Aalen (1978)) for discrete random variables. Next, we present the inference for the discrete model in the presence of censorship.

Next, we present two results, which are important in demonstrating the consistency of the tests under certain alternative hypotheses.

Hypothesis 2.1: (Sample size proportionality)

All asymptotic results are hypothesized to be the fact that there is a limit $\displaystyle b_p=\lim_{n^\star)→ \infty}\frac{n_p}{n}$ and $X^p$ is integrable for all $p \in \mathcal{J}.$ This means that samples increase in size proportionally.

Proposition 2.1

The number of items at risk in the category $\ell,$ denoted by $V^{n_p}(\ell)$ has binomial distribution with parameters $n_p$ and $\theta^p_\ell,$ in which $\theta^p_\ell=P[X^p\geq \ell]$ for each $\ell\geq 1.$

Now, we present two results, we fix $p$ and for $\ell=1,\dots,k$ we have to $$\mathbf{E}([\frac{V^{n_p}(\ell)}{n_p})]\overset{\text{Proposição}(2.1)}{=} \theta^p_\ell~~~(2.1.5)$$

For the second result, we have to $\ell=1,\dots,k$ and $p=1,\dots,J$ we get $$\frac{V^{n^\star}(\ell)}{n_p}=\frac{([V^{n_1}(\ell)+V^{n_2}(\ell)+\cdots+V^{n_J}(\ell))]}{n_p}=$$

$$=\frac{n_1}{n_p}\frac{V^{n_1}(\ell)}{n_1}+\frac{n_2}{n_p}\frac{V^{n_2}(\ell)}{n_2}+\cdots+\frac{n_J}{n_p}\frac{V^{n_J}(\ell)}{n_J}~~~~(2.1.6)$$

Therefore, using (2.1.5) and (2.1.6) we have the following result $$\mathbf{E}([\frac{V^{n^\star}(\ell)}{n_p})]=\frac{n_1}{n_p}\mathbf{E}([\frac{V^{n_1}(\ell)}{n_1})]+\frac{n_2}{n_p}\mathbf{E}([\frac{V^{n_2}(\ell)}{n_2})]+\cdots+\frac{n_J}{n_p}\mathbf{E}([\frac{V^{n_J}(\ell)}{n_J})]$$

Screenshot_54

Our interest is to test the hypothesis of homogeneity of $J$ discrete populations subject to random censoring. In this case, we want to test the hypothesis $H_0:\pi^1_\ell=\dots=\pi^J_\ell~~~\forall\ell=1,\dots, k-1$. As the intensity function characterizes the discrete random variable, the homogeneity hypothesis is equivalent to $H_0: h^1(\ell)=\dots=h^J(\ell) ~~~\forall\ell=1,\dots, k-1$, in which $k$ It may or may not be finite. In the next chapter, we will describe the non-parametric tests used.

7.7.2.1 The Weighted Log-rank statistic

The Log-rank test was proposed by Mantel-Haennszel (1959) to compare two populations. This test was extended by Aalen (1978) and Gill (1980) to compare two survival curves subject to censored data. The case of $J$ populations with diverse censoring structures was developed by Andersen et al (1982).

This non-parametric test is based on the difference between the failure rates (or intensity functions) of each survival curve. Although the Log-rank test is the most used non-parametric test to compare two or more populations subject to censored data, this test presents two restrictions. First, the entire asymptotic theory involved with the Log-rank test has as its hypothesis the fact that the populations involved have continuous or at most mixed distributions. Second, the Log-rank test does not behave well when the intensity functions cross.

The general theorems proposed by Gill (1980) and Andersen et al (1982) are not applicable to the discrete case. The purely discrete case was recently treated by Leão and Ohashi (2011). According to Leão and Ohashi, the Log-rank test is only consistent for the case in which there are no crossovers between the intensity functions. Klein and Moeschberger (1997) showed that the Log-rank test has low power in situations in which the intensity functions cross. The main cause of low power in this type of situation is that the initial differences in favor of one population (before crossing) are canceled out after crossing by differences in favor of the other population.

In the case of two populations, several solutions were evaluated in Klein and Moeschberger (1997), among them, we mention the class of Renyi-type tests, proposed by Gill (1980). However, these tests are only applied in the case of two populations and for populations with continuous distributions. Based on the classic Cramér von-Mises test, Leão and Ohashi (2011) proposed modifications to the Log-rank test in such a way that it is consistent for any alternative hypothesis.

In this section, we will extend the Weighted Log-rank statistics proposed by Fleming and Harrington (1990) to compare $J$ discrete populations in the presence of arbitrary censoring. We remember that $R^{n^\star}(i)=R^{n_1}(i)+\dots+R^{n_J}(i)$ is the total number of events of interest in the category $i$ and that $V^{n^\star}(i)=V^{n_1}(i)+\dots+V^{n_J}(i)$ is the total number of items at Risk in the category $i$, for any $i=1,2,\dots,k$. Furthermore, we denote by $n^{\star} = (n_1, n_2 , \cdots , n_J)$ the vector of natural numbers corresponding to the sample size taken from each population and $n=n_1 + n_2 + \cdots n_J$ the total number of elements in the samples. We also say that $n^\star )→ \infty$ if $n_p )→ \infty$ for everyone $p=1 \cdots , J$. Let us derive a class of test statistics for the hypothesis $H_0:h^1(\ell)=h^2(\ell)=\dots=h^J(\ell)$, for all $\ell=1,\dots,i$, in which $i$ It may or may not be finite. Next, we denote the sequence of $\mathbb{F}$ stop times $$d^u=\sup ((\ell:\min_{q \in \mathcal{J}}\theta^q (\ell)>0 )),$$

in which $\theta^q(\ell):=P[X^q\geq\ell],\quad q\in(1,\dots,J),~\ell\geq0~~\text{e}$ $$d^u_{n^\star}=\sup (( \ell: \min_{q \in \mathcal{J} } V^{n_q}( \ell )> 0 )),~n^\star\in \mathbb{N}^J.$$

We can verify that $d_{n^\star}^u\rightarrow d^u$ in probability when $n^\star → \infty,$ in which $1\leq d^u\leq\infty$ and $d^u_{n^\star}<\infty$ for everyone $n^\star\in\mathbb{N}^J$ (properties $S_1$ and $S_2$ from the article by Leão and Ohashi). It is important to highlight that all asymptotic results in this work are obtained with the assumption of proportionality of sample size (2.1). Considering the problem of two populations $(J=2),$ Fleming and Harrington (1990) proposed the following Weighted Log-rank statistics,

$$LR(n^\star,d_{n^\star})^u=\sum^i_{\ell=1}U^{n_1}_{n_2}(n^\star,\ell)[\hat{h}^{n_2}(\ell)-\hat{h}^{n_1}(\ell)],$$

with weighting function given by

Screenshot_52

in which $u$ is a predictable, limited process that converges in probability to a limited function $w: (0,1,2, \cdots , k ) )→ \Bbb{R}$ and $n=n_1 + n_2$. One of the main considerations is the class of Tarone-Ware (1977), $$u(n^\star,\ell)=((\frac{V^{n^\star}(\ell)}{n}))^{\gamma},\quad\text{em que}~n=\sum^J_{i=1}n_i,~\gamma>0,$$

and the classes introduced by Harrington and Fleming (1982),

Screenshot_53

If we take $u(n^\star,\ell) = 1$ for everyone $\ell$, we obtain the classic Log-rank statistic. In table (2.1) we have the most used weighting functions (see Klein and Moeschberger page 210).

Weight $ u(n^\star,\ell) $
Log-rank 1
Gehan $ \displaystyle\frac{V^{n^\star}(\ell)}{n} $
Tarone and Ware $ \gamma>0 $ $ \displaystyle\left(\frac{V^{n^\star}(\ell)}{n}\right)^\gamma $
Peto and Peto $ \displaystyle\prod^{\ell-1}_{j=1}\left(1-\left(\frac{\Delta R^{n^\star}(j)}{1+V^{n^\star}(j)}\right)\right) $
Peto and Modified Peto $ \displaystyle\prod^{\ell-1}_{j=1}\left(1-\left(\frac{\Delta R^{n^\star}(j)}{1+V^{n^\star}(j)}\right)\right)~\left[\frac{\left(V^{n^\star}(j)\right)}{1+\left(V^{n^\star}(j)\right)}\right] $
Fleming and Harrington $ \gamma>0,\rho\geq0 $ $ \displaystyle\left[\prod_{j=0}^{\ell-1}\left(1-\cfrac{\Delta R^{n^\star}(j)}{V^{n^\star}(j)}\right)\right]^{\rho}\left[1-\prod^{\ell-1}_{j=0}\left(1-\cfrac{\Delta R^{n^\star}(j)}{V^{n^\star}(j)}\right)\right]^{\gamma} $

Table 2.1: Weighting functions.

Choosing the weighting process $u(n^\star,\ell)$ determines the power function of the test statistic against different alternative hypotheses. The chosen statistic will be more sensitive to the differences between the intensity functions in the categories in which $u(n^\star,\cdot)$ is large and less sensitive in the categories in which $u(n^\star,\cdot)$ is small. For the Fleming and Harrington type weighting processes with $\rho>0, \gamma=0,$ intuitively, they have good power to early detect differences (between intensity functions) that disappear over time. On the other hand, with the same process but $\rho=0, \gamma>0$ will be more powerful against alternatives with non-proportional intensity functions. The log-rank weighting process has satisfactory performance for alternatives with constant or proportional intensity functions.

Now, let’s deal with the problem of $J$ populations. To test the null hypothesis $H_0: h^1=\dots=h^J$, we derived a generalization of the weighted Log-rank statistic proposed by Fleming and Harrington (2005) that can be found in Andersen et al.. Using the weighting function

Screenshot_55

we get $$LR_{q}({n^{\star}}, j)=\sum_{q_1\neq q}\sum_{\ell=1}^{j}U^{n_q}_{n_{q_1}} (n^{\star}, \ell ) ([ \hat{h}^{n_q} (\ell)-\hat{h}^{n_{q_1}} (\ell))]$$

$$=\sum_{\ell=1}^{j}(( \frac{1}{n} ))^{1/2} u (n^{\star}, \ell) ([ \Delta R^{n_q} (\ell) - V^{n_q} (\ell)\frac{\Delta R^{n^{\star}} (\ell)}{V^{n^{\star}} (\ell)} )]$$

$$=\sum_{\ell=1}^{j} (( \frac{1}{n} ))^{1/2} u (n^{\star}, \ell) V^{n_q} (\ell) ([ \frac{\Delta R^{n_q} (\ell)}{V^{n_q} (\ell)} - \frac{\Delta R^{n^{\star}} (\ell)}{V^{n^{\star}} (\ell)} )], ~n^\star\in \mathbb{N}^J,~j\ge 1.$$

Now, it follows from Theorem (3.1) (Leão and Ohashi (2012)) and Proposition (2.1), that under $H_0$ the random vector $$LR({n^{\star}}, d^u_{n^{\star}}) :=(LR_1({n^{\star}},d^u_{n^{\star}}), \ldots , LR_{J}({n^{\star}},d^u_{n^{\star}}))^T$$

converges in distribution to $N(0,\displaystyle\Gamma(d^u))$ when $n^{\star})→ \infty$, in which $\Gamma(d^u)$ admits a consistent estimator $\hat{\Gamma}(n^\star,d^u_{n^\star}),$ in the form $\hat{\Gamma}(n^\star,i):=\displaystyle\sum^i_{\ell=1} \hat{Q}(\ell),~i\geq 1$ with $$\hat{Q}(\ell)_{i,j}=\langle\hat{Q}(\ell)a_i,a_j\rangle$$

for everyone $a\in \mathbb{R}^J$ and $\langle \cdot , \cdot \rangle_{\mathbb{R}^J}$ the inner product in $\mathbb{R}^J$. The matrix form is given by

Screenshot_56

in which

$$\hat{\phi}^2_{q,n^\star}(\ell):=\sum_{q_1\neq q}([\frac{|U^{n_q}_{n_{q_1}}(n^\star,\ell)|^2}{V^{n_{q_1}}(\ell)}\hat{h}^{n_{q_1}}(\ell)[1-\hat{h}^{n_{q_1}}(\ell)]+\frac{|U^{n_q}_{n_{q_1}}(n^\star,\ell)|^2}{V^{n_{q}}}\hat{h}^{n_{q}}(\ell)[1-\hat{h}^{n_{q}}(\ell)])]+$$

$$+2\sum_{q_1,q_2\in A_q}\frac{U^{n_q}_{n_{q_1}}(n^\star,\ell)U^{n_q}_{n_{q_2}}(n^\star,\ell)}{V^{n_{q}}(\ell)}\hat{h}^{n_{q}}(\ell)[1-\hat{h}^{n_{q}}(\ell)],~~~\ell\geq 1$$

in which, $A_q=((x,y)\in \mathcal{J}\times \mathcal{J}; x\neq y, x\neq q, y\neq q, 1\leq x < y \leq J )$ and $\mathcal{J}=(1,\dots,J).$

Furthermore,

Screenshot_57

$$-\sum_{q_1\neq k}\cfrac{U^{n_k}_{n_{q_1}}(n^\star,\ell)U^{n_r}_{n_{k}}(n^\star,\ell)}{V^{n_{k}(\ell)}}1!!1_{(V^{n_{k}}(\ell)>0)}\hat{h}^{k}(\ell)[1-\hat{h}^{k}(\ell)]-$$

$$-\sum_{q_2\neq r}\cfrac{U^{n_r}_{n_{q_2}}(n^\star,\ell)U^{n_k}_{n_{r}}(n^\star,\ell)}{V^{n_{r}(\ell)}}1!!1_{(V^{n_{r}}(\ell)>0)}\hat{h}^{r}(\ell)[1-\hat{h}^{r}(\ell)],~~~~\ell\geq 1$$

in which, $$A(k,r)= ((q_1,q_2)\in \mathcal{J}\times \mathcal{J}; q_1\neq k,q_2\neq r, q_1=q_2)~e~\mathcal{J}=(1,\dots,J).$$

However, as a consequence of the definition of statistics $LR_q(n^\star,d^u_{n^\star})$, we have to $\displaystyle \sum^J_{q=1}LR_q(n^\star,d^u_{n^\star}) = 0.$ Thus, the random vector of the Weighted Log-rank statistics is linearly dependent and the asymptotic covariance matrix $\Gamma(n^\star,d^u_{n^\star})$ has a rank no higher than $J-1.$ Under general conditions about $h^p$ $(p=1,\dots,J),$ such as existence for any $q, p=1,\dots,J$ of at least one index $\ell\leq i$ such that $h^p(\ell)>0$ and $h^q(\ell)>0,$ it can be proven that the post of $\Gamma(i)$ is $J-1,$ for any $i\geq 1$ (see, Gill (1986), Appendix 1). Likewise, the covariance estimator $$\hat{\Gamma}(n^\star,i):=\sum^i_{\ell=1}\hat{Q}(n^\star,\ell),~~~~i\geq 1$$

has posted $J-1.$ Furthermore, for any $q, p = 1,\dots,J$, there is at least one index $\ell\leq i$ such that $\Delta R^{n_p}(\ell)$ and $\Delta R^{n_q}(\ell)$ are positive. Furthermore, as $\hat{\Gamma}(n^\star,i)$ is a consistent estimator of $\Gamma(i),$ we obtain that the probability of $\hat{\Gamma}(n^\star,i)$ converges to $1$ when $n^\star$ tends to infinity. So, under $H_0,$ the statistics $$X^2(n^\star,d^u_{n^\star})=LR(n^\star,d^u_{n^\star})^T\hat{\Gamma}(n^\star,d^u_{n^\star})^{-1}LR(n^\star,d^u_{n^\star})$$

has an asymptotic Chi-Square distribution with $J- 1$ degrees of freedom, in which $\hat{\Gamma}^{-1}(n^\star,d^u_{n^\star})$ is a generalized inverse. So if we delete the last row and last column of $\hat{\Gamma}(n^\star,d^u_{n^\star}),$ resulting in $\hat{\Gamma}_0(n^\star,d^u_{n^\star})=\displaystyle\sum^j_{\ell=1}\hat{Q}_0(n^\star,\ell),j\geq1,$ we obtain by consistency of $\hat{\Gamma}(n^\star,d^u_{n^\star})$ that the position is $J-1,$ That is, the probability of $\hat{\Gamma}$ have placed $J-1$ grows to 1 when $n^\star)→\infty.$ Thus, taking the random vector $$ LR_0(n^\star,d^u_{n^\star})=(LR_1(n^\star,d^u_{n^\star}),\dots,LR_{J-1}(n^\star,d^u_{n^\star}))^T,$$

we conclude that $$X^2(n^\star,d^u_{n^\star})=LR_0(n^\star,d^u_{n^\star})^T\hat{\Gamma}_0(n^\star,d^u_{n^\star})^{-1}LR_0(n^\star,d^u_{n^\star})$$

has an asymptotic Chi-Square distribution with $J-1$ degrees of freedom, in which $\hat{\Gamma_0}(n^\star,d^u_{n^\star})^{-1}$ It’s the classic inverse.

To investigate the power of the test, we remove the assumption that $H_0$. In this case, we have to $$LR_{q}( {n^{\star}}, i)=\sum_{\ell=1}^{i} \sum_{q_1\neq q}U^{n_q}_{n_{q_1}} (n^{\star}, \ell ) ([ \hat{h}^{n_q} (\ell) -\hat{h}^{n_{q_1}} (\ell))] =$$

$$=\sum_{\ell=1}^{i} \sum_{q_1\neq q}U^{n_q}_{n_{q_1}} (n^{\star}, \ell ) ([ \frac{ \Delta Y^{n_q}(\ell)1!!1_{(V^{n_q}(\ell)>0)}}{V^{n_q}(\ell)}-\frac{\Delta Y^{n_{q_1}}(\ell) 1!!1_{(V^{n_{q_1}}(\ell)>0 )}}{V^{n_{q_1}}(\ell)} )] +$$

$$+\sum_{\ell=1}^{i}\sum_{q_1\neq q}U^{n_q}_{n_{q_1}}(n^{\star},\ell)([ h^{q}(\ell)-h^{q_1}(\ell))], ~ i \in \mathcal{K}.$$

Be $(Q_n : n \in \mathbb{N})$ a sequence of statistical tests and $(R_n : n \in \mathbb{N})$ the respective rejection regions associated with a fixed significance level. We say that a sequence of test statistics $Q_n$ is consistent with an alternative hypothesis $H_1$ if $\lim_n P(Q_n \in R_n \mid H_1)=1$, see Fleming and Harrington (1991) for more details. The class of alternative hypotheses $H_1: h^1(\ell)> h^q(\ell)$, for any $\ell =1, \cdots , k-1$ and $q=2,\cdots,J$ is called alternative hypotheses of ordered intensities.

Lemma 2.1.1

Under alternative hypotheses of ordered intensities, the Weighted Log-rank test $X^2(k-1)$ is consistent, for $k$ finite or not.

Demo

see Watanabe A.H.

Example 2.1.1

Returning to the example mentioned in the introduction section.

From the graphs of the survival function and the intensity functions, we notice a severe crossover (approximately in 1000 days) and can cause difficulty in detecting significant differences between $W_1$ and $W_2.$

(image missing)

(image missing)

(image missing)

(image missing)

The Weighted Log-rank test does not detect a significant difference at the significance level $\alpha=0,05,$ for log-rank weight $u(n^\star,\ell)=1,$ In the remaining Cramér-von Mises statistical section, we will present a statistic that detects differences when we have intersections of intensity functions.

7.7.2.2 The Modified Log-rank statistic

The Weighted Log-rank test may not perform well when intensity functions cross. To solve this problem, we propose a modification to the Weighted Log-rank statistics to deal with finite sample spaces. $(\ell=1, \cdots , k~({Finito})).$ First we define

Screenshot_58

It follows from Theorem (3.1) (Leão and Ohashi) that, under $H_0$, $MLR^{q} ({n^{\star}}, \ell )$ has a normal asymptotic distribution with zero mean and covariance matrix $Q(\ell)$, whose estimator $\hat{Q}(\ell)$ is defined in section 7.2.1. Furthermore, the martingale $MLR^{q} ({n^{\star}}, \cdot )$ has asymptotically independent increments. In this case, if we denote $$MLR_0({n^{\star}},\ell)=(MLR^1({n^{\star}}, \ell),MLR^2({n^{\star}}, \ell), \dots , MLR^{J-1}({n^{\star}}, \ell))^T,$$

we obtain the Modified Log-rank statistic

Screenshot_59

which has an asymptotic Chi-Square distribution with $(J-1)\times (k-1)$ degrees of freedom, in which $\hat{Q}_{0}(n^{\star}, \ell)$ is the covariance operator $\hat{Q} (n^{\star},\ell)$ without the last line and last column, as argued in the previous section, and we denote $\hat{Q_0}(n^{\star}, \ell)^{-1}$ as the reverse.

With this type of modification in relation to the Weighted Log-rank proposed by Fleming and Harrington (1990) for two populations (J=2) and extended by Leão and Ohashi for J discrete populations, we solve the problem of initial differences canceled in favor of the other population, as stated in the introduction section. Therefore, we solve the problem of crossing intensity functions for finite sample spaces. For the case of enumerable infinite sample spaces, we use the Cramér-von Mises statistic proposed by Leão and Ohashi.

When we remove the hypothesis $H_0$, we arrive at the following equation $$MLR^{q}({n^{\star}},\ell)=\sum_{q_1\neq q}U^{n_q}_{n_{q_1}} (n^{\star}, \ell ) ([ \hat{h}^{n_q} (\ell) -\hat{h}^{n_{q_1}} (\ell))] =$$

Screenshot_60

$$+\sum_{q_1\neq q} U^{n_q}_{n_{q_1}}(n^{\star}, \ell ) ([ h^{q}(\ell) - h^{q_1}(\ell))], ~ \ell \in \mathcal{K}.$$

As in the Weighted Log-rank Statistics section, we define $(Q_n : n \in \mathbb{N})$ a sequence of statistical tests and $(R_n : n \in \mathbb{N})$ the respective rejection regions associated with a fixed significance level. We say that a sequence of test statistics $Q_n$ is consistent with an alternative hypothesis $H_1$ if $\displaystyle\lim_n P(Q_n \in R_n \mid H_1)=1.$ Thus, the class of alternative hypotheses is defined as

Definition 2.2.1 (Alternative hypothesis of intensities)

There is at least one index pair $q,q_1=1,\cdots, J$ with $q\neq q_1$ for which $H_1:h^q(\ell) \neq h^{q_1}(\ell)$, for some $\ell =1, \cdots , k-1.$

Example 2.2.1 (Homogeneity Test in tables $2\times2$)

Let’s suppose that $n_1 + n_2$ Data observations are summarized in a table $2\times 2,$

Category 1 Category 2 Total
Pop1 $ \Delta R^{n_1}(1) $ $ \Delta R^{n_1}(2) $ $ n_1=V^{n_1}(1) $
Pop2 $ \Delta R^{n_2}(1) $ $ \Delta R^{n_2}(2) $ $ n_2=V^{n_2}(2) $
Total $ \Delta R^{n^\star}(1) $ $ \Delta R^{n^\star}(2) $ $ n_1+n_2=V^{n^\star} $

Let’s admit that each sample is a random sample, they are independent of each other and each observation can be classified in the category $1$ or in the category $2$, but not both. Be $\pi^1_1$ the probability that an element of population 1 is classified in category $1$ and $\pi^2_1$ the corresponding population 2. In this example, we want to test the hypothesis $H_0:\pi^1_1=\pi^2_1,$ or equivalently, $H_0:h^1(1)=h^2(1).$ So, we have the following Log-rank statistic $(u(n^\star,1)=1)$ $$MLR(n^\star,1)=((\frac{1}{n_1+n_2}))^{1/2}((\frac{V^{n_1}(1)V^{n_2}(1)}{V^{n^\star}}))([\hat{h}^{n_2}(1)-\hat{h}^{n_1}(1))]=$$

$$=((\frac{1}{n_1+n_2}))^{1/2}((\frac{V^{n_1}(1)V^{n_2}(1)}{V^{n^\star}}))([\frac{\Delta R^{n_2}(1)}{V^{n_2}(1)}-\frac{\Delta R^{n_1}(1)}{V^{n_1}(1)})]\overset{\Delta R^{n_2}=\Delta R^{n^\star}-\Delta R^{n_1}}{=}$$

$$=((\frac{1}{n_1+n_2}))^{1/2}((\Delta R^{n_1}(1)-\frac{V^{n_1}(1)}{V^{n^\star}}\Delta R^{n^\star}(1))),~~~~(1.1)$$

which corresponds to the well-known Fisher’s exact test. It was proved in (Leão and Ohashi) that $\frac{MLR(1)}{\sqrt{\hat{\phi}^2_{n^\star}(1)}}$ converges in distribution to $N(0,1)$ when $n^\star)\rightarrow \infty,$ in which $$\hat{\phi}^2_{n^\star}(1):=\frac{V^{n_2}(1)}{V^{n^\star}(1)}\hat{h}^{n_1}(1)([1-\hat{h}^{n_1}(1))]+\frac{V^{n_1}(1)}{V^{n^\star}(1)}\hat{h}^{n_2}(1)([1-\hat{h}^{n_2}(1))]$$

Sometimes it is necessary to combine results from several contingency tables $2\times 2$ in a general analysis. This situation occurs when a general experiment consists of several smaller experiments conducted in various situations. In this case, the data is summarized in several contingency tables $2\times 2$ obtained from independent experiments. Be $k$ the number of tables and $\pi^1_{\ell}$ the probability of an observation in row 1 being classified in column 1, in $\ell$-th contingency table, and $\pi^2_{\ell}$ the corresponding probability of line 2. We consider the null hypothesis $H_0: \pi^1_{\ell}=\pi^2_{\ell},$ for everyone $\ell =1,\dots,k-1.$ We denote $MLR(\ell)$ the Modified Log-rank vector for the $\ell$-th table and $\hat{\phi}^{2,\ell}_{n^\star}(\ell)$ the associated variance. Thus, we arrive at the Mantel-Haenszel statistics for contingency tables $2\times2$ as follows $$MH(1)=\frac{MLR(n^\star,1)}{\sqrt{\displaystyle\hat{\phi}^{2}(n^\star,1)}}$$

Now, the Modified Log-rank statistic is given by $$MX^2(n^\star,1)=\frac{(MLR(n^\star,1))^2}{\hat{\phi}^{2}(n^\star,1)}$$

Example 2.2.2: (Homogeneity Test in tables $J\times k$)

This table can be used to present data contained in multiple samples. We have $J$ samples, and instead of each sample providing two categories, we consider $k$ categories. However, we are under the censored structure model, in which the observed data are given by $(\Delta R^p_m,\Delta R^{C,p}_m(\ell)).$ For each category we can associate the table (2.2.1).

Category 1 …… Category 2 Total
Number of Events $ \Delta R^{n_1}(\ell) $ …… $ \Delta R^{n_J}(\ell) $ $ \Delta R^{n^\star}(\ell) $
Number of Events at Risk $ V^{n_1}(\ell) $ …… $ V^{n_J}(\ell) $ $ V^{n^\star}(\ell) $

Table 2.2.1: Summary of observations for the $\ell$-th category.

Now, let’s generalize example (2.2.1) to contingency tables $J\times k.$ we have the equation

It follows from (1) and taking the log-rank weight, that is, $u(n^\star,\ell)=1$ that $$MLR^{q}({n^{\star}}, \ell):=\sum_{q_1\neq q}((\frac{1}{n}))^{1/2}((\frac{V^{n_q}(\ell)V^{n_{q_1}}(\ell)}{V^{n^\star}(\ell)}))[\underbrace{\hat{h}^{n_{q_1}}(\ell)}_{\frac{\Delta R^{n_{q_1}}(\ell)}{V{n_{q_1}}}(\ell)}-\underbrace{\hat{h}^{n_q}(\ell)}_{\frac{\Delta R^{n_{q}}(\ell)}{V{n_{q}}(\ell)}}]=$$

$$=((\frac{1}{n}))^{1/2}([\Delta R^{n_{q}}(\ell)-\frac{V^{n_{q}}(\ell)\Delta R^{n^\star}(\ell)}{V^{n^\star}(\ell)})]~~~(2.2.1)$$

Thus, we obtain the Modified Log-rank statistic $$MX^2({n^{\star}}, k-1)=\sum_{\ell=1}^{k-1} MLR_0({n^{\star}}, \ell)^T \hat{Q}_{0}(n^{\star}, \ell)^{-1} MLR_0({n^{\star}}, \ell),$$

Be $\pi^p_\ell$ the probability of a randomly selected element from the random variable of interest $W^p$ be classified in $\ell$-th category, for $p=1,\dots,J$ and $\ell=1,\dots,k.$ The hypothesis $H_0:\pi^1_\ell=\dots=\pi^J_\ell$ for everyone $\ell$, states that the probability of being in the category $\ell$ is the same for all random variables of interest $W^p,$ which is equivalent to the hypothesis $H_0:h^1(\ell)=\dots=h^J(\ell)$ for everyone $\ell=1, \cdots , k-1$. In this case, we can apply the Weighted Log-rank statistic $X^2(n^{\star},k-1)$ and the Modified Log-rank statistic $MX^2(n^{\star},k-1)$ to test the null hypothesis $H_0.$

7.7.2.3 The Cramér-von Mises statistics

In this section, we state the Cramér-von Mises statistic proposed by Leão and Ohashi for discrete populations in the presence of censorship. Next, we define the first category observed in the samples by $$d^l_{n^{\star}} = \inf ( \ell : \Delta R^{n^{\star}} (\ell ) > 0 )~~~(2.3.1)$$

and we assume that all weighted processes have the form (2.3.1). So, $d^l_{n^{\star}}\rightarrow d^l$ in probability when $n^\star\rightarrow \infty$ in which, $$d^l:= \inf ( \ell : b_1 h^1(\ell) + \cdots +b_J h^J (\ell)>0)$$

for $b_p=\displaystyle\lim_{n^\star)\rightarrow\infty}\frac{n_p}{n},~p\in\mathcal{J}$ (see Leão and Ohashi page 19).

To test the homogeneity of discrete populations in the presence of arbitrary censoring with infinite categories, we state a version of the Cramér-von Mises statistics proposed in the work of Leão and Ohashi (the mathematical details can be seen in this work).

Firstly, we consider $LR(n^\star,r)$ with $n^\star\in \mathbb{N}^J$ and $r\geq 1$ weighted by the sequence $\hat{\phi_{n^\star}}=(\hat{\phi}_{1,n^\star}(r),\dots,\hat{\phi}_{J,n^\star}(r) : r =1,2,3, \cdots)$ in Hilbert space $\ell^2(\mathbb{N})$, obtaining

$$GLR_q(n^\star, \hat{\phi_{n^\star}} ,r)=\hat{\phi}_{q, n^\star}(r)LR_{q}(n^\star,r);\quad q=1,\ldots,J-1~~~(2.3.2)$$

So, we have to $$GLR(n^\star, \hat{\phi_{n^\star}} ,r)=((\hat{\phi}_{1, n^\star}(r)LR_{1}(n^\star,r), \dots, \hat{\phi}_{J-1, n^\star}(r)LR_{J-1}(n^\star,r)))^T$$

$$\overset{(2.3.2)}{=}((GLR_1(n^\star, \hat{\phi_{n^\star}} ,r), \dots, GLR_{J-1}(n^\star, \hat{\phi_{n^\star}} ,r)))^T~~~~(2.3.3)$$

for $r\geq1$ and $n^\star \in \mathbb{N}^J.$

We build now $M_0(\ell):=\text{diag}(\phi_1(\ell),\ldots,\phi_{J-1}(\ell))$ and the covariance operator, however, we use the notation $\Gamma_0$ instead of $\Gamma$ in quadratic form. We denote the linear operator $\mathcal{Y}_0(d^l,d^u):\ell^2)\rightarrow\ell^2$ so that $(J-1)k(d^l,i)$-th coordinate of $\mathcal{Y}_0(d^l,d^u)a\doteq Y_0(d^l,i)(a_1,\ldots,a_{(J-1)k(d^l,i)})$ for $a\in \ell^2$ and $k(d^l,i)=i-d^l+1; i\geq d^l$. Thus, we introduce the set $L(d^l_{n^\star},d^u_{n^\star})=( d^l_{n^\star}\leq\ell\leq d^u_{n^\star}: \Delta R^{n^\star} (\ell) > 0)$ of the observable categories and $L(n^\star)$ cardinality. For a given $n^\star\in\mathbb{N}^J$ and $a\in \ell^2$, we define $$\hat{\mathcal{{Y}}}_0(d^l_{n^\star}, d^u_{n^\star})a$$

a real sequence in which the $(J-1)L(n^{\star})$-th coordinate is obtained by $$\hat{Y_0}(d^l_{n^\star}, d^u_{n^\star})(a_1\ldots, a_{(J-1)L(n^{\star})});$$

and $\hat{Y_0}(d_{n^\star}^l,d_{n^\star}^u)$ is the self-adjoint random operator defined by the following quadratic form in the space $\mathbb{R}^{(J-1)L(n^{\star})}.$ Thus, we obtain the following inner product $$\langle \hat{\mathcal{Y}}_0(d^l_{n^{\star}},d^u_{n^\star})a,a\rangle=\sum_{j \in L(d^l_{n^\star},d^u_{n^\star})} \langle \hat{M}_0(j)\hat{\Gamma}_0(j) \hat{M}_0(j)a_j,a_j\rangle_{\mathbb{R}^{J-1}} +$$

$$+\sum_{( \ell< j : \ell, j \in L(d^l_{n^\star},d^u_{n^\star}))} \langle \hat{M}_0(\ell) \hat{\Gamma}_0(\ell) \hat{M}_0(j)a_{\ell},a_j\rangle_{\mathbb{R}^{J-1}} +$$

$$+\sum_{ ( j < \ell : \ell, j \in L(d^l_{n^\star},d^u_{n^\star}) )} \langle \hat{M}_0(\ell) \hat{\Gamma}_0(j) \hat{M}_0(j)a_{\ell},a_j\rangle_{\mathbb{R}^{J-1}}$$

Screenshot_61

Therefore, $\mathcal{\hat{Y_0}}(d^l_{n^\star}, d^u_{n^\star}):\ell^2)\rightarrow \ell^2$ is a well-defined sequence of self-adjoint random operators of finite rank.

Finally, we define the Cramér-von Mises statistic associated with discrete models in the presence of censoring as follows $$CVM (n^\star,d^l_{n^{\star}} , d^u_{n^{\star}}) := |GLR(n^\star, \hat{\phi_{n^\star}}, d^l_{n^{\star}},d^u_{n^{\star}})|^2_{\ell^2}; n^\star\in \mathbb{N}^{J-1}.$$

We will state two theorems from the article by Leão and Ohashi, which are fundamental results for Cramér-von Mises statistics.

Theorem 2.3.1

Suppose that the assumptions (M1, M2, M3', M4') and (H1') (Leão and Ohashi) are satisfied and let $1\leq d^l\leq d^u<\infty$ and that properties (S1-S2) are also satisfied. So the limit $\lim_{n^\star)\rightarrow\infty}GLR(n^\star, \hat{\phi_{n^\star}}, d^l_{n^{\star}},d^u_{n^{\star}})$ is a Gaussian measure with zero mean in $\ell^2$ with the covariance operator $\mathcal{\hat{Y}}(d^l_{n^\star}, d^u_{n^\star})$ in $\ell^2$. In particular, $$|GLR(n^\star, \hat{\phi_{n^\star}}, d^l_{n^{\star}},d^u_{n^{\star}})|^2_{\ell^2})\rightarrow \sum_{s=1}^{\infty} \sum_{q=1}^{J-1} \lambda_{sq}\chi^2_{sq}~~~~~\text{em distribuição quando}~n^\star)\rightarrow \infty$$

in which $(\lambda_{sq} ; s\geq 1, q=1, \ldots , J-1)$ are the eigenvalues of the covariance operator $\mathcal{Y}_0(d^l,d^u)$ and $(\chi^2_{sq},~~s\geq 1,q=1,\dots,J)$ is a subset of random variables i.i.d. Chi-Square with one degree of freedom

Thus, as a consequence of theorem (2.3.1) and proposition (2.1), we obtain the following result.

Theorem 2.3.2

We assume that $U$ belongs to class $\mathcal{K}$ and satisfies the sample size proportionality condition of proposition (2.1) and is $(d^l,d^u, d^l_{n^\star},d^l_{n^\star})$ stop time categories. So, under $H_0$ $$CVM (n^\star,d^l_{n^{\star}} , d^u_{n^{\star}}))\rightarrow \sum_{s=1}^{\infty} \sum_{q=1}^{J-1} \lambda_{sq}\chi^2_{sq}~~~~~\text{em distribuição quando}~n^\star\rightarrow \infty$$

in which $(\lambda_{sq} ; s\geq 1, q=1, \ldots , J-1)$ are the eigenvalues of the covariance operator $\mathcal{Y}_0(d^l,d^u).$ In particular, if $X^q$ is square integrable for all $q\in \mathcal{J}$ then

Screenshot_62

in which $(\hat{\lambda}_{sq} ; 1\leq s\leq L(n^\star), q=1, \ldots , J-1)$ are the random eigenvalues of the covariance operator estimator $\hat{\mathcal{Y}}_0(d^l,d^u),$ and $A(n^\star)\doteq(\hat{\mathcal{Y}}_0(d^l,d^u),~~\text{é não negativo}),$ since $P[A(n^\star)])\rightarrow1$ when $n^\star)\rightarrow \infty.$

We note that from (2.3.4), the p-value for the hypothesis test under $H_0$ is given by $$P [\Lambda(n^\star)> CVM (n^\star,d^l_{n^{\star}} , d^u_{n^{\star}}) | H_0],$$

with $\Lambda(n^\star)$ Weighted sum of independent Chi-Square random variables. To calculate the p-value we use one of the algorithms described in the literature, for example (Robert B. Davies [4]).

Example 2.3.1

Returning to the example mentioned in the introduction section.

From the graphs of the survival function and the intensity functions, we notice a severe crossover (approximately in 1000 days) and can cause difficulty in detecting significant differences between $W_1$ and $W_2.$

(image missing)

(image missing)

(image missing)

(image missing)

The Cramér-von Mises test, unlike the Weighted Log-rank test, detects a significant difference at the significance level $\alpha=0,05,$ for log-rank weight $u(n^\star,\ell)=1.$ Therefore, the Cramér-von Mises statistics perform well when we have severe crossing of the intensity functions.

Bibliographic References

[1] O. Aalen. Nonparametric inference for a family of counting processes. The Annals of Statistics, 6:701–726, 1978.

[2] O.O. Aalen, P. K. Andersen, Ø. Borgan, R. D. Gill, and N. Keiding. History of applications of martingales in survival analysis. Electronic Journal for History of Probability and Statistics, 5(1), 2009.

[3] P. K. Andersen, Ø. Borgan, R. D. Gill, and N. Keiding. Statistical models based on counting processes. Springer Verlag (New York), 1993.

[4] R. B. Davies. Algorithm as 155: The distribution of a linear combination of 2 random variables. Journal of the Royal Statistical Society. Series C (Applied Statistics), 29(3):323–333, 1980.

[5] T. R. Fleming and D. P. Harrington. Counting processes and survival analysis, volume 8. Wiley New York, 1991.

[6] X. Gao, M. Alvo, J. Chen, and G. Li. Nonparametric multiple comparison procedures for unbalanced one-way factorial designs. Journal of Statistical Planning and Inference, 138(8):2574–2591, 2009.

[7] RD Gill. Censoring and Stochastic Integrals, Mathematical Center Tracts 124. Amsterdam: Mathematisch Centrum, 1980.

[8] S.D. Grimshaw, J. McDonald, G. R. McQueen, and S. Thorley. Estimating hazard functions for discrete lifetimes. Communications in Statistics-Simulation and Computation, 34(2):451–463, 2005.

[9] P. L. Gupta, R. C. Gupta, and R. C. Tripathi. On the monotonic properties of discrete failure rates. Journal of Statistical Planning and Inference, 65(2):255–268, 1997.

[10] D. P. Harrington and T. R. Fleming. A class of rank test procedures for censored survival data. Biometrika, 69(3):553, 1982.

[11] Y. Hochberg. A sharper Bonferroni procedure for multiple tests of significance. Biometrika, 75(4):800, 1988.

[12] WATANABE, Alexandre Hiroshi. Discrete population comparisons. 2013. Dissertation (Masters in Computer Science and Computational Mathematics) - Institute of Mathematical and Computer Sciences, University of São Paulo, São Carlos, 2013.

Bibliographic References

[1] Gibbons, J. D. and Chakraborti, S. (2003) - Nonparametric Statistical Inference, Marcel Dekker Inc.

[2] Hájek, J. Sidák, Z. and Sen, P. K. (1999) - Theory of Rank Tests, Academic Press.

[3] Hollander, M. and Wolfe, D. (1999) - Nonparametric Statistical Methods, John Wiley and Sons.

[4] Sprent, P. (1989) - Applied Nonparametric Statistical Methods, 1 edition, Chapman and Hall

[5] Sidney Siegel and N John Castellan. Nonparametric statistics for the behavioral sciences. 1988.

[6] Conover, William Jay, and W. J. Conover. “Practical nonparametric statistics.” (1980).

[7] D’Agostino, Ralph B. Goodness-of-fit-techniques. CRC press, 1986.

Last modified 13.10.2026: ajuste das numerações (e4440012)
↑