summaryAovOnePhase: Summarize an Theoretical Analysis of Variance Model of...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/summaryAovOnePhase.R

Description

Computes the coefficients of the variance components for the expected mean squares for single-phase experiments. The function accepts a data frame of the experimental design with the structural formulae of the block and treatment factors. Two tables containing the variance components of the random effects and fixed effects are returned.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
summaryAovOnePhase(
  design.df,
  blk.str,
  trt.str,
  var.comp = NA,
  trt.contr = NA,
  table.legend = FALSE,
  response = NA,
  latex = FALSE,
  fixed.names = NA,
  decimal = FALSE,
  digits = 2,
  list.sep = TRUE
)

Arguments

design.df

a data frame containing the experimental design. Requires every column be a factor. Any punctuation or symbol such as dots or parentheses should be avoid for the column names..

blk.str

a single string of characters containing the structural formula for the block factors using the Wilkinson-Rogers' syntax.

trt.str

a single string of characters containing the structural formula for the treatment factors using the Wilkinson-Rogers' syntax.

var.comp

a vector of characters containing the variance components of interest this allows the user to specify the variance components to be shown on the ANOVA table. This also allows the user to specify artificial stratum to facilitate decomposition. Default is NA, which uses every random factor as the variance components from random.terms.

trt.contr

a list of treatment contrast vectors, this allows the user to specify the contrasts for each treatment factor. Note that if this argument is used, it is necessary to specify the contrasts for every treatment factor with the same order as fixed.terms. Default is NA, which uses the C matrix described by John and Williams (1987).

table.legend

a logical allows the users to use the legend for the variance components of the ANOVA table for a large design. Default is FALSE, which uses the original names.

response

a numeric vector contains the responses from the experiment.

latex

a logical allows the users to output the Latex script to Latex table. Once the Latex script is generated, it requires the user to install and load two Latex packages: booktabs and bm to compile the Latex script.

fixed.names

a vector of character allows the users to modify symbols for the fixed effects for the Latex outputs.

decimal

a logical allows users to display the coefficients as the decimals. Default is FALSE, resulting in the use of function 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. Default is TRUE.

Value

The values returned depends on the value of the table.legend argument. If table.legend = FALSE, this function will return a list of two data frames. The first data frame contains the random effects and the second data frame contains the fixed effects. If the table.legend argument is TRUE, then it will return a list containing two lists. The first list consists of a data frame of random effects and a character string for the legend. The second list consists of a data frame of fixed effects and a character string for the legend. If response argument is used, the random effect table will have one extra column with of mean squares computed from the responses from the experiment.

Author(s)

Kevin Chang

References

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

Nelder JA (1965b). "The Analysis of Randomized Experiments with Orthogonal Block Structure. II. Treatment Structure and the General Analysis of Variance." Proceedings of the Royal Society of London. Series A, Mathematical and Physical Sciences, 283(1393), 163-178.

Wilkinson GN, Rogers CE (1973). "Symbolic Description of Factorial Models for Analysis of Variance." Applied Statistics, 22(3), 392-399.

See Also

terms for more information on the structural formula.

Examples

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

summaryAovOnePhase(design1, blk.str = "Ani", trt.str = "Trt") 

summaryAovOnePhase(design1, blk.str = "Ani", trt.str = "Trt", 
latex = TRUE, fixed.names = c("\\tau"))

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