Learn R Programming

spaMM (version 4.6.1)

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

1,913

Version

4.6.1

License

CeCILL-2

Maintainer

Franois Rousset

Last Published

June 27th, 2025

Functions in spaMM (4.6.1)

DoF

Degrees of freedom extractor
AIC

Extractors for information criteria such as AIC
ARp

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

Gryphon data
HLCor

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

Fit mixed models with given correlation matrix
multIMRF

Interpolated Markov Random Field models
ZAXlist

S4 classes for structured matrices
WinterWheat

Example of yield stability analysis
pseudoR2

Pseudo R-squared
MaternIMRFa

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

Correlated random effects in dyadic interactions
Loaloa

Loa loa prevalence in North Cameroon, 1991-2001
PLS-internals

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

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

Matern correlation function and Matern formula term.
CauchyCorr

Cauchy correlation function and Cauchy formula term
aliases

Variable aliases for multivariate-response fits
beta_resp

Beta-distribution family object
as_LMLT

Conversion to input for procedures from lmerTest package
MSFDR

Multiple-Stage False Discovery Rate procedure
arabidopsis

Arabidopsis genetic and climatic data
Leuca

Leucadendron data
algebra

Control of matrix-algebraic methods
betabin

Beta-binomial family object
autoregressive

Fitting autoregressive models
COMPoisson

Conway-Maxwell-Poisson (COM-Poisson) GLM family
blackcap

Genetic polymorphism in relation to migration in the blackcap
adjlg

Simulated data set for testing sparse-precision code
LRT

ANOVA tables, and likelihood ratio tests of fixed and random effects.
corrFamily-definition

corrFamily definition
clinics

Toy dataset for binomial response
convergence

Assessing convergence for fitted models
corrFamily-design

Designing new corrFamily descriptors for parametric correlation families
corrHLfit

Fits a mixed model, typically a spatial GLMM.
composite-ranef

Composite random effects
corrFamily

Using corrFamily constructors and descriptors.
X.GCA

Fixed-effect terms for dyadic interactions
confint.HLfit

Confidence intervals
control.HLfit

Control parameters of the HLfit fitting algorithm
corr_family

corr_family objects
corrMatrix

Using a corrMatrix argument
corMatern

Matern Correlation Structure as a corSpatial object
div_info

Information about numerical problems
dofuture

Interface for parallel computations
drop1.HLfit

Drop all possible single fixed-effect terms from a model
eval_replicate

Evaluating bootstrap replicates
dopar

Interface for parallel computations
covStruct

Specifying correlation structures
diallel

Random-effect structures for symmetric or antisymmetric dyadic interactions
extractors

Functions to extract various components of a fit.
fix_predVar

Prediction from models with nearly-singular covariance matrices
fixed

Fixing some parameters
freight

Freight dataset
extreme_eig

Utilities for regularization of a matrix
get_inits_from_fit

Initiate a fit from another fit
get_ranPars

Operations on lists of parameters
fixedLRT

Likelihood ratio test of fixed effects.
good-practice

Clear and trustworthy formulas and prior weights
inverse.Gamma

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

Estimation of prediction variance with bootstrap correction
hatvalues.HLfit

Leverage extractor for HLfit objects
is_separated

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

Virtual factor for multivariate responses
inits

Controlling optimization strategy through initial values
get_matrix

Extract matrices from a fit
how

Extract information about how an object was obtained
gof

Goodness of fit test
fitme

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

Fitting multivariate responses
mat_sqrt

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

Fitting methods (objective functions maximized)
multinomial

Analyzing multinomial data
get_RLRsim_args

Extractors of arguments for functions from package RLRsim
negbin1

Alternative negative-binomial family
pois4mlogit

Fit multinomial logit models.
make_scaled_dist

Scaled distances between unique locations
numInfo

Information matrix
Poisson

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

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

Prediction and response variances
post-fit

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

Colorful plots of predictions in two-dimensional space.
options

spaMM options settings
plot.HLfit

Model checking plots for mixed models
plot_effects

Partial-dependence effects and plots
phi-resid.model

Residual dispersion model for gaussian and Gamma response
llm.fit

Link-linear regression models (LLMs)
pedigree

Fit mixed-effects models incorporating pedigrees
lev2bool

Conversion of factor to 0/1 variable
rankinfo

Checking the rank of the fixed-effects design matrix
register_cF

Declare corrFamily constructor for use in formula
residuals.HLfit

Extract model residuals
salamander

Salamander mating data
predict

Prediction from a model fit
random-effects

Structure of random effects
residVar

Residual variance extractor
resid.model

Structured dispersion models
seeds

Seed germination data
spaMM_boot

Parametric bootstrap
spaMM.colors

A flashy color palette.
setNbThreads

Parallel computations in fits
summary.HLfit

Summary and print methods for fit and test results.
spaMM-conventions

spaMM conventions and differences from related fitting procedures
stripHLfit

Reduce the size of fitted objects
spaMM.filled.contour

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

Tracking progress of fits
seaMask

Masks of seas or lands
spaMM-internal

Internal spaMM Functions
wafers

Data from a resistivity experiment for semiconductor materials.
scotlip

Lip cancer in Scotland 1975 - 1980
update.HLfit

Updates a fit
wrap_parallel

Selecting interfaces for parallelisation
spaMM

Inference in mixed models, in particular spatial GLMMs
welding

Welding data set
spaMM-S3

S3 methods of generics defined in other packages
simulate.HLfit

Simulate realizations of a fitted model.
vcov

Extract covariance or correlation components from a fitted model object