Learn R Programming

prabclus (version 1.0-2)

pop.sim: p-value simulation for presence-absence matrices clustering test

Description

Parametric bootstrap simulation of the p-value of a test of a homogeneity hypothesis against clustering (or significant nestedness). Designed for use within prabtest. The null model is defined by randpop.nb.

Usage

pop.sim(regmat, neighbors, h0c = 1, times = 200, dist = "kulczynski",
teststat = "isovertice", testc = NA, n.species = ncol(regmat),
specperreg = NA, regperspec = NA, species.fixed=FALSE, pdfnb=pdfnb)

Arguments

regmat
0-1-matrix. Columns are species, rows are regions.
neighbors
A list with a component for every region. The components are vectors of integers indicating neighboring regions. A region without neighbors (e.g., an island) should be assigned a list numeric(0).
h0c
numerical. Parameter p.nb for use in randpop.nb.
times
integer. Number of simulation runs.
dist
"kulczynski" or "jaccard", see kulczynski and jaccard.
teststat
"isovertice", "lcomponent", "distratio", "nn" or "inclusions". See the corresponding functions, homogen.test for "isovertice", incmatrix for "inclusions").
testc
numerical. Tuning constant for the test statistics.
n.species
integer. Number of species.
specperreg
vector of integers. Numbers of species per region (is calculated from the data by default).
regperspec
vector of integers. Number of regions per species (is calculated from the data by default).
species.fixed
logical. If TRUE, the sizes of the species are taken directly from regmat. Otherwise, they are drawn by random from the empirical distribution of the values from regmat.
pdfnb
logical. Probability correction in randpop.nb.

Value

  • List with components
  • resultsvector of teststatistic values for the simulated matrices.
  • p.abovep-value if large test statistic leads to rejection.
  • p.belowp-value if small test statistic leads to rejection.
  • datactest statistic value for the original data.
  • testcsee above.

References

Hennig, C. and Hausdorf, B. (2002) Distance-based parametric bootstrap tests for clustering of species ranges, submitted, http://stat.ethz.ch/Research-Reports/110.html.

Hausdorf, B. and Hennig, C. (2003) Biotic Element Analysis in Biogeography. To appear in Systematic Biology.

Hausdorf, B. and Hennig, C. (2003) Nestedness of nerth-west European land snail ranges as a consequence of differential immigration from Pleistocene glacial refuges. Oecologia 135, 102-109.

See Also

prabtest, randpop.nb, jaccard, kulczynski, homogen.test, lcomponent, distratio, nn, incmatrix.

Examples

Run this code
data(kykladspecreg)
# Note: If you do not use the installed package, replace this by
# kykladspecreg <- read.table("(path/)kykladspecreg.dat")
data(nb)
# Note: If you do not use the installed package, replace this by
# nb <- list()
# for (i in 1:34)
#   nb <- c(nb,list(scan(file="(path/)nb.dat",
#                   skip=i-1,nlines=1)))
set.seed(1234)
pop.sim(t(kykladspecreg), nb, times=20, h0c=0.35, teststat="nn", testc=3)

Run the code above in your browser using DataLab