spaMM reference page
a standard R package distributed
originally designed for
generalized linear mixed models (GLMMs),
particularly the so-called geostatistical model allowing prediction in
continuous space. But
it is now a more
general-purpose package for fitting mixed models, spatial or not.
A few distinctive features are highlighted
- It deals with several random effects with different distributions, one of which may be a Gaussian spatial effect;
- Genetic, phylogenetic, or other given correlations are easily taken into account using the corrMatrix argument of the HLCor function;
- It fits the Beta binomial model, negative binomial response family, and Conway-Maxwell-Poisson (COMPoisson) response family;
- It fits models with structured
residual dispersion, including residual dispersion models with random
effects, and thus implements a class of "double
- It includes a replacement function for glm, useful when the latter fails to fit a model;
- Its syntax is close to that of glm or [g]lmer. It includes a growing list of extractor methods derived from those in stats or nlme/lmer, and functions for inference beyond the fits, such as confint for confidence intervals of fixed-effect parameters, and predict including computation of prediction variances;
- It includes simple facilities for quickly drawing maps from model fits (as shown on the right). See here for more elaborate examples of producing maps;
- It includes facilities for handling multinomial data.
Version 1.10.0 was released on CRAN on September 5, 2016. See the NEWS for all recent changes. You can download here a gentle introduction (latest version September 6, 2016) to the package. The forthcoming version will be substantially faster for most analyses (particularly non-spatial ones).
This page could provide updates not yet on CRAN (see installation notes below if you download such an update) but this is not the case presently.
spaMM was designed first to fit spatial models with dense correlation matrices. Substantial computational speed-ups for "autoregressive" models were not first considered, out of a lack of specific interest for such models. However, an efficient implementation of the conditional autoregressive (CAR) model is available, as a step towards further developments.
developments for spaMM
include the implementation of simultaneous autoregressive
(SAR) models, and the use of stochastic algorithms for estimation of
likelihood in binary probit models.
Rousset F., Ferdy J.-B. (2014) Testing environmental and genetic effects in the presence of spatial autocorrelation. Ecography, 37: 781-790.
Also available here is the Supplementary Appendix G from that paper, including comparisons with a trick commonly used to constrain the functions lmer and glmmPQL to analyse spatial models.
Installing versions obtained from this page:Installation is exactly as for any other local tar.gz package archive, but details of this general procedure are often ignored.
Run install.packages with the highlighted options:
> install.packages(<archive name>,type="source",repos=NULL)
If this fails and you are a Windows user, then it is likely that you have not (fully) installed the Rtools. If you think you have installed the Rtools but this fails, then you probably have not set the PATH variable in the Windows environment variables (cf "Edit the path variable" here). To check that you have fully installed the Rtools, make a test by installing another package that requires compilation, e.g. lpSolveAPI, from its archive by using type="source".
Funding: spaMM development benefitted from a PEPS grant from CNRS and universities Montpellier 1 & 2 and is currently hosted within the IBC.
spaMM (C) François Rousset (CNRS & University Montpellier 2) & Jean-Baptiste Ferdy (University of Toulouse) 2013-present.
Additional contributor: Alexandre Courtiol (IZW Berlin).
This page (C) F. Rousset 2013-present