Ch1 [General Statistics]
In matrix notation will write
y is a vector of observations.
X is the design matrix.
b is the effects vector.
e is the error or residual vector.
Let's somehow try to get the dataset above transmogriffed into some kind of matrix notation.
I will not go through matrix notation or mutiplication here. Google it, or use Wikipedia. Along the same lines, I will not go through anything that leads to the least squares solution of the normal linear model, but I will mention without proof that:
We can write the equations like this (focus for now only on sequence and observations):
17.11=1*intercept + 1*SeqTR + 0*SeqRT + …
17.76=1*intercept + 1*SeqTR + 0*SeqRT + …
…
…
…
22.87=1*intercept + 0*SeqTR + 1*SeqRT + …
20.80=1*intercept + 0*SeqTR + 1*SeqRT + …
Let's transmogriph this into a model matrix. In X we have a column for each constant we wish to determine. Above we just worked with three constants (intercept, and two sequence constants).
In the rows of the intercept put a one if the observations is associated with an intercept. All observations are so this is a column of pure 1's.
In the rows of Sequence TR put a 1 when the observation comes from a subject in sequence TR otherwise a 0. And so forth for Sequence RT.
We can write the model matrix (shown right in reddish color) like:
![[image]](img/uploaded/image85.jpg)
Note the bold constants just above: They correspond 1:1 to how they appear in X.
y=Xb+ey is a vector of observations.
X is the design matrix.
b is the effects vector.
e is the error or residual vector.
Let's somehow try to get the dataset above transmogriffed into some kind of matrix notation.
I will not go through matrix notation or mutiplication here. Google it, or use Wikipedia. Along the same lines, I will not go through anything that leads to the least squares solution of the normal linear model, but I will mention without proof that:
- If the error is normal with mean zero and some variance then the most likely set of constants in b is those for which the sum of squared residuals
eteis minimal.
That solution is analytically
b=(XtX))-1Xty
- This solution implies inversion of the matrix
XtX. If this matrix cannot be inverted then we have screwed up.
- For all practical purposes, if
XtXis invertible, then we have a solution. This is the case when the rank of X equals the number of columns in X.
- If any columns of X add up to give another column (or sum of columns) in X then the rank is not equal to the number of columns, and we cannot get a solution.
We can write the equations like this (focus for now only on sequence and observations):
17.11=1*intercept + 1*SeqTR + 0*SeqRT + …
17.76=1*intercept + 1*SeqTR + 0*SeqRT + …
…
…
…
22.87=1*intercept + 0*SeqTR + 1*SeqRT + …
20.80=1*intercept + 0*SeqTR + 1*SeqRT + …
Let's transmogriph this into a model matrix. In X we have a column for each constant we wish to determine. Above we just worked with three constants (intercept, and two sequence constants).
In the rows of the intercept put a one if the observations is associated with an intercept. All observations are so this is a column of pure 1's.
In the rows of Sequence TR put a 1 when the observation comes from a subject in sequence TR otherwise a 0. And so forth for Sequence RT.
We can write the model matrix (shown right in reddish color) like:
![[image]](img/uploaded/image85.jpg)
Note the bold constants just above: They correspond 1:1 to how they appear in X.
—
Pass or fail!
ElMaestro
Pass or fail!
ElMaestro
Complete thread:
- Normal linear model 101 ElMaestro 2014-02-25 08:43
- Ch1ElMaestro 2014-02-25 08:45
- Ch2 ElMaestro 2014-02-25 09:15
- Ch3 ElMaestro 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
