randtestapqe: Permutation test for the apportionment of quadratic entropy...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/randtestapqe.R

Description

Permutation test for the apportionment of quadratic entropy (wapqe).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
randtestapqe(
  df,
  dis = NULL,
  structures = NULL,
  formula = c("QE", "EDI"),
  wopt = c("even", "speciesab"),
  level = 1,
  nrep = 99,
  alter = c("greater", "less", "two-sided"),
  tol = 1e-08
)

Arguments

df

Dataframe or matrix with sites as rows and species as columns. Entries are abundances of species within sites.

dis

Dissimilarity among species (NULL or class 'dist').

structures

Data frame that contains the name of the group (row) of an level (column) to which the site belongs. Sites in structures should be in the same order as in df. Default is NULL.

formula

Quadratic entropy formula ("QE", "EDI"). "QE" is default.

wopt

Site weighting type ("even", "speciesab"). Default is "even".

level

Level to test. Provide a number between 1 and 1+the number of columns in structures. The number is discarded if the parameter 'structures' is set to NULL.

nrep

The number of permutations.

alter

Alternative hypothesis type ("greater" (default), "less" or "two-sided").

tol

A tolerance threshold (a value less than tol is considered equal to zero).

Details

Level: If structures is different from NULL then 1 means test for differences among sites, within the levels of the first factor given in parameter 'structures' (column 1), 2 means test for differences among levels of the first factor given in parameter ‘structures’ (column 1) but within levels of the second factor given in parameter 'structures' (column 2) (if available), etc.

Value

A list of class 'randtest', see randtest.

Author(s)

Sandrine Pavoine, Eric Marcon, Carlo Ricotta.

References

Pavoine, S., Marcon, E. and Ricotta, C. (2016), ‘Equivalent numbers’ for species, phylogenetic or functional diversity in a nested hierarchy of multiple scales. Methods Ecol Evol, 7: 1152–1163. DOI:10.1111/2041-210X.12591

See Also

wapqe, randtest.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
data(macroloire)
# Taxonomic dissimilarities among species:
dTaxo <- dist.taxo(macroloire$taxo)^2/2
dTaxo <- dTaxo/max(dTaxo)
# Size-based dissimilarities among species
dSize <- dist.prop(macroloire$traits[ ,1:4], method = 2)
# Dissimilarities among species in terms of feeding categories
dFeed <- dist.prop(macroloire$traits[ ,5:11], method = 2)
# Dissimilarities among species in terms of both size and feeding categories
dSF <- (dSize+dFeed)/2

# Table with sites as rows (stations), species as columns and abundances as entries
ab <- as.data.frame(t(macroloire$fau))
# Table with sites as rows and one column only. Entries indicate the geological region associated with each site
stru <- macroloire$envir["Morphoregion"]

# Tests for dissimilarities among sites within regions:

aGS1 <- randtestapqe(ab, , stru, formula = "QE", level=1, nrep=999)
aGS1
plot(aGS1)
aTaxo1 <- randtestapqe(ab, dTaxo, stru, formula = "QE", level=1, nrep=999)
aTaxo1
plot(aTaxo1)
aSize1 <- randtestapqe(ab, dSize, stru, formula = "QE", level=1, nrep=999)
aSize1
plot(aSize1)
aFeed1 <- randtestapqe(ab, dFeed, stru, formula = "QE", level=1, nrep=999)
aFeed1
plot(aFeed1)
aSF1 <- randtestapqe(ab, dSF, stru, formula = "QE", level=1, nrep=999)
aSF1
plot(aSF1)

# Tests for dissimilarities among regions:

aGS2 <- randtestapqe(ab, , stru, formula = "QE", level=2, nrep=999)
aGS2
plot(aGS2)
aTaxo2 <- randtestapqe(ab, dTaxo, stru, formula = "QE", level=2, nrep=999)
aTaxo2
plot(aTaxo2)
aSize2 <- randtestapqe(ab, dSize, stru, formula = "QE", level=2, nrep=999)
aSize2
plot(aSize2)
aFeed2 <- randtestapqe(ab, dFeed, stru, formula = "QE", level=2, nrep=999)
aFeed2
plot(aFeed2)
aSF2 <- randtestapqe(ab, dSF, stru, formula = "QE", level=2, nrep=999)
aSF2
plot(aSF2)

vmikk/phylonest documentation built on Nov. 20, 2019, 4:17 p.m.