# Design matrix with intersec 0 or 1

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?

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.