hill_test_rarperm_pq {MiscMetabar}R Documentation

Test multiple times effect of factor on Hill diversity with different rarefaction even depth

Description

[Experimental]

Usage

hill_test_rarperm_pq(
  physeq,
  fact,
  hill_scales = c(0, 1, 2),
  nperm = 99,
  sample.size = min(sample_sums(physeq)),
  verbose = FALSE,
  progress_bar = TRUE,
  p_val_signif = 0.05,
  type = "non-parametrique",
  ...
)

Arguments

physeq

(required): a phyloseq-class object obtained using the phyloseq package.

fact

(required) Name of the factor in physeq@sam_data used to plot different lines

hill_scales

(a vector of integer) The list of q values to compute the hill number H^q. If Null, no hill number are computed. Default value compute the Hill number 0 (Species richness), the Hill number 1 (exponential of Shannon Index) and the Hill number 2 (inverse of Simpson Index).

nperm

(int) The number of permutations to perform.

sample.size

(int) A single integer value equal to the number of reads being simulated, also known as the depth. See phyloseq::rarefy_even_depth().

verbose

(logical). If TRUE, print additional informations.

progress_bar

(logical, default TRUE) Do we print progress during the calculation?

p_val_signif

(float, ⁠[0:1]⁠) The mimimum value of p-value to count a test as significant int the prop_signif result.

type

A character specifying the type of statistical approach (See ggstatsplot::ggbetweenstats() for more details):

  • "parametric"

  • "nonparametric"

  • "robust"

  • "bayes"

...

Others arguments passed on to ggstatsplot::ggbetweenstats() function

Value

A list of 6 components :

Author(s)

Adrien Taudière

See Also

ggstatsplot::ggbetweenstats(), hill_pq()

Examples


if (requireNamespace("ggstatsplot")) {
  hill_test_rarperm_pq(data_fungi, "Time", nperm = 2)
  res <- hill_test_rarperm_pq(data_fungi, "Height", nperm = 9, p.val = 0.9)
  patchwork::wrap_plots(res$plots[[1]])
  res$plots[[1]][[1]] + res$plots[[2]][[1]] + res$plots[[3]][[1]]
  res$prop_signif
  res_para <- hill_test_rarperm_pq(data_fungi, "Height", nperm = 9, type = "parametrique")
  res_para$plots[[1]][[1]] + res_para$plots[[2]][[1]] + res_para$plots[[3]][[1]]
  res_para$pvals
  res_para$method
  res_para$expressions[[1]]
}


[Package MiscMetabar version 0.9.1 Index]