456 Statistics and Data Analysis for Microarrays Using R and Bioconductor
explanation of the syntax above, goes as follows. The model.matrix function
specifies a linear model without an intercept based o n the levels of the factor
REG, which in this case ha s only two levels: PA and RA.
> head(design)
PA RA
1 1 0
2 1 0
3 1 0
4 0 1
5 0 1
6 0 1
This design matrix has two columns, one for each level of the factor, with
values of 1 for the samples whose REG value have the level given by the
column name of the desig n matrix. This way of specifying the design matrix
allows the user to specify later which comparison (s)he want to make, i.e. PA
versus RA or RA versus PA. This is very useful when the factor ha s more
than two levels. The lmFit function fits the model ...