model matrix and lexer [General Sta­tis­tics]

posted by ElMaestro  – Denmark, 2014-05-08 02:52 (4076 d 10:32 ago) – Posting: # 12926
Views: 6,933

Hi all,

I am somewhat sure this is an issue with the lexer and the way it constructs the model matrix.

Just a bad quick example, it is 1 AM and grandpa is jetlagged and tired....

Model = lm(foobar~Hötzi+Detlew)

Let's say Hötzi has three levels, like Nuts, completely Nuts, and completely utterly Nuts, Detlew has two levels like light smoker and heavy smoker.

Since we want an intercept we can at most have a model matrix with 6 columns. Since we fit with an intercept the first col will regularly just be a bunch of ones. If the lexer reads the fixed effects "from behind" then we will have 1 column for Detlew (one for light smoker, perhaps) followed by two for Helmut.
The solution gives one value for intercept, one for the factor called Detlew, and two for Hötzi.
If the lexer does it the other way around then we get one for intercept, 2 for Hötzi and one for Detlew.
Both are correct.

In the case with four trt's we could be interested in the effects of a trt for which the lexer rand out of (some) df's. It is a question of who-comes-first, really.

Pass or fail!
ElMaestro

Complete thread:

UA Flag
Activity
 Admin contact
23,427 posts in 4,929 threads, 1,684 registered users;
27 visitors (1 registered, 26 guests [including 11 identified bots]).
Forum time: 13:25 CEST (Europe/Vienna)

In the field of observation,
chance favors only the mind that is prepared.    Louis Pasteur

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5