I feel like I have come as far as I can in statistics while not understanding how design and contrast matrices work. Specifically I am interested in how to code custom contrasts like this and whether such custom contrasts can be integrated into a design matrix via the model.matrix
function.
Can anyone recommend a good book on the subject that (a) has a 'from the ground up' approach and (b) provides worked examples in R.
model.matrix
andcontrasts
functions the examples provided are quite sparse. Certain packages (afex
,glmmADMB
etc.) come with vignettes that I have found very helpful. But themodel matrix
andcontrasts
functions come from the base package. Are there vignettes on CRAN for this? $\endgroup$