abundtest {prabclus} | R Documentation |
Parametric bootstrap test for clustering in abundance matrices
Description
Parametric bootstrap test of a null model of i.i.d., but spatially
autocorrelated species against clustering of the species' population
patterns. Note that most relevant functionality of prabtest
(except of the use of the geco distance) is
also included in abundtest
, so that abundtest
can also
be used on binary presence-absence data.
In spite of the lots of
parameters, a standard execution (for the default test statistics, see
parameter teststat
below) will be
prabmatrix <- prabinit(file="path/abundmatrixfile",
neighborhood="path/neighborhoodfile")
test <- abundtest(prabmatrix)
summary(test)
Note: Data formats are described
on the prabinit
help page. You may also consider the example datasets
kykladspecreg.dat
and nb.dat
. Take care of the
parameter rows.are.species
of prabinit
.
Usage
abundtest(prabobj, teststat = "distratio", tuning = 0.25,
times = 1000, p.nb = NULL,
prange = c(0, 1), nperp = 4, step = 0.1, step2 = 0.01,
twostep = TRUE, species.fixed=TRUE, prab01=NULL,
groupvector=NULL,
sarestimate=prab.sarestimate(prabobj),
dist = prabobj$distance,
n.species = prabobj$n.species)
Arguments
prabobj |
an object of class |
teststat |
string, indicating the test statistics. |
tuning |
integer or (if |
times |
integer. Number of simulation runs. |
p.nb |
numerical between 0 and 1. The probability that a new
region is drawn from the non-neighborhood of the previous regions
belonging to a species under generation. If |
prange |
numerical range vector, lower value not smaller than 0, larger
value not larger than 1. Range where |
nperp |
integer. Number of simulations per |
step |
numerical between 0 and 1. Interval length between
subsequent choices of |
step2 |
numerical between 0 and 1. Interval length between
subsequent choices of |
twostep |
logical. If |
species.fixed |
logical. Indicates if the range sizes of the species
are held fixed
in the test simulation ( |
prab01 |
|
groupvector |
integer vector. For every species, a number
indicating the species' group membership. Needed only if
|
sarestimate |
Estimator of the parameters of a simultaneous
autoregression model corresponding to the null model for abundance
data from Hausdorf and Hennig (2007) as generated by
|
dist |
One of |
n.species |
number of species. By default this is taken from
|
Details
For presence-absence data, the routine is described in
prabtest
. For abundance data, the first step under the
null model is to
simulated presence-absence patterns as in prabtest
. The second
step is to fit a simultaneous autoregression (SAR) model (Ripley 1981,
section 5.2) to the log-abundances, see
prab.sarestimate
. The simulation from the null model is
implemented in regpop.sar
.
For more details see Hennig
and Hausdorf (2004) for presence-absence data and Hausdorf and Hennig
(2007) for abundance data and the test statistics "mean"
and
"groups"
, which can also be applied to binary data.
If p.nb=NA
was
specified, a diagnostic plot
for the estimation of pd
is plotted by autoconst
.
For details see Hennig
and Hausdorf (2004) and the help pages of the cited functions.
Value
An object of class prabtest
, which is a list with components
results |
vector of test statistic values for all simulated
populations. For |
p.above |
p-value against an alternative that generates large
values of the test statistic (usually reasonable for
|
p.below |
p-value against an alternative that generates small
values of the test statistic (usually reasonable for
|
datac |
test statistic value for the original
data. ( |
tuning |
see above. |
distance |
|
teststat |
see above. |
pd |
|
abund |
|
sarlambda |
Estimator of the autocorrelation
parameter |
sarestimate |
the output object of |
groupinfo |
list containing information from
|
Author(s)
Christian Hennig christian.hennig@unibo.it https://www.unibo.it/sitoweb/christian.hennig/en
References
Hausdorf, B. and Hennig, C. (2007) Null model tests of clustering of species, negative co-occurrence patterns and nestedness in meta-communities. Oikos 116, 818-828.
Hennig, C. and Hausdorf, B. (2004) Distance-based parametric bootstrap tests for clustering of species ranges. Computational Statistics and Data Analysis 45, 875-896. http://stat.ethz.ch/Research-Reports/110.html.
Ripley, B. D. (1981) Spatial Statistics. Wiley.
See Also
prabinit
generates objects of class prab
.
autoconst
estimates pd
from such objects.
prabtest
(analogous function for presence-absence data).
regpop.sar
generates populations from the null model.
prab.sarestimate
(parameter estimators for simultaneous
autoregression model). This calls
errorsarlm
(original estimation function from
package spdep
).
Some more information on the test statistics is given in
homogen.test
, lcomponent
,
distratio
, nn
,
incmatrix
.
Summary and print methods: summary.prabtest
.
Examples
# Note: NOT RUN.
# This needs package spdep and a bunch of packages that are
# called by spdep!
# data(siskiyou)
# set.seed(1234)
# x <- prabinit(prabmatrix=siskiyou, neighborhood=siskiyou.nb,
# distance="logkulczynski")
# a1 <- abundtest(x, times=5, p.nb=0.0465)
# a2 <- abundtest(x, times=5, p.nb=0.0465, teststat="groups",
# groupvector=siskiyou.groups)
# These settings are chosen to make the example execution
# faster; usually you will use abundtest(x).
# summary(a1)
# summary(a2)