Learn R Programming

spaMM (version 4.7.0)

Mixed-Effect Models, with or without Spatial Random Effects

Description

Inference based on models with or without spatially-correlated random effects, multivariate responses, or non-Gaussian random effects (e.g., Beta). Variation in residual variance (heteroscedasticity) can itself be represented by a mixed-effect model. Both classical geostatistical models (Rousset and Ferdy 2014 ), and Markov random field models on irregular grids (as considered in the 'INLA' package, ), can be fitted, with distinct computational procedures exploiting the sparse matrix representations for the latter case and other autoregressive models. Laplace approximations are used for likelihood or restricted likelihood. Penalized quasi-likelihood and other variants discussed in the h-likelihood literature (Lee and Nelder 2001 ) are also implemented.

Copy Link

Version

Install

install.packages('spaMM')

Monthly Downloads

3,814

Version

4.7.0

License

CeCILL-2

Maintainer

Franois Rousset

Last Published

September 9th, 2026

Functions in spaMM (4.7.0)

HLfit

Fit mixed models with given correlation matrix
DoF

Degrees of freedom extractor
Gryphon

Gryphon data
spaMM_glm.fit

Fitting generalized linear models without initial-value or divergence headaches
CauchyCorr

Cauchy correlation function and Cauchy formula term
HLCor

Fits a (spatially) correlated mixed model, for given correlation parameters
AIC

Extractors for information criteria such as AIC
ARp

Random effect with AR(p) (autoregressive of order p) or ARMA(p,q) structure.
multIMRF

Interpolated Markov Random Field models
COMPoisson

Conway-Maxwell-Poisson (COM-Poisson) GLM family
PLS-internals

Internal functions for procedure using the ((I,0),(Z,X)) block-order
pseudoR2

Pseudo R-squared
MaternIMRFa

corrFamily constructor for Interpolated Markov Random Field (IMRF) covariance structure approximating a 2D Matern correlation model.
WinterWheat

Example of yield stability analysis
dyad

Correlated random effects in dyadic interactions
MSFDR

Multiple-Stage False Discovery Rate procedure
Loaloa

Loa loa prevalence in North Cameroon, 1991-2001
Leuca

Leucadendron data
MaternCorr

Matern correlation function and Matern formula term.
LRT

Likelihood ratio tests of fixed and random effects.
algebra

Control of matrix-algebraic methods
aliases

Variable aliases for multivariate-response fits
ZAXlist

S4 classes for structured matrices
anova

ANOVA tables (and likelihood ratio tests).
adjlg

Simulated data set for testing sparse-precision code
betabin

Beta-binomial family object
arabidopsis

Arabidopsis genetic and climatic data
as_LMLT

Conversion to input for procedures from lmerTest package
beta_resp

Beta-distribution family object
autoregressive

Fitting autoregressive models
corMatern

Matern Correlation Structure as a corSpatial object
convergence

Assessing convergence for fitted models
corrFamily-definition

corrFamily definition
control.HLfit

Control parameters of the HLfit fitting algorithm
blackcap

Genetic polymorphism in relation to migration in the blackcap
corrFamily

Using corrFamily constructors and descriptors.
composite-ranef

Composite random effects
corrFamily-design

Designing new corrFamily descriptors for parametric correlation families
confint.HLfit

Confidence intervals
clinics

Toy dataset for binomial response
dopar

Interface for parallel computations
div_info

Information about numerical problems
corrHLfit

Fits a mixed model, typically a spatial GLMM.
diallel

Random-effect structures for symmetric or antisymmetric dyadic interactions
dofuture

Interface for parallel computations
covStruct

Specifying correlation structures
drop1.HLfit

Drop all possible single fixed-effect terms from a model
X.GCA

Fixed-effect terms for dyadic interactions
corrMatrix

Using the corrMatrix and distmatrix arguments
corr_family

corr_family objects
fitme

