getTrtRep: Calculate the Treatment Replication number

Description Usage Arguments Value Author(s) References Examples

View source: R/getTrtRep.R

Description

Calculate the replication number of every treatment term including the interaction. This is used to compute the treatment efficiency factors.

Usage

1
getTrtRep(design.df, trtTerm)

Arguments

design.df

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

trtTerm

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

Value

A list containing two objects. The first object is a matrix called Rep which contains the replication numbers, where the rows correspond to each treatment combination and the columns correspond to the treatment factors, i.e. the replication number with respect to each treatment factor based on the treatment combination. The second object called Sca which is a numeric vector for computing a coefficients of the fixed effect parameter in EMS.

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
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 )
})

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

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

infoDecompuTE documentation built on April 14, 2020, 7:08 p.m.