Quantitative Genetics from Scratch in R
Selection, inheritance and relatedness, built by hand
Preface
Quantitative genetics is the part of evolutionary biology that deals with traits nobody can assign to a gene: body size, laying date, clutch size, the score an animal gets in a behavioural test. These are the traits field biologists measure, and the theory that describes how they evolve is built from covariances and regression coefficients rather than from alleles. That makes it unusually well suited to being learned with a statistics package open. Almost every idea in it can be simulated, measured and checked in a few lines of code.
This book does that. It starts from a simulated population whose true selection, heritability and relatedness are known, fits the standard estimators to it, and asks whether they return the truth. Where they do, the code shows why. Where they do not, and a surprising number of them fail in ways that are common in published work, the code measures by how much, and the text says what to do about it. Every number in the prose is computed by the code that sits next to it, so a reader can change a sample size or a correlation and watch the conclusion move.
Who it is for
The intended reader has collected data on a wild or experimental population and wants to know what can be said about selection or inheritance from it. Some familiarity with R and with linear regression is assumed; mixed models are introduced when they are needed. The mathematics goes as far as matrix algebra and no further, and each formula appears next to the code that evaluates it.
How it is organised
Part I measures selection within a generation: the differential and the gradient, the curvature of the fitness surface, and the checks a selection analysis needs before its coefficients mean anything. Part II asks what selection does across generations, which brings in heritability and the genetic covariance matrix. Part III estimates those genetic quantities from the resemblance between relatives, starting from repeated measures of one individual, with the animal model at its centre, and ends by setting the additive variance among populations against the divergence of neutral markers. Part IV turns to the exact accounting of evolutionary change in the Price equation, to selection at more than one level, and to relatedness, kin selection and the social side of fitness.
Parts I, III and IV each include a checking chapter, and they are not an appendix. The field has produced many more estimates than it has checked, and the checking chapters are where the book tries to be most useful.
Conventions
Traits are standardised to mean zero and unit variance unless stated otherwise, and fitness is relative fitness, absolute fitness divided by its mean, except where Part IV writes the costs and benefits of social behaviour in absolute fitness W and says so. The notation is kept the same throughout:
| symbol | meaning |
|---|---|
z |
a trait value |
a |
breeding value |
W, w |
absolute and relative fitness |
S |
selection differential |
beta, gamma |
linear and quadratic selection gradients (gamma is twice the coefficient of a squared term) |
P, G |
phenotypic and additive genetic covariance matrices |
V_A, V_P, V_E |
additive genetic, phenotypic and environmental variances |
V_PE, V_R, V_I |
permanent-environment, residual and among-individual variances (V_I = V_A + V_PE; V_R is what the random effects leave) |
V_N, m |
variance among nests and the maternal-effect coefficient |
h^2 |
narrow-sense heritability |
R |
response to selection |
A |
additive relationship matrix |
r |
relatedness, the regression of partners’ genotype on the actor’s |
b, c |
benefit and cost in Hamilton’s rule |
g, g' |
an individual’s allele dose and the mean dose of its social partners |
The code uses base R and ggplot2 throughout; nlme appears only in 6 Repeatability, the upper limit and 10 Checking an animal model, as a check on restricted maximum likelihood fits that the book writes out by hand. Nothing is hidden in a package: every estimator is written out first, and where base R or nlme has a packaged version the two are compared.
The book grew out of the quantitative genetics tutorials on Tidy Ecology. It is not a collection of those posts. The chapters were rewritten to follow one argument from start to finish, with a common notation, new material where the posts left gaps, and the cross-references a book can carry and a blog cannot.