Test multiple times effect of factor on Hill diversity with different rarefaction even depth
Source:R/alpha_div_test.R
hill_test_rarperm_pq.RdUsage
hill_test_rarperm_pq(
physeq,
fact,
q = 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-classobject obtained using thephyloseqpackage.- fact
(required) Name of the factor in
physeq@sam_dataused to plot different lines- q
(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). Hill numbers are more appropriate in DNA metabarcoding studies when
q > 0(Alberdi & Gilbert, 2019; Calderón-Sanou et al., 2019).- 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 information.
- 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 theprop_signifresult.- type
A character specifying the type of statistical approach (See
ggstatsplot::ggbetweenstats()for more details):"parametric"
"nonparametric"
"robust"
"bayes"
- ...
Additional arguments passed on to
ggstatsplot::ggbetweenstats()function
References
Alberdi, A., & Gilbert, M. T. P. (2019). A guide to the application of Hill numbers to DNA-based diversity analyses. Molecular Ecology Resources. doi:10.1111/1755-0998.13014
Calderón-Sanou, I., Münkemüller, T., Boyer, F., Zinger, L., & Thuiller, W. (2019). From environmental DNA sequences to ecological conclusions: How strong is the influence of methodological choices? Journal of Biogeography, 47. doi:10.1111/jbi.13681
Examples
# \donttest{
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]]
}
#>
|
| | 0%
|
|========================= | 50%
|
|==================================================| 100%
|
| | 0%
|
|====== | 11%
|
|=========== | 22%
|
|================= | 33%
|
|====================== | 44%
|
|============================ | 56%
|
|================================= | 67%
|
|======================================= | 78%
|
|============================================ | 89%
|
|==================================================| 100%
|
| | 0%
|
|====== | 11%
|
|=========== | 22%
|
|================= | 33%
|
|====================== | 44%
|
|============================ | 56%
|
|================================= | 67%
|
|======================================= | 78%
|
|============================================ | 89%
|
|==================================================| 100%
#> list(italic("F")["Welch"](2, 84.35) == "0.10", italic(p) == "0.90",
#> widehat(omega["p"]^2) == "0.00", CI["95%"] ~ "[" * "0.00",
#> "1.00" * "]", italic("n")["obs"] == "131")
# }