\[SS_{between} = n\Sigma(\bar{T}_i - \bar{G})^2 =\] \[n[(\bar{T}_1 - \bar{G})^2 +(\bar{T}_2 - \bar{G})^2 + \dots + (\bar{T}_k - \bar{G})^2]\]
\[SS_{within} = \Sigma(X_{fi} - \bar{T}_i)^2 =\] \[(X_{1i} - \bar{T}_i)^2 +(X_{2i} - \bar{T}_i)^2 + \dots + (X_{ni} - \bar{T}_i)^2\]
\[MS_{between} = \frac{SS_{between}}{k - 1}\]
\[MS_{within} = \frac{SS_{within}}{k(n−1)}\]
\[F = \frac{MS_{between}}{MS_{within}}\]
\[\textbf{P} = \begin{bmatrix} SS_1 & SP_{12} & \cdots & SP_{1p}\\ SP_{21} & SS_2 & \cdots & SP_{2p}\\ \vdots & \vdots & \ddots & \vdots\\ SP_{p1} & SP_{p2} & \cdots & SS_p\\ \end{bmatrix}\]
\[\textbf{H} = \begin{bmatrix} SS_{H,1} & SP_{H,12} & \cdots & SP_{H,1p}\\ SP_{H,21} & SS_{H,2} & \cdots & SP_{H,2p}\\ \vdots & \vdots & \ddots & \vdots\\ SP_{H,p1} & SP_{H,p2} & \cdots & SS_{H,p}\\ \end{bmatrix}\]
\[\textbf{E} = \begin{bmatrix} SS_{E,1} & SP_{E,12} & \cdots & SP_{E,1p}\\ SP_{E,21} & SS_{E,2} & \cdots & SP_{E,2p}\\ \vdots & \vdots & \ddots & \vdots\\ SP_{E,p1} & SP_{E,p2} & \cdots & SS_{E,p}\\ \end{bmatrix}\]
Roy’s greatest characteristic root = first eigenvalue of \(\textbf{H}(\textbf{H} + \textbf{E})^{-1}\)
Conceptually:
Test | Matrix | Range (\(H_0\) to \(H_A\)) | In words | Function |
---|---|---|---|---|
Wilks | E/T | 1 to 0 | Error proportion | Determinant |
Pillai | H/T | 0 to 1 | Between proportion | Trace |
Hotelling | H/E | 0 to \(\infty\) | Between to within ratio | Trace |
Roy | H/T | 0 to 1 | Between proportion | 1st eigenvalue |
These tests are similar, but they differ in terms of power and robustness to violations of assumptions
GLM: Multivariate normality of outcomes, linearity, etc
“Homogeneity of variance-covariance matrices”
Box’s M test to test this assumption
subject | condition | outcome |
---|---|---|
1 | 1 | 3 |
2 | 1 | 4 |
3 | 1 | 3 |
4 | 2 | 5 |
5 | 2 | 3 |
6 | 2 | 3 |
7 | 3 | 1 |
8 | 3 | 2 |
9 | 3 | 4 |
subject | \(Y1\_T1\) | \(Y1\_T2\) | \(Y1\_T3\) | \(Y1\_T4\) |
---|---|---|---|---|
1 | 3 | 1 | 2 | 5 |
2 | 4 | 5 | 1 | 3 |
3 | 3 | 3 | 3 | 3 |
4 | 5 | 2 | 4 | 2 |
5 | 3 | 4 | 4 | 5 |
6 | 3 | 3 | 4 | 4 |
7 | 1 | 1 | 4 | 5 |
8 | 2 | 5 | 2 | 1 |
9 | 4 | 4 | 5 | 2 |
subject | \(T\) | \(Y\) |
---|---|---|
1 | 1 | \(Y_{11}\) |
1 | 2 | \(Y_{12}\) |
1 | \(\vdots\) | \(\vdots\) |
1 | k | \(Y_{1k}\) |
2 | 1 | \(Y_{21}\) |
2 | 2 | \(Y_{22}\) |
2 | \(\vdots\) | \(\vdots\) |
2 | k | \(Y_{2k}\) |
\(\vdots\) | 3 | \(\vdots\) |
n | 1 | \(Y_{n1}\) |
n | 2 | \(Y_{n2}\) |
n | \(\vdots\) | \(\vdots\) |
n | k | \(Y_{nk}\) |
subject | \(Y1\_T1\) | \(Y1\_T2\) | \(\dots\) | \(Y1\_T4\) |
---|---|---|---|---|
1 | \(Y_{11}\) | \(Y_{12}\) | \(\dots\) | \(Y_{1k}\) |
2 | \(Y_{21}\) | \(Y_{22}\) | \(\dots\) | \(Y_{2k}\) |
3 | \(Y_{31}\) | \(Y_{32}\) | \(\dots\) | \(Y_{3k}\) |
\(\vdots\) | \(\vdots\) | \(\vdots\) | \(\ddots\) | \(\vdots\) |
n | \(Y_{n1}\) | \(Y_{n2}\) | \(\dots\) | \(Y_{nk}\) |
\[SS_{between\;subject} = k \sum_{i=1}^{n} (\overline{P}_i - \overline{G}) ^2\]
\[=k [ (\overline{P}_1 - \overline{G}) ^2 + (\overline{P}_2 - \overline{G}) ^2 + \dots + (\overline{P}_k - \overline{G}) ^2]\]
Individual subjects’ variation around their mean
For person \(i\):
\[SS_{within\;person\;i} = \sum_{j=1}^{k} (Y_{ij} - \overline{P}_i) ^2\]
\[(Y_{i1} - \overline{P}_i) ^2 + (Y_{i2} - \overline{P}_i) ^2 + \dots + (Y_{ik} - \overline{P}_i) ^2\]
Within-subjects variation = time (or treatment) + residual
Time variation = timepoint mean variation around grand mean
\[SS_{time} = n \sum_{j=1}^{k} (\overline{T}_j - \overline{G}) ^2\]
\[=n [ (\overline{T}_1 - \overline{G}) ^2 + (\overline{T}_2 - \overline{G}) ^2 + \dots + (\overline{T}_k - \overline{G}) ^2]\]
Within-subjects variation = time (or treatment) + residual
Residual variation = any remaining variation
\[SS_{residual} = SS_{time \times subject} = SS_{within\;subject} - SS_{time}\]
\[SS_{total} = SS_{between\;subject} + SS_{time} + SS_{residual}\]
Source | SS | df | MS | F |
---|---|---|---|---|
Between | \(SS_{between\;subject}\) | \(n-1\) | \(MS_{between\;subject}\) | |
Within | \(SS_{within\;subject}\) | \(n(k-1)\) | \(MS_{within\;subject}\) | |
–Time | \(SS_{time}\) | \(k-1\) | \(MS_{time}\) | \(\dfrac{MS_{time}}{MS_{residual}}\) |
–Residual | \(SS_{residual}\) | \((n-1)(k-1)\) | \(MS_{residual}\) |
\[\textbf{S}_{YY}=\begin{bmatrix}\sigma_1^2 & \sigma_{12} & \sigma_{13} & \sigma_{14} \\ & \sigma_2^2 & \sigma_{23} & \sigma_{24} \\ & & \sigma_3^2 & \sigma_{34} \\ & & & \sigma_4^2 \end{bmatrix}\]
\(\underline{Y}'_{id} = \begin{bmatrix} d_{i1}\\ d_{i2}\\ d_{i3}\\ \vdots\\ d_{i,k-1}\\ \end{bmatrix} = \begin{bmatrix} Y_{i1} - Y_{i2}\\ Y_{i2} - Y_{i3}\\ Y_{i3} - Y_{i4}\\ \vdots\\ Y_{i,k-1} - Y_{ik}\\ \end{bmatrix}\)
\(\textbf{Y}_d = \begin{bmatrix}d_{11} & d_{12} & \dots & d_{1,k-1}\\ d_{21} & d_{22} & \dots & d_{2,k-1}\\ \vdots & \vdots & \ddots & \vdots\\ d_{n1} & d_{n2} & \dots & d_{n,k-1}\\ \end{bmatrix}\)