cusTH: Threshold estimation with the cumulative sum principle

Description Usage Arguments Details Author(s) Examples

View source: R/cusTH_function.R

Description

The cumulative sum threshold estimation cumulatively sums each taxon along a gradient within a sample assembly. This is also performed for the total sample effort. Both curves are then compared. The function only estimates thresholds for presence/absence and abundance.

Usage

1
cusTH(samp, tax, var, abu, conf.level = 0.95, nboot = 500)

Arguments

samp

A vector containing codes for each sample.

tax

A vector containing names or codes for the different taxa/groups.

var

A numeric vector containing the variables of an environmental gradient.

abu

A numeric vector containing the variables representing abundance. If one does not want to include abundance and only asses occurrence the one can simply use the same vector as for the "var" vector.

conf.level

A numeric argument that can set the percentile of the confidence interval. Default is 0.95.

nboot

The number of bootstraps applied. Default is 500.

Details

The vector var should be numeric. This function uses and relies on the wilcox.test function for acquiring the W statistic to calculate the area under the curve (AUC), see AUC.test. The results are returned as a list of two objects. The first object contains the threshold and response for each taxon. The second object is the positive an negative threshold for the grouped taxa or sample assembly.

Returns a dataframe with the Threshold with corresponding lower (LCI(t)) and higher (HCI(t)) confidence intervals according to the chosen confidence level. The dataframe also contaisn the minimum (min) and maximum (max) levels of where a taxon occurred. This is also determined according to chosen confidence level. To asses the response of a taxon the Response is returned. The response score is the maximum distance between the scaled cumulative curve of the taxon in relation to the scaled cumulative curve sample distribution. The value ranges between -1 and 1. A value of -1 indicates the strongest negative response possible. A value of 1 indicates the strongest positive response possible. A value close to 0 indicates that the scaled cumulative curve of the taxon is similar to that of the sample effort. Further, also the mean AUC of the scaled cumulative curve of the sample distribution versus that of the taxon. A value close to 0.5 indicates that a random sample from the scaled cumulative sum of the sample distribution has a probability of 50 percent to rank higher than that of the taxon (limited effect). A value of 1.0 indicates that there is a probability of 100 percent a random sample ranks higher. A value of 0.0 indicates that there is a probability of 0 percent a random sample ranks higher. The AUC is accompanied with lower (LCI(a)) and higher (HCI(a)) confidence intervals according to the chosen confidence level.

Author(s)

Willem Kaijser

Examples

1
2
3
4
5
6
7
## Not run: 
#Using the provided data-set named "hco3"
results <- cusTH(hco3$Sample, hco3$Taxon, hco3$Variable, hco3$Abundance)

#Display the results
View(results)
## End(Not run)

snwikaij/GRASS documentation built on July 29, 2020, 1:54 p.m.