# Repeated Measures ANOVA with Huynh and Feldt Epsilon Correction

The test statistics is:

$\displaystyle{ F=\frac{\sum^s_{j=1} \sum^{n_j}_{i = 1} w_{ij}(\bar{x}_j - \bar{x})^2 / (j-1)} {\sum^s_{j=1} \sum^{n_j}_{i=1} w_{ij}(\bar{x}_j - x_{ij})^2 / ((\sum^s_{j=1} \sum^{n_j}_{i = 1} w_{ij}-1) (j - 1))} }$

where:

$\displaystyle{ x_{ij} }$ is the value of the $\displaystyle{ i }$th of $\displaystyle{ n_j }$ observations in the $\displaystyle{ j }$th of $\displaystyle{ s }$ groups, where $\displaystyle{ x_{ij} }$ has been 'centered' such that $\displaystyle{ \sum^s_{j=1} x_{ij} = 0\forall i }$,
$\displaystyle{ \bar{x}_j }$ is the average in the $\displaystyle{ j }$th group,
$\displaystyle{ \bar{x} }$ is the overall average,
$\displaystyle{ w_{ij} }$ is the calibrated weight,
$\displaystyle{ p \approx \Pr(F_{(s-1)\epsilon,(\sum^s_{j=1} \sum^{n_j}_{i = 1} w_{ij}-1) (s - 1))\epsilon} \ge F ) }$, and
$\displaystyle{ \epsilon }$ is computed using the Greenhouse-Geisser method.[1]

and $\displaystyle{ F }$ is evaulated using the F-distribution with $\displaystyle{ (j-1)\epsilon }$ and $\displaystyle{ ((\sum^s_{j=1} \sum^{n_j}_{i = 1} w_{ij}-1) (j - 1))\epsilon }$ degrees of freedom, where $\displaystyle{ \epsilon = 1 / (j - 1) }$.