Ch3 [General Statistics]
Now all that is left is to add columns for subject:
![[image]](img/uploaded/image82.jpg)
(first two subject columns shown in X)
If we have N subjects then we'd initially try to add N columns to X, but it turns out that we need to eliminate 2 of the subject columns in order to keep XtX invertible (corresponding to a full rank X) so that we can find the maximum likelihood solution.
The status is
The vector
Nifty stuff: If you know the subject, the period, the treatment for any observation then you know tha subject's sequence. And so forth. This is why the way I wrote the model in the beginning of this thread can be smartified like C&L did it. ~ A loss of a df means something can be figured out if we just have access to auxiliary info.
But come on...
We tried to get two columns for Sequence but we had to remove one due to the intercept. Same for Period and Treatment. For Subject it got even worse. We can just fit the model without intercept, right? Then all trouble is gone!
Sort of. Then we can add two columns for Sequence (if this is the first term we deal with), now the two sequence columns add up to pure 1's, so we cannot add two period columns, and we cannot add two treatment columns, but just one of each again.
![[image]](img/uploaded/image82.jpg)
(first two subject columns shown in X)
If we have N subjects then we'd initially try to add N columns to X, but it turns out that we need to eliminate 2 of the subject columns in order to keep XtX invertible (corresponding to a full rank X) so that we can find the maximum likelihood solution.
The status is
- We wanted a model with an intercept and four fixed factors called Sequence, Period, Treatment, Subject.
- Intercept has 1 df.
- We lost one DF for sequence. Sequence has 1 df.
- We lost one DF for period. Period has 1 df.
- We lost one DF for treatment. Treatment has 1 df.
- We lost two DFs for subject. Subject has N-2 df's.
The vector
b
will thus have one row for each column in X, in total there will be 1+1+1+1+(N-2) rows in b.Nifty stuff: If you know the subject, the period, the treatment for any observation then you know tha subject's sequence. And so forth. This is why the way I wrote the model in the beginning of this thread can be smartified like C&L did it. ~ A loss of a df means something can be figured out if we just have access to auxiliary info.
But come on...
We tried to get two columns for Sequence but we had to remove one due to the intercept. Same for Period and Treatment. For Subject it got even worse. We can just fit the model without intercept, right? Then all trouble is gone!
Sort of. Then we can add two columns for Sequence (if this is the first term we deal with), now the two sequence columns add up to pure 1's, so we cannot add two period columns, and we cannot add two treatment columns, but just one of each again.
—
Pass or fail!
ElMaestro
Pass or fail!
ElMaestro
Complete thread:
- Normal linear model 101 ElMaestro 2014-02-25 08:43
- Ch1 ElMaestro 2014-02-25 08:45
- Ch2 ElMaestro 2014-02-25 09:15
- Ch3ElMaestro 2014-02-25 09:51
- Ch4 - the good, the bad and the ugly ElMaestro 2014-02-25 10:14
- Ch5 ElMaestro 2014-02-25 10:23
- Normal linear model 101 AngusMcLean 2014-03-01 17:24
- Mixed Muddle ElMaestro 2014-03-01 20:53
- Mixed Muddle AngusMcLean 2014-03-02 17:42
- Mixed Muddle ElMaestro 2014-03-02 18:10
- Mixed Muddle AngusMcLean 2014-03-02 17:42
- Mixed Muddle ElMaestro 2014-03-01 20:53