When Biological Data Calls for Mixed Models

When biological data calls for mixed models - set across an image of various crops and fields

How mixed models help researchers account for hierarchy, imbalance, correlation and other important structures in biological data.

A well-designed experiment can still produce data with layers of complexity. Genotypes may be tested across multiple locations and years, and designs may be incomplete or have unequal replication. Measurements may be repeated through time, several traits may be recorded on the same individuals, and environmental variation may lead to correlation among observations.

None of this makes it a bad experiment. It reflects the reality of working with biological systems.

The statistical challenge is deciding how much of that structure needs to be represented in the analysis. When important sources of variation or correlation are omitted, the consequences can go beyond increased unexplained variation. Incorrect assumptions about independence or covariance can lead to incorrect standard errors, unreliable tests and poor predictions. This is where mixed models become particularly valuable.

When the Structure of the Data Matters

Many familiar statistical methods work well when their assumptions are a reasonable match for the experiment. Classical ANOVA, for example, is well suited to many experimental designs. However, mixed-model methods become particularly valuable when the variance or covariance structure cannot be adequately represented within a classical ANOVA framework.

Consider a breeding trial conducted across multiple environments. The objective may be to compare genotypes, but observed performance can also be affected by the environment, blocks within environments, and interactions between genotype and environment. Some genotypes may not be present in every environment, or replication may differ between environments.

Or consider an animal study where several measurements are collected from the same individuals over time. Those observations carry information about change, but they are also correlated because they come from the same animal.

The issue in both cases is not simply that the dataset is “complex”. It is that the way the observations are structured and related can matter to the inference or prediction being made.

Mixed models provide a framework for representing those relationships rather than requiring them to be simplified away.

Where Simpler Models can Start to Fall Short

There is no virtue in using a more complicated statistical model when a simpler one adequately represents the experiment. The difficulty comes when simplification changes what the analysis assumes about the data.

This can happen in several ways.

Hierarchy and multiple sources of variation. Biological experiments frequently contain several levels of organisation: individuals within groups, plots within blocks, or trials across locations and years. Mixed models allow variation associated with those different levels of hierarchy to be represented rather than combining it all into a single source of unexplained variation. 

Unequal replication. Balance is useful statistically, but real datasets are not always balanced. Mixed models fitted using REML provide a flexible framework for analysing unbalanced datasets, allowing differences in replication across treatments, genotypes or environments to be accommodated appropriately.

Repeated measurements. Longitudinal observations from the same experimental unit are correlated. The relationship between them may also depend on when measurements were taken. Mixed models can represent this dependence through random effects and/or an appropriate residual covariance structure, including situations where observations are not equally spaced through time.

Spatial variation. In field experiments, underlying spatial patterns can create correlation between observations. Spatial mixed models can account for row and column effects and, where appropriate, replace the assumption of independent residual errors with a spatial correlation structure.

Correlated traits. Where several traits are measured, analysing each independently can overlook information contained in the relationships between them. Multi-trait mixed models allow those relationships to be estimated jointly. In genetic applications, joint analysis can improve genetic prediction when the traits contain useful correlated information, and can allow information from correlated traits to contribute where a focal trait has been measured on only part of the experimental material.

These are different statistical problems, but they share something important: the way observations relate to one another contains information.

Ignoring that structure is itself a modelling decision.

What Does a Mixed Model Add?

At its core, a mixed model allows several sources of variation to be considered within the same analysis.

It can combine effects of interest with sources of variation arising from the experimental or biological structure. It can also allow the relationships between observations to be modelled through appropriate variance and covariance structures.

That flexibility changes what the analysis can represent.

In a field trial, for example, the question may not simply be whether varieties differ in yield. The model may also need to recognise variation between blocks, spatial patterns across the field or differences between environments.

In longitudinal research, the important question may be how a response develops through time, while recognising that repeated observations from the same individual are related.

And in breeding programmes, the aim may be to predict genetic effects while accounting for environmental and experimental sources of variation, ultimately producing predictions that can inform selection.

REML, or Residual Maximum Likelihood, is commonly used to estimate variance components in linear mixed models. By combining an appropriately specified model with REML estimation, researchers can estimate the magnitude of distinct sources of variation rather than absorbing them all into a single residual variance.

From a Trial to a Model

Take a variety trial conducted across several environments.

Looking at a simple average yield across the trials might produce a clear ranking. But that ranking alone does not separate the different sources of variation behind the observed performance, or show whether varieties are responding consistently across environments.

The data may contain further structure that matters to the analysis. Replication may differ between environments. Within individual trials, spatial variation may contribute to the pattern in the residuals. And if varieties perform differently relative to one another across environments, genotype-by-environment interaction becomes part of the question too.

A mixed-model analysis allows these sources of variation to be represented within the same modelling framework. Rather than asking only “which variety had the highest average yield?”, the analysis can support more useful questions: How much variation is associated with the genotype-by-environment interaction? How consistent is performance across environments? How precisely can genetic effects be predicted once the structure of the trials has been taken into account?

For larger multi-environment datasets, the genetic covariance between environments can itself be modelled. Factor analytic structures, for example, provide a parsimonious way to do this, helping researchers investigate patterns of genotype-by-environment interaction without requiring every covariance to be estimated separately.

The objective isn’t to make the analysis complicated for its own sake. It is to avoid making the experiment simpler on paper than it was in reality.

More Complexity Isn’t Automatically Better

That distinction is important.

A model with more terms, more parameters or a more elaborate covariance structure is not automatically a better model. Complexity has to be justified by the experimental design, the biological question and the information available in the data.

In fact, sufficiently complex models can create problems of their own. High-dimensional models may require the estimation of many variance and covariance components, which can lead to computational or convergence difficulties when the data cannot support everything being asked of the model. 

The goal, therefore, is not maximum complexity.

It is an appropriate representation of the experiment.

For one study, that may be a relatively straightforward mixed model accounting for blocks and treatments. For another, it may involve spatial correlation, repeated measurements, multiple traits or genotype-by-environment interaction.

What matters is having the flexibility to represent the sources of variation that are important to the question being investigated.

Where ASReml-Python Fits

Mixed models have long been central to the analysis of breeding, agricultural and biological research. ASReml was developed specifically for this kind of work, using REML methodology to fit linear mixed models and supporting more specialised approaches including spatial, multi-trait, repeated-measures, factor analytic and random regression models. 

ASReml-Python brings that modelling capability into Python.

For researchers already using Python, or teams moving more of their analytical work into it, that means specialist mixed-model analysis can sit alongside the wider research workflow: data preparation, automation, visualisation, reporting and downstream analysis. 

And for Python data scientists entering breeding, genetics or applied biological research, it provides access to methodology developed specifically around the statistical structures common in these fields, without requiring mixed-model analysis to sit outside the Python workflow.

Ultimately, the choice of model should follow the experiment and the question being asked.

Sometimes a simpler analysis is exactly what is needed. But where hierarchy, imbalance, correlation, spatial variation, repeated observations or multiple environments are an important part of the data, the model needs enough flexibility to recognise them.

Model the biology, not the limits of the software.

Picture of The VSNi Team
The VSNi Team

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Related articles

A genotype that leads one trial can lose its advantage in the next, even when trials sit within...
Experimental and observational studies can both provide valuable insights, but they answer different kinds of questions. This article...
Spatial variation can affect comparisons between varieties or treatments in field trials, but there is no single model...