1
$\begingroup$

I am constructing a model matrix for a repeated meassurments experiment with three individuals per group and three treatments per individual.

Gps <- factor(c(1,1,1,2,2,2,3,3,3)) # Groups
Tts <- factor(c("A","B","C","B","A","C","C","B","A")) # Treatments

This model matrix makes sense to me, since it estimates the variance within each individual, using the per individual mean of treatment A as the intercept.

model.matrix(~0+Gps+Tts)

However, I often see a matrix like this:

model.matrix(~Gps+Tts)

What is the difference between the two model matrices?

$\endgroup$
0
$\begingroup$

The model.matrix with 0 in the formula does not contain a column for an intercept, which corresponds to the reference level in the design. So in that case you are not interested in estimating the basic value in the reference level.

$\endgroup$
  • $\begingroup$ In the model matrix with 0, the reference level would be mean of treatment A at each individual. In the model matrix with 1, the reference level would be mean of treatment A using all individuals. Is this correct? $\endgroup$ – Sergio.pv Jan 25 '16 at 13:29
  • $\begingroup$ In the model matrix with 1, the reference level would be mean of treatment A using all individuals treated with A. $\endgroup$ – Marcin Kosiński Jan 25 '16 at 14:03
  • $\begingroup$ wouldn't that inflate the variance and therefore not be the right model for repeated measurements? $\endgroup$ – Sergio.pv Jan 25 '16 at 16:28
  • $\begingroup$ reference level would be treatment A and group 1 $\endgroup$ – Marcin Kosiński Jan 25 '16 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.