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.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)prab (presence-absence data), as
generated by prabinit."isovertice":
number of isolated vertices in the graph of tuning
smallest distances
between species. "lcomponent": size of largest connectivity
component in thiteststat="distratio") numerical
between 0 and 1. Tuning constant for test statistics, see
teststat.NULL (the
default), and prabobj$spatial,
ppd is to be found. Used
by function autoconst.pd-value. Used
by function autoconst.pd for the first simulation. Used
by function autoconst.pd for the second simulation (see
parameter twostep). Used
by function autoconst.TRUE, a first estimation step for
pd is
carried out in the whole prange, and then the final
estimation is determined between the preliminary estimator
-5*step2 and +5*stTRUE) or generated from their empirical
distribution in x (FALSE) for presence-absence data.
See function prabinit-object based on
presence-absence matrix of same dimensions than the
abundance matrix of prabobj. This specifies the presences and
absences on which the presence/absence step of abundance-based tests
is based (seeteststat="groups".prab.sarestimate. This requires package spdep.
Note tha"jaccard", "kulczynski",
"qkulczynski" or "logkulczynski" specifying the distance
measure on which the test is based. By default, this is taken from
prabobj.prabobj. This should normally not be changed.prabtest, which is a list with componentsteststat="groups" a list with components
overall (means of within group-distances), mean (means
of all distances), gr (matrix with a row for every group,
giving the groupwise within-group distance means).teststat="inclusions", "groups", "mean")."lcomponent", "nn", "distratio"; for
"isovertice", the two-sided p may make sense which is twice
the smaller one of p.above and p.below).specgroups-output for teststat="groups").dist above.p.nb above.TRUE if simultaneous autoregression has been used
(i.e., a sarestimate has been supplied or computed).lambda (see errorsarlm)
defined so that the average weight of neighbors (see
nb2listw) is standardized to 1.prab.sarestimate."groups" tests, with components lg (levels of
groupvector), ng (number of groups), nsg
(vector of group sizes), testm (value of "means" test
statistic for input prabobj), pa (group-wise
p.above), pb (group-wise
p.below), pma (p.above of "means" test),
pmb (p.below of "means" test).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.
Hennig, C. and Hausdorf, B. (2004) Distance-based parametric bootstrap
tests for clustering of species ranges. Computational Statistics
and
Data Analysis 45, 875-896.
Ripley, B. D. (1981) Spatial Statistics. Wiley.
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.
# 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)Run the code above in your browser using DataLab