Learn R Programming

prabclus (version 2.2-2)

prab.sarestimate: Estimates SAR model from log-abundance matrix of prab-object.

Description

This is either an interface for the function errorsarlm for abundance data stored in an object of class prab implemented for use in abundtest, or, in case that spatial information should be ignored, it estimates a two-way additive unreplicated linear model for log-abundances on factors species and region.

Usage

prab.sarestimate(abmat, prab01=NULL,sarmethod="eigen",
                             weightstyle="C",
                             quiet=TRUE, sar=TRUE,
                             add.lmobject=TRUE)

Arguments

abmat
object of class prab.
prab01
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 (see details). If NULL (which i
sarmethod
this is passed on as parameter method to errorsarlm and documented there. We don't have experience with any other choice than "eigen".
weightstyle
can take values "W", "B", "C", "U", and "S" though tests suggest that "C" should be chosen. See nb2listw.
quiet
this is passed on as parameter quiet to errorsarlm and documented there.
sar
logical. If TRUE, a simultaneous autoregression model is fitted by calling errorsarlm. If FALSE, a two-way additive unreplicated linear model for log-abunda
add.lmobject
logical. If TRUE, the whole output object of errorsarlm (or lm) is given out.

Value

  • A list with the following components:
  • sarsee above.
  • interceptnumeric. Estimator of the intercept.
  • sigmanumeric. Estimator of error standard deviation.
  • regeffectsnumeric vector. Estimator for region effects.
  • speceffectsnumeric vector. Estimator for species effects.
  • lamdanumeric. Governs the degree of spatial autocorrelation. See errorsarlm.
  • sizeinteger. Length of neighborhood list generated by nb2listw used by errorsarlm.
  • nbweightnumeric. Average weight of neighbors.
  • lmobjectif add.lmobject=TRUE, output object of either lm or errorsarlm.

See Also

errorsarlm, abundtest

Examples

Run this code
data(siskiyou)
  x <- prabinit(prabmatrix=siskiyou, neighborhood=siskiyou.nb,
             distance="none")
#  Not run; this needs package spdep 
#  prab.sarestimate(x)
  prab.sarestimate(x, sar=FALSE)

Run the code above in your browser using DataLab