group_test: Performs multiple mean comparisons for a data.frame

group_testR Documentation

Performs multiple mean comparisons for a data.frame

Description

Performs multiple mean comparisons for a data.frame

Usage

group_test(
  df,
  group,
  metadata = NULL,
  method = "wilcox.test",
  pattern = NULL,
  p.adjust.method = "none",
  threads = 1,
  verbose = TRUE
)

Arguments

df

a data.frame

group

The compare group (categories) in your data, one column name of metadata when metadata exist or a vector whose length equal to columns number of df.

metadata

sample information dataframe contains group

method

the type of test. Default is wilcox.test. Allowed values include:

  • t.test (parametric) and wilcox.test (non-parametric). Perform comparison between two groups of samples. If the grouping variable contains more than two levels, then a pairwise comparison is performed.

  • anova (parametric) and kruskal.test (non-parametric). Perform one-way ANOVA test comparing multiple groups.

  • chisq.test, performs chi-squared contingency table tests and goodness-of-fit tests.

  • 'pearson', 'kendall', or 'spearman' (correlation), see cor.

pattern

a named vector matching the group, e.g. c('G1'=1,'G2'=3,'G3'=2), use the correlation analysis with specific pattern to calculate p-value.

p.adjust.method

p.adjust.method, see p.adjust, default BH.

threads

default 1

verbose

logical

Value

data.frame

Examples

data(otutab)
group_test(otutab, metadata$Group, method = "kruskal.test")
group_test(otutab[, 1:12], metadata$Group[1:12], method = "wilcox.test")

pcutils documentation built on April 4, 2025, 5:14 a.m.