makeBlkDesMat {infoDecompuTE} | R Documentation |
Construct Block Design Matrix
Description
Construct a binary matrix representing the block design. The rows are corresponding to the observations and the columns are corresponding to the blocks.
Usage
makeBlkDesMat(design.df, blkTerm)
Arguments
design.df |
a data frame containing the experimental design. Requires
every column be a |
blkTerm |
a vector of character containing the labels of the block
terms in the model generated by the |
Value
A list of the binary matrices.
Author(s)
Kevin Chang
See Also
Examples
design1 <- local({
Ani = as.factor(LETTERS[c(1,2,3,4,
5,6,7,8)])
Trt = as.factor(letters[c(1,1,1,1,
2,2,2,2)])
data.frame(Ani, Trt, stringsAsFactors = TRUE )
})
blk.str = "Ani*Trt"
rT = terms(as.formula(paste("~", blk.str, sep = "")), keep.order = TRUE)
blkTerm = attr(rT,"term.labels")
Z = makeBlkDesMat(design1, blkTerm)
[Package infoDecompuTE version 0.6.2 Index]