Learn R Programming

⚠️There's a newer version (4.4.1) of this package.Take me there.

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.3.7

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Giovanny Covarrubias-Pazaran

Last Published

February 3rd, 2025

Functions in sommer (4.3.7)

DT_h2

Broad sense heritability calculation.
DT_fulldiallel

Full diallel data for corn hybrids
DT_expdesigns

Data for different experimental designs
DT_btdata

Blue Tit Data for a Quantitative Genetic Experiment
DT_example

Broad sense heritability calculation.
DT_gryphon

Gryphon data from the Journal of Animal Ecology
DT_halfdiallel

half diallel data for corn hybrids
DT_legendre

Simulated data for random regression
DT_ige

Data to fit indirect genetic effects.
GWAS

Genome wide association study analysis
H

Two-way id by features table
DT_technow

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

wheat lines dataset
EM

Expectation Maximization Algorithm
DT_mohring

Full diallel data for corn hybrids
DT_yatesoats

Yield of oats in a split-block experiment
DT_polyploid

Genotypic and Phenotypic data for a potato polyploid population
E.mat

Epistatic relationship matrix
DT_rice

Rice lines dataset
MEMMA

Multivariate Efficient Mixed Model Association Algorithm
adiag1

Binds arrays corner-to-corner
add.diallel.vars

add.diallel.vars
bathy.colors

Generate a sequence of colors for plotting bathymetric data.
covc

covariance between random effects
corImputation

Imputing a matrix using correlations
LD.decay

Calculation of linkage disequilibrium decay
H.mat

Combined relationship matrix H
bbasis

Function for creating B-spline basis functions (Eilers & Marx, 2010)
atc

atc covariance structure
anova.mmer

anova form a GLMM fitted with mmer
imputev

Imputing a numeric or character vector
anova.mmec

anova form a GLMM fitted with mmec
atcg1234

Letter to number converter
csc

customized covariance structure
dsc

diagonal covariance structure
fitted.mmec

fitted form a LMM fitted with mmec
dfToMatrix

data frame to matrix
isc

identity covariance structure
neMarker

Effective population size based on marker matrix
fitted.mmer

fitted form a LMM fitted with mmer
overlay

Overlay Matrix
DT_sleepstudy

Reaction times in a sleep deprivation study
atcg1234BackTransform

Letter to number converter
atr

atr covariance structure
build.HMM

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

list or vector to unstructured matrix
bivariateRun

bivariateRun functionality
leg

Legendre polynomial matrix
jet.colors

Generate a sequence of colors alog the jet colormap.
logspace

Decreasing logarithmic trend
pmonitor

plot the change of VC across iterations
plot.mmec

plot form a LMM plot with mmec
mmer

mixed model equations for r records
r2

Reliability
mmec

mixed model equations for c coefficients
csr

customized covariance structure
coef.mmec

coef form a GLMM fitted with mmec
spl2Dmats

Get Tensor Product Spline Mixed Model Incidence Matrices
spl2Dc

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

fixed indication matrix
dsr

diagonal covariance structure
coef.mmer

coef form a GLMM fitted with mmer
predict.mmec

Predict form of a LMM fitted with mmec
plot.mmer

plot form a LMM plot with mmer
simGECorMat

Create a GE correlation matrix for simulation purposes.
gvsr

general variance structure specification
spl2Da

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

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

Creating color with transparency
unsm

unstructured indication matrix
fcm

fixed effect constraint indication matrix
predict.mmer

Predict form of a LMM fitted with mmer
manhattan

Creating a manhattan plot
map.plot

Creating a genetic map plot
spl2Db

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

Proportion of missing data
transformConstraints

transformConstraints
tpsmmbwrapper

Get Tensor Product Spline Mixed Model Incidence Matrices
residuals.mmec

Residuals form a GLMM fitted with mmec
redmm

Reduced Model Matrix
usr

unstructured covariance structure
residuals.mmer

Residuals form a GLMM fitted with mmer
usc

unstructured covariance structure
rrc

reduced rank covariance structure
randef

extracting random effects
vpredict

vpredict form of a LMM fitted with mmer
vsc

variance structure specification
vs

variance structure specification
stackTrait

Stacking traits in a dataset
summary.mmer

summary form a GLMM fitted with mmer
vsr

variance structure specification
summary.mmec

summary form a GLMM fitted with mmec
tps

Get Tensor Product Spline Mixed Model Incidence Matrices
wald.test

Wald Test for Model Coefficients
DT_cornhybrids

Corn crosses and markers
DT_cpdata

Genotypic and Phenotypic data for a CP population
CS

Compound symmetry matrix
AR1

Autocorrelation matrix of order 1.
D.mat

Dominance relationship matrix
ARMA

Autocorrelation Moving average.
DT_augment

DT_augment design example.
A.mat

Additive relationship matrix
AI

Average Information Algorithm