Learn R Programming

TukeyC (version 1.1-5)

TukeyC.nest: The TukeyC test 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 default
TukeyC.nest(x,
            y=NULL,
            model,
            which,
            error,
            fl1,
            fl2=0,
            sig.level=.05,
            round=2,
            dispersion=c('mm', 's', 'se'), …)

# S3 method for aov TukeyC.nest(x, which, fl1, fl2=0, sig.level=.05, round=2, dispersion=c('mm', 's', 'se'), …)

# S3 method for aovlist TukeyC.nest(x, which, error, fl1, fl2=0, sig.level=.05, round=2, dispersion=c('mm', 's', 'se'), …)

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.

fl1

A vector of length 1 giving the level of the first factor in nesting order tested.

fl2

A vector of length 1 giving the level of the second 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.

dispersion

The dispersion to be considered to the means. The possible vaues are: 'mm' = minimum and maximum, 's' = standart deviation, 'se' = standart deviation of the mean.

Potential further arguments (required by generic).

Value

The function TukeyC.nest returns a list of the class TukeyC.nest with the slots:

av

A list storing the result of aov.

groups

A vector of length equal the number of factor levels marking the groups generated.

nms

A vector of the labels of the factor levels.

ord

A vector which keeps the position of the means of the factor levels in decreasing order.

m.inf

A matrix which keeps the means and dispersion of the factor levels in decreasing order.

sig.level

A vector of length 1 giving the level of significance of the test.

r

A vector of length 1 giving the number of replicates.

which

The name of the factor whose levels were tested.

tab

An array keeping the names of the factors and factor levels and also the mean value of the repetitions for every combination of factor levels.

fl1

A vector of length 1 giving the level of the first factor in nesting order tested.

fl2

A vector of length 1 giving the level of the second 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) Experimenta<e7><e3>o em Gen<e9>tica e Melhoramento de Plantas. Editora UFLA.

Steel, R.G., Torrie, J.H & Dickey D.A. (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
# NOT RUN {
  ##
  ## 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 + P*SP*SSP + Error(blk/P/SP)',
                     which='P',
                     error='blk:P'))
  summary(tk1)
  plot(tk1)
  
  # Main factor: SP
  tk2 <- with(SSPE,
              TukeyC(dm,
                     y,
                     model='y ~ blk + P*SP*SSP + Error(blk/P/SP)',
                     which='SP',
                     error='blk:P:SP',
                     dispersion='s'))
  summary(tk2)
  plot(tk2)
  
  # Main factor: SSP
  tk3 <- with(SSPE,
              TukeyC(dm,
                     y,
                     model='y ~ blk + P*SP*SSP + Error(blk/P/SP)',
                     which='SSP',
                     error='Within',
                     dispersion='se'))
  summary(tk3)
  plot(tk3)
  
  ## Nested: p1/SP
  tkn1 <- with(SSPE,
               TukeyC.nest(dm,
                           y,
                           model='y ~ blk + P*SP*SSP + Error(blk/P/SP)',
                           which='P:SP',
                           error='blk:P:SP',
                           fl1=1))
  summary(tkn1)

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

  ## Nested: p1/sp1/SSP
  ## Testing SSP inside of level one of P and level one of SP
  tkn2 <- TukeyC.nest(av,
                      which='P:SP:SSP',
                      error='Within',
                      fl1=1,
                      fl2=1)
  summary(tkn2)

  ## Nested: p2/sp1/SSP
  tkn3 <- TukeyC.nest(av,
                      which='P:SP:SSP',
                      error='Within',
                      fl1=2,
                      fl2=1)
  summary(tkn3)
# }

Run the code above in your browser using DataLab