getFixedEF.onePhase: Get the Fixed Components' coefficients and Efficiency Factors...

Description Usage Arguments Details Value Author(s) Examples

View source: R/getFixedEF.onePhase.R

Description

Calculate coefficients of fixed effects components of EMS and Treatment Efficiency Factors within each stratum in Single-Phase or two-phase experiment.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
getFixedEF.onePhase(
  effFactors,
  trt.Sca,
  T,
  Rep,
  table.legend,
  decimal,
  digits,
  list.sep
)

Arguments

effFactors

a list of numeric vector generated by getEffFactor function.

trt.Sca

a numeric vector generated by getTrtRep function.

T

a list of matrices generated by makeContrMat function.

Rep

a numeric matrix generated by getTrtRep function.

table.legend

a logical allows users to generate a legend for the variance components of the ANOVA table for large designs. Default is FALSE, resulting in the use of original treatment factor names.

decimal

a logical allows users to display the coefficients as the decimals. Default is FALSE, resulting in the use of fractions.

digits

a integer indicating the number of decimal places. Default is 2, resulting in 2 decimal places.

list.sep

a logical allows users to present the efficiency factors and coefficients of the fixed effects a list of separate matrices.

Details

Constructs a matrix containing the coefficients of the coefficients of fixed effects components of EMS within each stratum. Also calculates and the average efficiency factors of each treatment effect across all strata

Construct a matrix contain the coefficients of the fixed Components and the average efficiency factors of single-phase experiments.

The function uses the efficiency factors generated by getEffFactor to calculated the coefficients of fixed Effects components of EMS and insert the treatment efficiency factor within each stratum.

The complication arise in giving the row names of the matrix for the source of variation in the ANOVA table.

Value

A matrix.

Author(s)

Kevin Chang

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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"
    
rT <- terms(as.formula(paste("~", blk.str, sep = "")), keep.order = TRUE) 
blkTerm = attr(rT,"term.labels")
     
Z <- makeBlkDesMat(design1, blkTerm)

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

T <- makeContrMat(design1, trtTerm, effectsMatrix, contr.vec = NA)

N <- makeOverDesMat(design1, trtTerm)
		
Replist = getTrtRep(design1, trtTerm)   
 
Rep <- Replist$Rep
trt.Sca <- Replist$Sca
    
effFactors = lapply(makeOrthProjectors(Z), function(z) getEffFactor(z, T, N, Rep, trt.Sca))


effFactors <- effFactors[sort(1:length(effFactors), decreasing=TRUE)]

getFixedEF.onePhase(effFactors = effFactors, trt.Sca = trt.Sca,  T = T, Rep = Rep, 
			table.legend = FALSE, decimal = FALSE, digits = 2, list.sep = TRUE)

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