Learn R Programming

TukeyC (version 1.0-6)

TukeyC.nest: The TukeyC ... for Factorial, Split-plot and Split-SPlit plot Experiments

Description

These are methods for objects of class vector, matrix or data.frame joined as default, aov and aovlist for factorial, split-plot and split-split-plot experiments.

Usage

## S3 method for class 'default':
TukeyC.nest(x,
            y=NULL,
            model,
            which,
            error,
            fl2,
            fl3=0,
            sig.level=.05,
            round=2, \dots)

  ## S3 method for class 'aov':
TukeyC.nest(x,
            which,
            fl2,
            fl3=0,
            sig.level=.05,
            round=2, \dots)

  ## S3 method for class 'aovlist':
TukeyC.nest(x,
            which,
            error,
            fl2,
            fl3=0,
            sig.level=.05,
            round=2, \dots)

Arguments

x
A design matrix, data.frame or an aov object.
y
A vector of response variable. It is necessary to inform this parameter only if x represent the design matrix.
which
The name of the treatment to be used in the comparison. The name must be inside quoting marks.
model
If x is a data.frame object, the model to be used in the aov must be specified.
fl2
A vector of length 1 giving the level of the second factor in nesting order tested.
fl3
A vector of length 1 giving the level of the third factor in nesting order tested.
error
The error to be considered, only in case of split-plots experiments.
sig.level
Level of Significance used in the TukeyC algorithm to create the groups of means. The default value is 0.05.
round
Integer indicating the number of decimal places.
...
Potential further arguments (required by generic).

Value

  • The function TukeyC.nest returns a list of the class TukeyC.nest with the slots:
  • avA list storing the result of aov.
  • groupsA vector of length equal the number of factor levels marking the groups generated.
  • nmsA vector of the labels of the factor levels.
  • ordA vector which keeps the position of the means of the factor levels in decreasing order.
  • m.infA matrix which keeps the means, minimum and maximum of the factor levels in decreasing order.
  • sig.levelA vector of length 1 giving the level of significance of the test.
  • rA vector of length 1 giving the number of replicates.
  • whichThe name of the factor whose levels were tested.
  • tabAn array keeping the names of the factors and factor levels and also the mean value of the repetitions for every combination of factor levels.
  • fl2A vector of length 1 giving the level of the second factor in nesting order tested.
  • fl3A vector of length 1 giving the level of the third factor in nesting order tested.

Details

The function TukeyC.nest returns an object of class TukeyC.nest containing the groups of means plus other necessary variables for summary and plot. The generic functions summary and plot are used to obtain and print a summary and a plot of the results.

References

Miller, R.G. (1981) Simultaneous Statistical Inference. Springer. Ramalho M.A.P, Ferreira D.F, Oliveira A.C. (2000) Experimentacao em Genetica e Melhoramento de Plantas. Editora UFLA. Steel, Torry & Dickey. (1997) Principles and procedures of statistics a biometrical approach. Third Edition. Yandell, B.S. (1997) Practical Data Analysis for Designed Experiments. Chapman & Hall.

Examples

Run this code
##
  ## Example: Split-split-plot Experiment (SSPE)
  ## More details: demo(package='TukeyC')
  ##
  
  data(SSPE)
  ## From: design matrix (dm) and response variable (y)
  ## Main factor: P
  tk1 <- with(SSPE,
              TukeyC(dm,
                     y,
                     model='y ~ blk + SSP*SP*P + Error(blk/P/SP)',
                     which='P',
                     error='blk:P'))
  summary(tk1)
  
  # Main factor: SP
  tk2 <- with(SSPE,
              TukeyC(dm,
                     y,
                     model='y ~ blk + SSP*SP*P + Error(blk/P/SP)',
                     which='SP',
                     error='blk:P:SP'))
  summary(tk2)
  
  # Main factor: SSP
  tk3 <- with(SSPE,
              TukeyC(dm,
                     y,
                     model='y ~ blk + SSP*SP*P + Error(blk/P/SP)',
                     which='SSP',
                     error='Within'))
  summary(tk3)
  
  ## Nested: p1/SP
  tkn1 <- with(SSPE,
               TukeyC.nest(dm,
                           y,
                           model='y ~ blk + SSP*SP*P + Error(blk/P/SP)',
                           which='SP:P',
                           error='blk:P:SP',
                           fl2=1))
  summary(tkn1)

  ## From: aovlist
  av <- with(SSPE,
             aov(y ~  blk + SSP*SP*P + Error(blk/P/SP),
             data=dfm))
  summary(av)   

  ## Nested: p/sp/SSP (at various levels of sp and p) 
  tkn2 <- TukeyC.nest(av,
                      which='SSP:SP:P',
                      error='Within',
                      fl2=1,
                      fl3=1)
  summary(tkn2)

  tkn3 <- TukeyC.nest(av,
                      which='SSP:SP:P',
                      error='Within',
                      fl2=2,
                      fl3=1)
  summary(tkn3)

Run the code above in your browser using DataLab