pmgram {ecodist}R Documentation

Partial Mantel correlogram

Description

This function calculates simple and partial multivariate correlograms.

Usage

pmgram(data, space, partial, nclass, stepsize, resids = FALSE, nperm = 1000)

Arguments

data lower-triangular dissimilarity matrix.
space lower-triangular matrix of geographic distances.
partial optional, lower-triangular dissimilarity matrix of ancillary data.
nclass number of distance classes. If not specified, Sturge's rule will be used to determine an appropriate number of classes.
stepsize width of each distance class. If not specified, nclass and the range of space.d will be used to calculate an appropriate default.
resids if resids=TRUE, will return the residuals for each distance class.
nperm number of permutations to use. If set to 0, the permutation test will be omitted.

Details

This function does four different analyses: If data has 1 column and partial is missing, calculates a multivariate correlogram for data.

If data has 2 columns and partial is missing, calculates Mantel r between the two columns for each distance class.

If data has 1 column and partial exists, does a multivariate correlogram for the residuals, taking residuals over whole extent.

If data has 2 columns and partial exists, does a partial multivariate correlogram, calculating partial for each distance class separately.

Value

Returns a matrix with one row for each distance class and 4 columns:

dmax upper limit of the distance class.
ngroup number of distances in that class.
mantelr Mantel r value.
pval two-sided p-value.

Author(s)

Sarah Goslee, Sarah.Goslee@ars.usda.gov

See Also

mgram, mantel

Examples


## Not run: 
# take partial correlogram of z2 on the residuals of z1 ~ space.d
z.pmgram <- pmgram(z1.d, space.d, z2.d, nperm=10)
plotmgram(z.pmgram, pval=0.1)
## End(Not run)

# A full example is available in the partial Mantel 
# correlogram section of the main help file for ecodist.


[Package ecodist version 1.01 Index]