| fac.sumop | R Documentation |
Computes the matrix that produces the sums
corresponding to a (generalized) factor.
fac.sumop(factor)
factor |
The (generalized) |
The design matrix X for a (generalized) factor is formed with a
column for each level of the (generalized) factor, this column
being its indicator variable. The summation matrix is formed as
X %*% t(X).
A generalized factor is a factor formed from the combinations of
the levels of several original factors. Generalized factors
can be formed using fac.combine.
A symmetric matrix.
Chris Brien
fac.combine, fac.meanop in package dae.
## set up a two-level factoir and a three-level factor, both of length 12
A <- factor(rep(1:2, each=6))
B <- factor(rep(1:3, each=2, times=2))
## create a generlaized factor whose levels are the combinations of A and B
AB <- fac.combine(list(A,B))
## obtain the operator that computes the AB means from a vector of length 12
S.AB <- fac.sumop(AB)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.