makeOverDesMat: Construct the Overall Treatment or Block design Matrix

Description Usage Arguments Details Value Author(s) References Examples

View source: R/makeOverDesMat.R

Description

Construct the treatment or block matrix of the smallest unit based from the experimental design.

Usage

1
makeOverDesMat(design.df, effectNames)

Arguments

design.df

a data frame containing the experimental design. Requires every column be a factor.

effectNames

a vector of character containing the labels of the treatment or block terms in the model generated by the terms.

Details

The main purpose this matrix is used in information decomposition. For the factorial experiment, this matrix is typically the treatment design matrix associated with the interaction effects, because the interaction effects are the smallest unit for the treatment effects.

For the two-phase experiments, the same method of information decomposition is used for the block effects of Phase 1 experiment in the stratum defined from the block structure of the Phase 2 experiment. Hence, the block design matrix of the smallest unit for the block effects of Phase 1 experiment can also be constructed using this function.

Value

A matrix where the rows correspond to the observation and columns correspond to the overall combination of the treatment factors or the block factors of the Phase 1 experiment.

Author(s)

Kevin Chang

References

John J, Williams E (1987). Cyclic and computer generated Designs. Second edition. Chapman & Hall.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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)
})

trt.str = "Trt"
  
fT = terms(as.formula(paste("~", trt.str, sep = "")), keep.order = TRUE) 

trtTerm = attr(fT,"term.labels")
effectsMatrix = attr(fT,"factor") 
    
makeOverDesMat(design1, trtTerm)
       

infoDecompuTE documentation built on May 29, 2018, 9:05 a.m.