Let's skip the fancy nesting syntax! [🇷 for BE/BA]
Hi,
This is something I have arrived at after trying to understand how model matrices conceptually work and how they are used for least squares modeling.
Our model is Y=Xb + e in matrix notation, where X is the model matrix and b is the vector of model coefficients.
With simplest contrast coding you can consider X a matrix of zeros and ones (yes yes, there are other contrasts available, but for simplicity I will only work with 0 and 1 here). For each datapoint (AUC-value etc) there is a row in X, and for each coefficient we want estimated, there is in principle a column (but as written before there is reduction of some redundancies). Let's say a column corresponds to the coefficient for the Subj X in sequence Y. We will then only put two ones in that column, namely in the rows that correspond to data obatined by the Xth subject in the Yth sequence, and we will put a zero in all other rows in that column. And so forth (in order to grasp this is it a good idea also to see how a matrix (like X) is multiplied with a vector (like b)). Generally, we put a 1 in the row when the desired levels of both factors are present, and that is exactly the same way interactions are specified.
Best regards
EM.
❝ Thanks for your interesting and great posting. Could you tell me where you got this? Many thanks.
❝
❝ ❝ than "Subj : Seq" (example here). Subjects nested in Sequences is just the same as Sequences nested in Subjects to a numbercruncher (...)
This is something I have arrived at after trying to understand how model matrices conceptually work and how they are used for least squares modeling.
Our model is Y=Xb + e in matrix notation, where X is the model matrix and b is the vector of model coefficients.
With simplest contrast coding you can consider X a matrix of zeros and ones (yes yes, there are other contrasts available, but for simplicity I will only work with 0 and 1 here). For each datapoint (AUC-value etc) there is a row in X, and for each coefficient we want estimated, there is in principle a column (but as written before there is reduction of some redundancies). Let's say a column corresponds to the coefficient for the Subj X in sequence Y. We will then only put two ones in that column, namely in the rows that correspond to data obatined by the Xth subject in the Yth sequence, and we will put a zero in all other rows in that column. And so forth (in order to grasp this is it a good idea also to see how a matrix (like X) is multiplied with a vector (like b)). Generally, we put a 1 in the row when the desired levels of both factors are present, and that is exactly the same way interactions are specified.
Best regards
EM.
Complete thread:
- Let's skip the fancy nesting syntax! ElMaestro 2009-08-26 20:54 [🇷 for BE/BA]
- Let's skip the fancy nesting syntax! yjlee168 2009-08-26 22:29
- Let's skip the fancy nesting syntax!ElMaestro 2009-08-26 22:46
- Let's skip the fancy nesting syntax! yjlee168 2009-08-27 20:54
- Let's skip the fancy nesting syntax! ElMaestro 2009-08-27 22:14
- Let's skip the fancy nesting syntax! yjlee168 2009-08-27 20:54
- Let's skip the fancy nesting syntax!ElMaestro 2009-08-26 22:46
- Let's skip the fancy nesting syntax! yjlee168 2009-08-27 22:26
- Let's skip the fancy nesting syntax! ElMaestro 2009-08-27 22:46
- Simple solution ElMaestro 2009-08-27 23:53
- Simple solution yjlee168 2009-09-07 01:53
- Type III SS again ElMaestro 2009-09-07 15:47
- Type III SS again yjlee168 2009-09-07 18:08
- Type III SS again ElMaestro 2009-09-07 19:53
- Type III SS again yjlee168 2009-09-07 18:08
- Type III SS again ElMaestro 2009-09-07 15:47
- Simple solution yjlee168 2009-09-07 01:53
- Let's skip the fancy nesting syntax! yjlee168 2009-08-26 22:29