50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

infoDecompuTE (version 0.5.1)

getTrtCoef: Get the Treatment Coefficient

Description

Compute the overall treatment coefficients.

Usage

getTrtCoef(design.df, trtCols)

Arguments

design.df
a data frame containing the design of the experiment. Every column must be factors.
trtCols
a list of treatment terms generated from the terms function.

Value

This function returns a the numeric vector.

Examples

Run this code
 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)  #fixed terms

	trtTerm = attr(fT,"term.labels")
		effectsMatrix = attr(fT,"factor") 
		
		trt.Coef = getTrtCoef(design1, trtTerm)

Run the code above in your browser using DataLab