# Durbin test

Durbin test is a non-parametric statistical test for balanced incomplete designs that reduces to the Friedman test in the case of a complete block design. In the analysis of designed experiments, the Friedman test is the most common non-parametric test for complete block designs.

## Background

In a randomized block design, k treatments are applied to b blocks. In a complete block design, every treatment is run for every block and the data are arranged as follows:
| | Treatment 1 | Treatment 2 | $\cdots$ | Treatment k |
| Block 1 | X$_{11}$ | X$_{12}$ | $\cdots$ | X$_{1k}$ |
| Block 2 | X$_{21}$ | X$_{22}$ | $\cdots$ | X$_{2k}$ |
| Block 3 | X$_{31}$ | X$_{32}$ | $\cdots$ | X$_{3k}$ |
| $\vdots$ | $\vdots$ | $\vdots$ | $\ddots$ | $\vdots$ |
| Block b | X$_{b1}$ | X$_{b2}$ | $\cdots$ | X$_{bk}$ |
For some experiments, it may not be realistic to run all treatments in all blocks, so one may need to run an incomplete block design. In this case, it is strongly recommended to run a balanced incomplete design. A balanced incomplete block design has the following properties:
* Every block contains k experimental units.
* Every treatment appears in r blocks.
* Every treatment appears with every other treatment an equal number of times.

## Test assumptions

The Durbin test is based on the following assumptions:
* The b blocks are mutually independent. That means the results within one block do not affect the results within other blocks.
* The data can be meaningfully ranked (i.e., the data have at least an ordinal scale).

## Test definition

Let R(X$_{ij}$) be the rank assigned to X$_{ij}$ within block i (i.e., ranks within a given row). Average ranks are used in the case of ties. The ranks are summed to obtain
    $R_{j}=\sum _{i=1}^{b}R(X_{ij})$
The Durbin test is then
    H$_0$: The treatment effects have identical effects
    H$_a$: At least one treatment is different from at least one other treatment
The test statistic is
    $T_{2}={\frac {T_{1}/\left(t-1\right)}{\left(bk-b-T_{1}\right)/\left(bk-b-t+1\right)}}$
where
    $T_{1}={\frac {t-1}{A-C}}\left(\sum _{j=1}^{t}R_{j}^{2}-rC\right)$
    $A=\sum _{i=1}^{b}\sum _{j=1}^{k}R(X_{ij})^{2}$
    $C={\frac {1}{4}}bk\left(k+1\right)^{2}$
where t is the number of treatments, k is the number of treatments per block, b is the number of blocks, and r is the number of times each treatment appears.
For significance level α, the critical region is given by
    $T_{2}>F_{\alpha ,k-1,bk-b-t+1}$
where F$_{α,k−1,bk−b−t+1}$ denotes the α-quantile of the F distribution with k − 1 numerator degrees of freedom and bk − b − t + 1 denominator degrees of freedom. The null hypothesis is rejected if the test statistic is in the critical region. If the hypothesis of identical treatment effects is rejected, it is often desirable to determine which treatments are different (i.e., multiple comparisons). Treatments i and j are considered different if
    $|R_{j}-R_{i}|>t_{1-\alpha /2,bk-b-t+1}{\sqrt {{\frac {2\left(A-C\right)r}{bk-k-t+1}}\left(1-{\frac {T_{1}}{b\left(k-1\right)}}\right)}}$
where R$_j$ and R$_i$ are the column sum of ranks within the blocks, t$_{1−α/2,bk−b−t+1}$ denotes the 1 − α/2 quantile of the t-distribution with bk − b − t + 1 degrees of freedom.

## Historical note

T$_1$ was the original statistic proposed by James Durbin, which would have an approximate null distribution of $\chi _{t-1}^{2}$ (that is, chi-squared with $t-1$ degrees of freedom). The T$_2$ statistic has slightly more accurate critical regions, so it is now the preferred statistic. The T$_2$ statistic is the two-way analysis of variance statistic computed on the ranks R(X$_{ij}$).

## Related tests

Cochran's Q test is applied for the special case of a binary response variable (i.e., one that can have only one of two possible outcomes). Cochran's Q test is valid for complete block designs only.