multSE: Estimate multivariate standard error.

View source: R/multSE.R

multSER Documentation

Estimate multivariate standard error.

Description

This function estimates a multivariate standard error as the residual mean square error from a PERMANOVA for a one-way model, including double resampling.

Usage

multSE(D, group, nsamp = NULL, nresamp = 10000, progress = "text")

Arguments

D

A distance matrix among all samples

group

The grouping vector

nsamp

Number of samples to take from each group (default, NULL - the smallest sample size across all groups will be automatically taken)

nresamp

The number of re-samples (default, 10 000)

progress

Display progess bar ("text" or "none")

Details

The routine calculates the means using the permutation approach, while the lower and upper quantiles are obtained using the bootstrapping approach including an adjustment for the bias in the bootstrap. The main distinction from the original function (provied in the supplementary data in Anderson & Santana-Garcon, 2013) is that estimation is done not for increasing range of sample sizes, but only for one sample size common for all groups.

Value

Data frame with the multivariate standard error averaged over resampling interations.

References

Anderson M.J., Santana-Garcon J. Measures of precision for dissimilarity-based multivariate analysis of ecological communities. Ecology Letters (2015) 18: 66-73. DOI 10.1111/ele.12385

Examples

library(vegan)

## Download sample data (from jslefche/multSE)
tf <- tempfile()
download.file("https://raw.githubusercontent.com/jslefche/multSE/master/data/PoorKnights.csv", tf)
pk <- read.csv(tf); rm(tf)

D <- vegdist(pk[,3:49] + 1)  # Create species-by-site distance matrix
group <- factor(pk$Time)     # groupping factor

multSE(D, group, nresamp = 100)             # automatically find the smallest sample size across all groups
multSE(D, group, nresamp = 100, nsamp = 10) # take 10 samples from each group


vmikk/metagMisc documentation built on June 20, 2024, 7:20 a.m.