Description Usage Arguments Details Value Author(s) Examples
This function takes a model matrix X
and a contrast matrix C
and creates a transformed model matrix corresponding to a transformed set
of coefficients.
1 | contrastModel(X, C, coef.h = seq_len(ncol(C)))
|
X |
|
C |
|
coef.h |
column numbers of contrasts (in |
The last n coefficients of the transformed model matrix correspond to the n
contrasts. By default, all contrasts are set as coef.h
.
See package vignette for examples of data rotations with contrasts.
A transformed model matrix with coef.h
set as attribute.
Peter Hettegger
1 2 3 4 | group <- c("A", "A", "B", "B")
X <- model.matrix(~0+group)
C <- cbind(contrast1 = c(1, -1))
X2 <- contrastModel(X, C)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.