Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

envrtest

Environmental Distribution Test


Description

Calculates whether the value of a specified environmental variable has an improbable distribution with respect to a specified vector

Usage

envrtest(set,env,numitr=1000,minval=0,replace=FALSE,
     plotit = TRUE, main = paste(deparse(substitute(set)),
     " on ", deparse(substitute(env))))

Arguments

set

a vector of logical or quantitative values

env

the quantitative variable whose distribution is to be tested

numitr

the number of randomizations to iterate to calculate probabilities

minval

the threshold to use to partition the data into a logical if set is quantitative

replace

whether to permute (replace=FALSE) or bootstrap (replace=TRUE) the values in the permutation test

plotit

logical; plot results if TRUE

main

title for plot if plotted

Details

Calculates the maximum within-set difference in the values of vector ‘env’, and the distribution of the permuted random within-set differences. It then plots the observed difference as a red line, and the sorted permuted differences as a black line and prints the probability of getting such a limited distribution. The probability is calculated by permuting numitr-1 times, counting the number of times the permuted maximum difference is as small or smaller than observed (n), and calculating (n+1)/numitr. To get three-digit probabilities, set numitr=1000 (the default)

Value

Produces a plot on the current graphics device, and an invisible list with the components observed within-set difference and the p-value.

Note

The plot is based on the concept of constraint, or limiting value, and checks to see whether the distribution of a particular variable within a cluster is constrained in an improbable way.

Author(s)

Examples

data(bryceveg) # returns a vegetation data.frame
data(brycesite) # returns and environmental data.frame
envrtest(bryceveg$berrep>0,brycesite$elev)

labdsv

Ordination and Multivariate Analysis for Ecology

v2.0-1
GPL (>= 2)
Authors
David W. Roberts <droberts@montana.edu>
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.