Learn R Programming

sommer: Solving Mixed Model Equations in R

Structural multivariate-univariate linear mixed model solver for estimation of multiple random effects with unknown variance-covariance structures (e.g., heterogeneous and unstructured) and known covariance among levels of random effects (e.g., pedigree and genomic relationship matrices) (Covarrubias-Pazaran, 2016; Maier et al., 2015; Jensen et al., 1997). REML estimates can be obtained using the Direct-Inversion Newton-Raphson and Direct-Inversion Average Information algorithms for the problems r x r (r being the number of records) or using the Henderson-based average information algorithm for the problem c x c (c being the number of coefficients to estimate). Spatial models can also be fitted using the two-dimensional spline functionality available.

Installation

You can install the development version of sommer from GitHub:

devtools::install_github('covaruber/sommer')

Vignettes

Development

The sommer package is under active development. If you are an expert in mixed models, statistics or programming and you know how to implement of the following:

  • the minimum degree ordering algorithm
  • the symbolic cholesky factorization
  • factor analytic structure
  • generalized linear models

please help us to take sommer to the next level. Drop me an email or push some changes through github :)

Copy Link

Version

Install

install.packages('sommer')

Monthly Downloads

4,275

Version

4.4.1

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Giovanny Covarrubias-Pazaran

Last Published

April 4th, 2025

Functions in sommer (4.4.1)

DT_augment

DT_augment design example.
DT_fulldiallel

Full diallel data for corn hybrids
DT_halfdiallel

half diallel data for corn hybrids
DT_h2

Broad sense heritability calculation.
DT_gryphon

Gryphon data from the Journal of Animal Ecology
DT_example

Broad sense heritability calculation.
DT_expdesigns

Data for different experimental designs
DT_btdata

Blue Tit Data for a Quantitative Genetic Experiment
DT_technow

Genotypic and Phenotypic data from single cross hybrids (Technow et al.,2014)
DT_yatesoats

Yield of oats in a split-block experiment
DT_cornhybrids

Corn crosses and markers
DT_cpdata

Genotypic and Phenotypic data for a CP population
DT_ige

Data to fit indirect genetic effects.
DT_rice

Rice lines dataset
DT_wheat

wheat lines dataset
add.diallel.vars

add.diallel.vars
E.mat

Epistatic relationship matrix
H.mat

Combined relationship matrix H
DT_mohring

Full diallel data for corn hybrids
bbasis

Function for creating B-spline basis functions (Eilers & Marx, 2010)
bathy.colors

Generate a sequence of colors for plotting bathymetric data.
DT_polyploid

Genotypic and Phenotypic data for a potato polyploid population
adiag1

Binds arrays corner-to-corner
corImputation

Imputing a matrix using correlations
imputev

Imputing a numeric or character vector
fixm

fixed indication matrix
DT_sleepstudy

Reaction times in a sleep deprivation study
anova.mmes

anova form a GLMM fitted with mmes
DT_legendre

Simulated data for random regression
atcg1234BackTransform

Letter to number converter
atm

atm covariance structure
build.HMM

Build a hybrid marker matrix using parental genotypes from inbred individuals
atcg1234

Letter to number converter
coef.mmes

coef form a GLMM fitted with mmes
manhattan

Creating a manhattan plot
leg

Legendre polynomial matrix
LD.decay

Calculation of linkage disequilibrium decay
map.plot

Creating a genetic map plot
dsm

diagonal covariance structure
fitted.mmes

fitted form a LMM fitted with mmes
csm

customized covariance structure
overlay

Overlay Matrix
pmonitor

plot the change of VC across iterations
residuals.mmes

Residuals form a GLMM fitted with mmes
rrm

reduced rank covariance structure
simGECorMat

Create a GE correlation matrix for simulation purposes.
neMarker

Effective population size based on marker matrix
sommer-package

Solving Mixed Model Equations in R
Figure: mai.png
mmes

mixed model equations solver
dfToMatrix

data frame to matrix
randef

extracting random effects
ism

identity covariance structure
covm

covariance between random effects
jet.colors

Generate a sequence of colors alog the jet colormap.
plot.mmes

plot form a LMM plot with mmes
logspace

Decreasing logarithmic trend
propMissing

Proportion of missing data
redmm

Reduced Model Matrix
predict.mmes

Predict form of a LMM fitted with mmes
r2

Reliability
spl2Dc

Two-dimensional penalised tensor-product of marginal B-Spline basis.
transp

Creating color with transparency
unsm

unstructured indication matrix
stackTrait

Stacking traits in a dataset
summary.mmes

summary form a GLMM fitted with mmes
spl2Dmats

Get Tensor Product Spline Mixed Model Incidence Matrices
usm

unstructured covariance structure
vpredict

vpredict form of a LMM fitted with mmes
tps

Get Tensor Product Spline Mixed Model Incidence Matrices
wald.test

Wald Test for Model Coefficients
vsm

variance structure specification
tpsmmbwrapper

Get Tensor Product Spline Mixed Model Incidence Matrices
summary.mmer

summary form a GLMM fitted with mmer
A.mat

Additive relationship matrix
vsr

variance structure specification
GWAS

Genome wide association study analysis
D.mat

Dominance relationship matrix
ARMA

Autocorrelation Moving average.
mmer

mixed model equations for r records
CS

Compound symmetry matrix
AR1

Autocorrelation matrix of order 1.
vs

variance structure specification