Fitting function for fixed- and mixed-effect models with GLM response.
extreme_eig

Utilities for regularization of a matrix
fix_predVar

Prediction from models with nearly-singular covariance matrices
eval_replicate

Evaluating bootstrap replicates
extractors

Functions to extract various components of a fit.
X2X

Fitting fixed-effects coefficients shared between submodels
fixed

Fixing some parameters
fixedLRT

Likelihood ratio test of fixed effects.
freight

Freight dataset
fitmv

Fitting multivariate responses
get_ranPars

Operations on lists of parameters
hatvalues.HLfit

Hat values and leverages extractor
how

Extract information about how an object was obtained
good-practice

Clear and trustworthy formulas and prior weights
get_RLRsim_args

Extractors of arguments for functions from package RLRsim
inits

Controlling optimization strategy through initial values
get_inits_from_fit

Initiate a fit from another fit
gof

Goodness of fit test
get_matrix

Extract matrices from a fit
get_cPredVar

Estimation of prediction variance with bootstrap correction
lev2bool

Conversion of factor to 0/1 variable
inverse.Gamma

Distribution families for Gamma and inverse Gamma-distributed random effects
mapMM

Colorful plots of predictions in two-dimensional space.
mat_sqrt

Computation of “square root” of symmetric positive definite matrix
method

Fitting methods (objective functions maximized)
inner-vs-outer

Inner iterations versus outer optimization
llm.fit

Link-linear regression models (LLMs)
is_separated

Checking for (quasi-)separation in binomial-response model.
make_scaled_dist

Scaled distances between unique locations, and Earth distances
multinomial

Analyzing multinomial data
negbin

Family function for negative binomial “2” response (including truncated variant).
mv

Virtual factor for multivariate responses
plot_effects

Partial-dependence effects and plots
pedigree

Fit mixed-effects models incorporating pedigrees
plot.HLfit

Model checking plots for mixed models
phi-resid.model

Residual dispersion model for gaussian and Gamma response
options

spaMM options settings
optimBounds

Optimization bounds
numInfo

Information matrix
negbin1

Alternative negative-binomial family
rankinfo

Checking the rank of the fixed-effects design matrix
predVar

Prediction and response variances
random-effects

Structure of random effects
post-fit

Applying post-fit procedures from other packages on spaMM results
remove_fixef

Remove specified fixed-effect terms from a model formula
resid.model

Structured dispersion models
register_cF

Declare corrFamily constructor for use in formula
Poisson

Family function for GLMs and mixed models with Poisson and zero-truncated Poisson response.
predict

Prediction from a model fit
pois4mlogit

Fit multinomial logit models
residuals.HLfit

Extract model residuals
setNbThreads

Parallel computations in fits
residVar

Residual variance extractor
seeds

Seed germination data
spaMM-conventions

spaMM conventions and differences from related fitting procedures
salamander

Salamander mating data
seaMask

Masks of seas or lands
spaMM-S3

S3 methods of generics defined in other packages
scotlip

Lip cancer in Scotland 1975 - 1980
simulate.HLfit

Simulate realizations of a fitted model.
stripHLfit

Reduce the size of fitted objects
spaMM_boot

Parametric bootstrap
spaMM.filled.contour

Level (Contour) Plots with better aspect ratio control (for geographical maps, at least)
update.HLfit

Updates a fit
transffit

Transformation of the data.
spaMM

Inference in mixed models, in particular spatial GLMMs
summary.HLfit

Summary and print methods for fit and test results.
spaMM.colors

A flashy color palette.
verbose

Details of the verbose argument of various functions
tweedie

Tweedie (compound Poisson Gamma) family
vcov

Extract covariance or correlation components from a fitted model object
wrap_parallel

Selecting interfaces for parallelisation
spaMM-internal

Internal spaMM Functions
welding

Welding data set
wafers

Data from a resistivity experiment for semiconductor materials.