Tukey.test: Multiple comparisons for multiple variables: balanced and...

Tukey.testR Documentation

Multiple comparisons for multiple variables: balanced and unbalanced.

Description

Performs multiple comparisons in each variable. Variables should be columns in data. This function is based on TukeyHSD and HSD.test from packages stats and agricolae for multiple comparisons. These are subsequently based on aov from stats for model design.

Usage

Tukey.test(
  data,
  numberOfIndexes,
  formula,
  balanced,
  ...,
  aov.options,
  HSD.options
)

Arguments

data

a data frame, columns corresponding to indexes and rows corresponding to samples. Further columns should be included with metadata. This is used in argument Formula.

numberOfIndexes

Integer corresponding to the number of indexes to analyze. This will be take as column numbers by the function.

formula

Metadata group name. This will group samples according to a metadata column and specify the model.

balanced

whether to perform a balanced (TRUE) or unbalanced (FALSE) test

...

Further arguments to be passed to HSD.test or TukeyHSD

aov.options

Further arguments to be passed to aov. They should be included as a list (see examples)

HSD.options

Further arguments to be passed to HSD.test. They should be included as a list (see examples)

Value

Returns a data frame with as many comparisons as groups, performed for all variables (determined by numberOfIndexes). Details about parameters should be check in TukeyHSD and HSD.test. If balanced=FALSE, it returns the comparison element of HSD.test.

Examples


tukey_balanced<- Tukey.test(alpha_diversity_table,
numberOfIndexes = 4, formula = "location", balanced=TRUE)
tukey_unbalanced<- Tukey.test(alpha_diversity_table,
numberOfIndexes = 4, formula = "location", balanced=FALSE)


 tukey_unbalanced_options<- Tukey.test(alpha_diversity_table,
numberOfIndexes = 4, formula = "location", balanced=FALSE,
 aov.options=list(qr=TRUE, projections=TRUE))



nuriamw/micro4all documentation built on May 2, 2024, 9:18 a.m.