Quantitative genetics in R
Quantitative genetics is the part of evolutionary biology that deals with traits nobody can assign to a gene: body size, clutch size, flowering date, the things a field biologist actually measures. Its working assumption is that many small effects add up, which makes the machinery statistical rather than genetic, and puts covariances and regression coefficients where alleles would otherwise be. This page collects every tutorial on this site that builds that machinery by hand in base R, from measuring selection in a single season to the exact accounting of evolutionary change and the regression that turns relatedness into a number.
Measuring selection is a regression
Selection acts on phenotypes, so the first task is to describe it without knowing anything about inheritance. The covariance between a trait and relative fitness gives the selection differential, the total change within a generation, and it counts indirect effects: a trait can be under strong apparent selection purely because it correlates with something else that matters. Regressing relative fitness on several traits at once separates the direct part from the borrowed part, and the two quantities answer different questions. The distinction matters in practice because the differential is what a breeder observes and the gradient is what the causal story requires.
Predicting the response needs the genetics back
A within-generation change is not evolution. To get from selection to a response across generations, the phenotypic account has to be scaled by how much of the variation is transmitted, which is what heritability measures and what the breeder’s equation formalises. With several traits the scalar becomes a matrix, and correlated response appears: selecting on one trait moves another that was never under selection, sometimes in the wrong direction. Read that way the genetic covariance matrix is not a nuisance parameter but a description of the constraints a lineage is working under, and its leading axis says where evolution is cheap and where it is expensive.
Heritability without a selection experiment
The breeder’s equation needs a selection episode and a response to it, which is a rare thing to have in the wild. The alternative is to estimate the same transmitted variance directly, from the resemblance between relatives that a pedigree records. The model that does this is a mixed model whose random effect has a covariance matrix built from the pedigree, and once it is written that way the whole apparatus turns out to be generalised least squares with a relatedness matrix in it: the same algebra the comparative posts use across species, with kinship in place of shared ancestry. What it buys is an estimate from observational data alone. What it costs is that the estimate belongs to one population in one environment, and that everything the pedigree cannot resolve, a shared nest most of all, arrives inside the number rather than beside it.
The exact accounting
The Price equation is the general statement all of the above are special cases of. It splits any change in a population mean into a covariance between fitness and the trait, which is selection, and an expectation of the within-individual change, which is transmission. It assumes nothing about additivity, discrete generations, or a particular genetic architecture, which is why it can be applied at any level: alleles within genomes, individuals within groups, groups within a population. That generality is also its limit, since an identity cannot tell anyone what caused what.
The tutorials
Evolutionary quantitative genetics
- Selection differentials and gradients - measuring selection on a trait, and separating what acts on it from what acts through it.
- The breeder’s equation - scaling observed selection by heritability to predict a response, and where the prediction fails.
- The multivariate breeder’s equation - the genetic covariance matrix, correlated responses, and constraint as a direction.
- Nonlinear selection gradients - curvature in the fitness surface, the coefficient that has to be doubled before it is one, and the shape a single trait cannot show.
- Checking a selection analysis - the diagnostics a gradient analysis needs before its coefficients mean anything.
The animal model
- The animal model in R - the relationship matrix from a pedigree, REML by hand, and the identity with generalised least squares.
- Pedigree structure and heritability precision - which relationships carry the information, and why a pedigree of unrelated animals carries none.
- Maternal effects inflate heritability - the shared nest that arrives inside the additive variance, and the designs that get it out again.
- Checking an animal model - pedigree error, the fixed effects in the denominator, evolvability, and the zero boundary.
Where this connects
- Evolutionary game theory in R takes the same social interactions and asks about strategies rather than breeding values.
- Causal inference in ecology with R formalises the confounding that turns a selection differential into a misleading gradient.
- Ordination in R uses the eigen decomposition that the genetic covariance matrix is read through.
- Phylogenetic generalised least squares applies the same relatedness matrix across species instead of within a population.
- Population genetics in R works with the allele frequencies underneath the variance components used here.