spaMM reference page

spaMM is a standard R package distributed on  CRAN, originally designed for fitting spatial generalized linear mixed models (GLMMs). 

Figures generated by code shown in example(seaMask) and example(mapMM)

Version 1.3 is a more general-purpose package for fitting mixed models, spatial or not:

  • It deals with several random effects with different distributions (one of which may be a Gaussian spatial effect). For example, a mixed-model with a random effect R affecting a negative binomial response can be fitted as a model with Poisson response, a gamma-distributed random effect, and the random effect R;
  • Genetic, phylogenetic, or other given correlations are easily taken into account using the corrMatrix argument of the HLCor function;
  • It fits nested effects; it fits random-slope models including the covariation between intercept and slope effects if these are Gaussian; 
  • It includes the Beta binomial, negative binomial, or GLMs with structured dispersion as special cases;  
  • It includes facilities for drawing maps (as shown on the right);
  • It includes facilities for handling multinomial data.

The syntax is close to that of glm or [g]lmer with some differences for nested effects and a convenient syntax for spatial effects. You can download a gentle introduction to the package. 

SpaMM remains in active development both in terms of better interface and of alternative algorithms (e.g., stochastic algorithms for estimation of likelihood) or models. The latest additions include a confint function for confidence intervals of fixed-effect parameters as well as some more minor improvements such as extractor methods derived from those in stats or nlme. Some glitches were found while recompiling the introduction to the package, so a patch is available here.  

The currently implemented fitting methods are based on several variants of Laplace aproximations discussed in particular by Lee, Nelder, and collaborators (e.g. Lee, Nelder & Pawitan, 2006; Lee & Lee 2012; see also Molas and Lesaffre, 2010). The performance of these methods for spatial GLMMs was assessed in :
Rousset F., Ferdy J.-B. (2014) Testing environmental and genetic effects in the presence of spatial autocorrelation. Ecography, 37: 781-790.

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.

This page (C) F. Rousset 2013-present

Main web page