R code and example data for calculating the strength of sexual selection and remaining selection at both the phenotypic and quantitative genetic levels, as detailed in the paper:
Henshaw JM, Jennions MD, Kruuk LEB (2018). How to quantify (the response to) sexual selection on traits. Evolution.
Requires the free package lavaan and the commercial package ASReml-R (the latter only for calculating additive genetic (co)variances for use in the quantitative genetic model).
R code for the worked example 'Fat, sexy and fecund' from the main text (see also the associated data file)
Data for the worked example 'Fat, sexy and fecund'
R code for the worked example 'Size selection in male pipefish' from the main text (see also the associated data file)
Data for the worked example 'Size selection in male pipefish'. Many thanks to Kenyon Mobley and Adam Jones for generously sharing this data (see main text for references to the original publications).
R code for the worked example 'Cheating vs caring' from the Supporting Information (see also the associated pedigree and trait data files). The code for estimating additive genetic (co)variances requires the commercial package ASReml-R. The rest of the code requires only freely available packages.
Trait data for the worked example 'Cheating vs caring'
Pedigree data for the worked example 'Cheating vs caring'