Quantitative genetics in R

Quantitative genetics in R from scratch: selection differentials and gradients, the breeder’s equation, the G matrix, the Price equation and relatedness.

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.

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.

Relatedness is a statistic, not a pedigree

Social evolution enters through the same regression logic. When an individual’s fitness depends on a neighbour’s phenotype, the covariance that selection sees runs partly through the neighbour, and the weight it carries is a regression of the neighbour’s breeding value on the actor’s. That is the honest definition of relatedness: a population statistic, measured against the local competitive background, not a fraction read off a family tree. It explains why the same pedigree kinship can imply different amounts of help in different populations, and why the scale of competition can cancel the benefit entirely.

The tutorials

Evolutionary quantitative genetics

Kin selection and social evolution

Where this connects

Newsletter

Get new tutorials by email

New R and QGIS tutorials for ecologists, straight to your inbox. No spam; unsubscribe anytime.

By subscribing you agree to receive these emails and confirm your address once. See the privacy policy.