-
Notifications
You must be signed in to change notification settings - Fork 1
/
why-natural-selection.Rmd
2321 lines (1870 loc) · 96.8 KB
/
why-natural-selection.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
title: "Human capital mediates natural selection in contemporary humans"
author: "David Hugh-Jones \\thanks{Corresponding author. School of Economics, University of East Anglia, Norwich, UK. Email: D.Hugh-Jones@uea.ac.uk}, Abdel Abdellaoui \\thanks{Department of Psychiatry, Amsterdam UMC, University of Amsterdam, Amsterdam, The Netherlands. Email: a.abdellaoui@amsterdamumc.nl}"
date: "`r format(Sys.Date(), '%d %B %Y')`"
abstract: "\\noindent Natural selection has been documented in contemporary humans, but little is known about the mechanisms behind it. We test for natural selection through the association between 33 polygenic scores and fertility, across two generations, using data from UK Biobank (N = 409,629 British subjects with European ancestry). Consistently over time, polygenic scores that predict higher earnings, education and health also predict lower fertility. Selection effects are concentrated among lower SES groups, younger parents, people with more lifetime sexual partners, and people not living with a partner. The direction of natural selection is reversed among older parents, or after controlling for age at first live birth. These patterns are in line with the economic theory of fertility, in which earnings-increasing human capital may either increase or decrease fertility via income and substitution effects in the labour market. Studying natural selection can help us understand the genetic architecture of health outcomes: we find evidence in modern day Great Britain for multiple natural selection pressures that vary between subgroups in the direction and strength of their effects, that are strongly related to the socio-economic system, and that may contribute to health inequalities across income groups."
bibliography: "why-natural-selection.bib"
output:
bookdown::pdf_document2:
toc: false
latex_engine: xelatex
number_sections: true
keep_tex: true
header-includes:
- \usepackage{subfig}
- \usepackage{setspace}\doublespacing
- \usepackage{placeins}
- \usepackage[format=plain, labelfont={bf,it}, textfont=it]{caption}
- \usepackage{titlesec}
- \titleformat*{\section}{\sffamily\LARGE}
- \titleformat*{\subsection}{\sffamily\itshape\Large}
- \hypersetup{colorlinks = true, linkcolor = {blue}, linkbordercolor = {white}}
- \usepackage{amsthm}
- \theoremstyle{plain}
- \newtheorem{lem}{\protect\lemmaname}
- \providecommand{\lemmaname}{Lemma}
- \usepackage{etoc}
- \usepackage{lineno}
- \linenumbers
editor_options:
markdown:
wrap: 72
chunk_output_type: console
mainfont: Baskerville
mathfont: Baskerville
sansfont: "Gill Sans"
---
```{r setup, include = FALSE}
library(drake)
library(magrittr)
library(dplyr)
library(forcats)
library(ggplot2)
library(tidyr)
library(santoku) # keep this after tidyr as it masks chop
library(purrr)
library(glue)
library(broom)
library(huxtable)
loadNamespace("scales")
loadNamespace("shades")
# nasty hack to make add_ashe_income work later:
if (! exists("add_ashe_income")) source("~/import-ukbb-data/import-ukbb-data.R")
drake::loadd(rgs)
drake::loadd(score_names)
drake::loadd(famhist)
options(digits = 2)
options(dplyr.summarise.inform = FALSE)
knitr::opts_chunk$set(
echo = FALSE,
warning = FALSE,
cache = FALSE,
error = FALSE,
fig.height = 3.5,
dev = "cairo_pdf"
)
knitr::knit_hooks$set(
inline = function (x) {
if (is.numeric(x)) x <- as.character(round(x, getOption("digits")))
x <- gsub("-", "\u2212", x)
paste(as.character(x), collapse = ", ")
}
)
options(huxtable.long_minus = TRUE)
huxtable::set_default_properties(latex_float = "h!")
theme_set(theme_minimal())
theme_update(
text = element_text(family = "Abadi MT Condensed Light")
)
my_hline <- geom_hline(yintercept = 0, colour = "grey20", linetype = "dotted")
my_vline <- geom_vline(xintercept = 0, colour = "grey20", linetype = "dotted")
standard_ggplot <- function (
dfr,
fill_col,
n_regs,
...,
score_col = quo(term),
order_idx = 1,
fill_direction = 1,
n_cats = NULL,
conf_int = NULL
) {
if (! missing(score_col)) score_col <- enquo(score_col)
mfc <- missing(fill_col)
fill_col <- if (mfc) quo(NULL) else enquo(fill_col)
if (missing(n_cats)) {
n_cats <- if (mfc) 1 else length(unique(pull(dfr, {{fill_col}})))
}
if (is.null(conf_int)) conf_int <- "conf.low" %in% names(dfr)
if (conf_int) {
confint_scale <- scale_linetype_manual(
name = "",
values = c("95% c.i. uncorrected" = 1),
guide = guide_legend(order = 3)
)
confint_geom_segment <- geom_segment(
aes(
x = conf.low,
xend = conf.high,
linetype = "95% c.i. uncorrected"
),
color = "grey45",
alpha = 0.2,
size = 1.1,
lineend = "round"
)
} else {
confint_scale <- NULL
confint_geom_segment <- NULL
}
my_shape_fill_guide <- guide_legend(order = 1)
n_regs <- as.double(n_regs)
shape_values <- paste(c("circle", "square", "triangle", "diamond",
"triangle down"), "filled")
shape_values <- shape_values[1:n_cats]
if (fill_direction == -1) shape_values <- rev(shape_values)
dfr %>% mutate(
!! score_col := pretty_names(!! score_col),
!! score_col := fct_reorder(!! score_col, estimate, order_abs(order_idx))
) %>%
rename(p = p.value) %>%
ggplot(aes(estimate, {{score_col}}, yend = {{score_col}},
shape = {{fill_col}}, ...)) +
my_vline +
confint_geom_segment +
geom_point(size = 1.8, alpha = 0.8, aes(color = {{fill_col}},
fill = stage(p < 0.05/{{n_regs}}, after_scale = ifelse(
fill == "white", fill, color)))) +
my_fill_scale(aesthetics = "color", n = n_cats, direction = fill_direction,
guide = my_shape_fill_guide) +
scale_fill_manual(values = c("TRUE" = "black", "FALSE" = "white"),
guide = guide_legend(
title = sprintf("p < 0.05/%s", n_regs),
override.aes = list(shape = "circle filled"),
order = 2
)) +
scale_shape_manual(values = shape_values, guide = my_shape_fill_guide) +
my_labs() +
my_theme(
legend.justification = "top",
panel.grid.major.y = element_blank()
) +
confint_scale
}
my_theme <- function (...) {
theme(
axis.text.y = element_text(size = 7),
panel.grid.major = element_line(size = rel(0.5)),
...
)
}
my_fill_scale <- function (n, aesthetics = "fill", direction = 1, ...) {
fill_colors <- c("steelblue4", "darkred")
scale <- if (n <= 2) {
dots <- list(...)
dots$direction <- NULL
do.call(scale_colour_manual, c(list(values = fill_colors[1:n],
aesthetics = aesthetics),
dots))
} else {
# scale <- scale_color_viridis_d(aesthetics = aesthetics, option = "D",
# direction = direction, end = 0.6, ...)
fill_colors <- c(fill_colors[1], "#008b8b", fill_colors[2])
if (direction != -1) fill_colors <- rev(fill_colors)
scale_color_manual(aesthetics = aesthetics,
values = shades::gradient(fill_colors,
steps = n, space = "Lab"),
...)
}
scale
}
my_labs <- function (x = "Effect size", y = "", ...) labs(x = x, y = y, ...)
# for use when reordering factors. Order by the nth score in a group
order_abs <- function (n = 1) {
function (x) x[n]
}
comma_num <- function (x) prettyNum(x, big.mark = ",")
pretty_names <- function (names) {
pretty <- c(
ADHD_2017 = "ADHD",
age_at_menarche = "Age at menarche",
age_at_menopauze = "Age at menopause",
agreeableness = "Agreeableness",
ai_substance_use = "Age at smoking initiation",
alcohol_schumann = "Alcohol use",
alzheimer = "Alzheimer",
autism_2017 = "Autism",
bipolar = "Bipolar",
bmi_combined = "BMI",
body_fat = "Body Fat",
caffeine = "Caffeine",
cannabis = "Cannabis (ever vs. never)",
cognitive_ability = "Cognitive Ability",
conscientiousness = "Conscientiousness",
coronary_artery_disease = "Coronary Artery Disease",
cpd_substance_use = "Cigarettes per day",
diagram_T2D = "Type 2 Diabetes",
dpw_substance_use = "Drinks per week",
EA2_noUKB = "Educ. attainment 2 (no UKBB)",
EA3_excl_23andMe_UK = "Educ. attainment 3 (no UK)",
eating_disorder = "Eating disorder",
extraversion = "Extraversion",
height_combined = "Height",
hip_combined = "Hip circumference",
MDD_PGC2_noUKB = "Major Depressive Disorder",
neuroticism = "Neuroticism",
openness = "Openness",
sc_substance_use = "Smoking cessation",
SCZ2 = "Schizophrenia",
si_substance_use = "Smoking initiation",
wc_combined = "Waist circumference",
whr_combined = "Waist-hip ratio"
)
pretty[names]
}
n_in_regs <- function (var, dv = "RLRS", data = famhist) {
fh_subset <- data
if (dv == "RLRS") fh_subset %<>% filter(kids_ss)
# all PGS have the same NA pattern, so we just use one
tbl <- table(fh_subset[
! is.na(fh_subset[dv]) & ! is.na(fh_subset$whr_combined),
var
])
c(tbl)
}
add_n <- function (var, famhist_var = var, dv = "RLRS", data = famhist,
reverse = FALSE) {
var <- as.factor(var)
n <- n_in_regs(famhist_var, dv, data)
# this is a horrible hack which just happens to work
# check all Ns manually!
if (reverse) n <- rev(n)
levels(var) <- sprintf("%s (N = %s)", levels(var),
prettyNum(n[seq_len(nlevels(var))], big.mark = ","))
# var_n <- sprintf("%s (N = %s)", var, prettyNum(n[var], big.mark = ","))
# var_n[is.na(var)] <- NA
var
}
# from https://github.com/dgrtwo/drlib/blob/master/R/reorder_within.R
# for ordering within facets
reorder_within <- function(x, by, within, fun = mean, sep = "___", ...) {
new_x <- paste(x, within, sep = sep)
stats::reorder(new_x, by, FUN = fun)
}
scale_x_reordered <- function(..., sep = "___") {
reg <- paste0(sep, ".+$")
ggplot2::scale_x_discrete(labels = function(x) gsub(reg, "", x), ...)
}
scale_y_reordered <- function(..., sep = "___") {
reg <- paste0(sep, ".+$")
ggplot2::scale_y_discrete(labels = function(x) gsub(reg, "", x), ...)
}
```
\normalem
# Introduction
Living organisms evolve through natural selection, in which allele frequencies
change in the population through differential reproduction rates. Studying the
mechanisms behind natural selection can help us better understand how individual
differences in complex traits and disease risk arise [@benton2021influence].
Recent work confirms that natural selection is taking place in modern human
populations, using genome-wide analysis
[@Barban_2016;@beauchamp2016genetic;@conley2016assortative;@kong2017selection;@sanjak2018evidence;@FIEDER202216]. In
particular, genetic variants associated with higher educational attainment are
being selected against, although effect sizes appear small.
As yet we know little about the social mechanisms behind natural selection. The
economic theory of fertility [@becker1960economic] offers a potential
explanation. Higher potential earnings have two opposite effects on fertility: a
fertility-increasing *income effect* (higher income makes children more
affordable), and a fertility-lowering *substitution effect* (time spent on
childrearing has a higher cost in foregone earnings). Thus, an individual's
*human capital* -- skills and personality traits which are valuable in labour
markets -- can increase or decrease their fertility. Genetic variants which are
linked to human capital will then be selected for or against. Also, the economic
theory predicts that the relative strength of income and substitution effects
will vary systematically across different social groups.
This study uses data from UK Biobank [@bycroft2018uk] to learn more about
contemporary natural selection. We test for natural selection on 33 different
polygenic scores by estimating their correlation with fertility. We extend the
analysis over two generations, using data on respondents' number of siblings as
well as their number of children. This is interesting because consistent natural
selection over multiple generations could lead to substantive effects in the
long run. Next, we examine correlations with fertility in different subgroups.
Across the board, selection effects are stronger in groups with lower income and
less education, among younger parents, people not living with a partner, and
people with more lifetime sexual partners. Outside these groups, effects are
weaker and often statistically insignificant. In some subgroups, the direction
of selection is even reversed.
We then show that a simple model of human capital, education and fertility
choices can give rise to these empirical results. At higher incomes, the income
and substitution effects are balanced, while among lower-income people, or
single parents who face a bigger time burden from childcare, the substitution
effect dominates. The theory predicts that polygenic scores' correlation
with fertility is associated with their correlation with education and earnings,
and we confirm this. We then run a mediation analysis, which shows that part of the
correlation with fertility is indeed mediated by educational attainment.
Thus, contemporary natural selection on polygenic scores can be explained
by scores' correlation with earnings-increasing human capital.
Lastly, we discuss the effects of natural selection. While our estimated effects
on measured polygenic scores are small, natural selection substantially
increases the correlation between polygenic scores and income, increasing
genetic differences between different social groups, and thus making the
"genetic lottery" [@harden2021genetic] more unfair.
# Results
We created polygenic scores for 33 traits in `r comma_num(nrow(famhist))`
individuals of European descent, corrected for ancestry using 100 genetic
principal components (see Materials and Methods). Figure
\@ref(fig:plot-means-over-time) plots mean polygenic scores in the sample by
5-year birth intervals. Several scores show consistent increases or declines
over this 30-year period, of the order of 5% of a standard deviation. These
changes could reflect natural selection within the UK population, but also
emigration, or ascertainment bias in the sample [@10.1093/aje/kwx246].
```{r plot-means-over-time, fig.height = 7, fig.cap = "Mean polygenic scores (PGS) by birth year in UK Biobank. Symbols show means for 5-year intervals. Bars are 95% confidence intervals. Triangles denote a significant linear increase or decrease over time (p < 0.05/33)."}
drake::loadd(pgs_over_time)
pgs_over_time %>%
mutate(score_name = pretty_names(score_name)) %>%
ggplot(aes(YOB, group = score_name, colour = Change, shape = Change)) +
geom_linerange(aes(ymin = score_lo, ymax = score_hi), color = "grey70",
size = 3) +
geom_point(aes(y = score), size = 1.5) +
facet_wrap(~score_name, ncol = 5) +
my_hline +
scale_color_manual(values = c("-" = "darkred", "+" = "darkgreen", "o" = "black")) +
scale_shape_manual(values = c(
"-" = "triangle down open",
"+" = "triangle open",
"o" = "circle open"
)) +
theme(
line = element_line(size = 0.5, lineend = "round"),
strip.text = element_text(size = 8),
axis.text.x = element_text(size = 7),
legend.position = "none"
) +
labs(y = "PGS", x = "Birth year (5 year intervals)")
```
To test for natural selection more directly, we regress respondents' relative
lifetime reproductive success (RLRS) on each polygenic score (PGS):
```{=tex}
\begin{equation}
\mathrm{RLRS}_i = \alpha + \beta\mathrm{PGS}_i + \varepsilon_i
\label{eq:regression}
\end{equation}
```
RLRS is defined as respondent $i$'s number of children, divided by the mean number
of children of people born in the same year. The "selection effect", $\beta$,
reflects the strength of natural selection within the sample. In fact, since
polygenic scores are normalized, $\beta$ is the expected polygenic score among
children of the sample [@beauchamp2016genetic].[^normalization] Note that
equation \eqref{eq:regression} does not control for many environmental and genetic
factors that could affect fertility, and as a result, $\beta$ is not an estimate
of the causal effect of a polygenic score on fertility. However, natural
selection is a matter of correlation not causation: polygenic scores which
correlate with high fertility are being selected for, whatever the underlying
causal mechanism.
[^normalization]:The selection effect $\beta$ equals $Cov(RLRS, PGS)/Var(PGS)$.
Since PGS are normalized to variance 1 and mean 0, this reduces to $Cov(RLRS,
PGS) = E(RLRS\times PGS) - E(RLRS) E(PGS) = E(RLRS \times PGS)$. This is the
polygenic score weighted by relative lifetime reproductive success, which is the
average polygenic score in the next generation [@robertson1966mathematical].
```{r calc-res-weighted}
drake::loadd(res_wt_flb_weights)
drake::loadd(res_wt_msoa_weights)
drake::loadd(res_wt_age_qual_weights)
drake::loadd(res_wt_van_alten_weights)
drake::loadd(res_sibs_parent_weights)
drake::loadd(res_unweighted)
drake::loadd(res_sex)
res_wt_combined <- bind_rows(
None = res_unweighted %>%
select(-score_name) %>%
filter(term != "(Intercept)"),
Main = res_wt_van_alten_weights,
Geographical = res_wt_msoa_weights,
`Age/Qualification` = res_wt_age_qual_weights,
`Age/Qual/AFLB` = res_wt_flb_weights,
.id = "Weights"
)
n_sig <- sum(res_wt_van_alten_weights$p.value < 0.05/33)
res_wt_cb_wide <- res_wt_combined %>%
tidyr::pivot_wider(
id_cols = term,
names_from = Weights,
values_from = estimate
) %>%
rowwise() %>%
mutate(
consistent = all(c_across(-term) > 0) ||
all(c_across(-term) < 0)
) %>%
ungroup() %>%
left_join(
res_wt_combined %>%
filter(Weights == "None") %>%
select(term, p.value),
by = "term"
) %>%
left_join(
res_sex %>%
filter(sex == "Female") %>%
select(term, estimate_females = estimate),
by = "term"
)
rel_sizes <- res_wt_cb_wide %>%
filter(
consistent,
p.value < 0.05/length(score_names)
) %>%
mutate(
Geographical = Geographical/None,
`Age/Qualification` = `Age/Qualification`/None,
Main = Main/None,
`Age/Qual/AFLB` = `Age/Qual/AFLB`/estimate_females
) %>%
select(-consistent, -None, -p.value, -estimate_females) %>%
mutate(
term = pretty_names(term)
)
rel_sizes_summary <- rel_sizes %>%
summarize(
across(-term, ~ c(mean(.x), median(.x)))
) %>%
mutate(
term = c("Mean", "Median")
)
mean_rel <- c(rel_sizes_summary[1, 1:3])
```
Figure \@ref(fig:plot-res-wt) plots selection effects in the whole
sample.[^balance-diverse-def] To correct for ascertainment bias, we use
participant weights from @vanalten2022reweighting, which match the UK Biobank eligible
population on sex, birth year, location, education, employment, health,
household size and tenure, number of cars and age at death. Weighting makes a
large difference: effect sizes go up by a mean of
`r scales::percent(mean_rel$Main - 1)`.[^weighting] `r n_sig` out of 33 weighted
selection effects are significant at $p$ < 0.05/33.
[^balance-diverse-def]: We also check for stabilizing and disruptive selection by
estimating \@ref(eq:regression) with a quadratic term. Stabilizing selection
selects for intermediate values, while disruptive selection selects for extreme
values. In particular, we find disruptive selection for educational attainment
polygenic scores: at higher values of these scores, the negative effect on
fertility is smaller (Appendix Figure \@ref(fig:plot-purifying)).
[^weighting]: We use these weights throughout. All our qualitative results are
robust if we run unweighted regressions. Appendix Table \@ref(tab:tbl-res-wt)
shows results from alternative weighting schemes.
```{r plot-res-wt, fig.cap = "Selection effects: weighted and unweighted regressions. Each point represents a single bivariate regression of RLRS on a polygenic score. P value threshold is 0.05, Bonferroni-corrected for multiple comparisons. Confidence intervals are uncorrected."}
n_regs <- as.double(length(score_names))
res_wt_combined %>%
filter(Weights %in% c("Main", "None")) %>%
mutate(
Weights = recode(Weights, "Main" = "Weighted", "None" = "Unweighted"),
) %>%
standard_ggplot(fill_col = Weights, n_regs = n_regs, fill_direction = -1,
order_idx = 2)
```
We now show the empirical puzzles which motivate our economic model. Each
concerns differences in the strength of natural selection across different
subgroups in the sample. We re-estimate \@ref(eq:regression) splitting the
sample by demographic and social variables, including income and education, and
family structure variables including age at first live birth, presence of a
partner, and lifetime number of sexual partners.
```{r calc-pct-diffs}
drake::loadd(res_edu)
drake::loadd(res_income)
drake::loadd(res_partners_joint)
drake::loadd(res_with_partner)
res_partners_joint %<>% filter(grepl(":", term))
res_with_partner %<>% filter(grepl(":", term))
res_edu_wide <- full_join(
res_edu %>% filter(age_fte_cat == "< 16"),
res_edu %>% filter(age_fte_cat == "> 18"),
by = "score_name"
)
res_income_wide <- full_join(
res_income %>% filter(income_cat == 1),
res_income %>% filter(income_cat == 5),
by = "score_name"
)
res_partners_wide <- full_join(
res_partners_joint %>% filter(grepl("lo_partnersFALSE", term)),
res_partners_joint %>% filter(grepl("lo_partnersTRUE", term)),
by = "score_name"
)
res_with_partner_wide <- full_join(
res_with_partner %>%
filter(grepl("with_partnerFALSE", term)),
res_with_partner %>%
filter(grepl("with_partnerTRUE", term)),
by = "score_name"
)
median_pct_diff <- function (dfr) {
prop <- dfr %>% filter(
p.value.x < 0.05/33,
sign(estimate.x) == sign(estimate.y)
) %>%
mutate(
pct_diff = estimate.x/estimate.y
) %>%
pull(pct_diff) %>%
median()
# percentage difference:
prop - 1
}
pct_diff_edu <- median_pct_diff(res_edu_wide)
pct_diff_income <- median_pct_diff(res_income_wide)
pct_diff_n_partners <- median_pct_diff(res_partners_wide)
pct_diff_with_partner <- median_pct_diff(res_with_partner_wide)
```
Figure \@ref(fig:plot-income-educ-level) plots selection effects for each
polygenic score, grouping respondents by age of completing full-time education,
and by household income. Effects are larger and more significant for the lowest
education category, and for the lowest income category. The median percentage
difference between the lowest and highest education categories, among scores
which are significant for the lowest category and have the same sign across
categories, is `r scales::percent(pct_diff_edu)`. Between the lowest and
highest income categories, it is `r scales::percent(pct_diff_income)`. These
results are robust to controlling for respondents' age (Appendix section
\@ref(sec:age-control)). Turning to family structure, we split respondents by
lifetime number of sexual partners, at the median value of 3 (Figure
\@ref(fig:plot-n-partners)a). Now, selection effects are larger and more
significant among those with more than 3 lifetime partners, with a median percentage
difference of `r scales::percent(pct_diff_n_partners)`. Next we split
respondents by whether they were living with a spouse or partner at the time of
interview (Figure \@ref(fig:plot-n-partners)b). Effects are larger among those not living with a spouse or partner. The median percentage difference is
`r scales::percent(pct_diff_with_partner)`.[^sex]
[^sex]: The same pattern holds if we analyse men and women separately (Appendix Figure
\@ref(fig:plot-n-partners-sex)). We also directly compared selection effects
between men and women (Appendix Figure \@ref(fig:plot-sexes)).
```{r plot-income-educ-level, fig.cap = "Selection effects by education and income.", fig.subcap = c("Age left full-time education", "Household income"), fig.ncol = 1}
drake::loadd(res_edu)
n_regs <- as.double(nrow(res_edu))
res_edu %>%
mutate(
"Age left FTE" = fct_relevel(age_fte_cat, "< 16", "16-18", "> 18"),
"Age left FTE" = add_n(`Age left FTE`, "age_fte_cat")
) %>%
standard_ggplot(n_regs = n_regs, fill_col = `Age left FTE`)
drake::loadd(res_income)
n_regs <- as.double(nrow(res_income))
res_income %>%
mutate(
Income = factor(income_cat,
labels = c("< £18K", "£18-30K", "£31-51K", "£52-100K", "> £100K")
),
Income = add_n(Income, "income_cat")
) %>%
standard_ggplot(n_regs = n_regs, fill_col = `Income`)
```
```{r plot-n-partners, fig.cap = "Selection effects by number of sexual partners and presence of a partner.", fig.subcap = c("Lifetime number of sexual partners", "Presence of a partner"), fig.ncol = 1, fig.align = "center", fig.height = 4}
drake::loadd(res_partners_joint)
res_partners_joint %<>%
filter(grepl(":", term)) %>%
mutate(`N partners` = ifelse(grepl("TRUE:", term), "3 or less", "4 or more"))
n_regs <- as.double(nrow(res_partners_joint))
res_partners_joint %>%
mutate(
`N partners` = add_n(`N partners`, "n_partners_split", reverse = TRUE,
data = famhist %>%
mutate(n_partners_split = n_partners <= 3))
) %>%
standard_ggplot(fill_col = `N partners`, n_regs = n_regs,
score_col = score_name, fill_direction = -1)
drake::loadd(res_with_partner)
res_with_partner %<>% filter(grepl(":", term))
n_regs <- as.double(nrow(res_with_partner))
res_with_partner %>%
mutate(
Household = ifelse(grepl("TRUE", term), "With partner",
"Without partner"),
Household = add_n(Household, "with_partner", reverse = TRUE)
) %>%
standard_ggplot(fill_col = Household, n_regs = n_regs,
score_col = score_name, fill_direction = -1)
```
```{r calc-age-flb-cross}
drake::loadd(res_age_flb_cross)
cor_age_flb <- res_age_flb_cross %>%
mutate(category = gsub(":.*", "", term)) %>%
pivot_wider(score_name, names_from = category, values_from = estimate) %>% {cor(.$`age_flb_cat10-22`, .$`age_flb_cat28-52`)}
```
```{r calc-corr-age-flb}
drake::loadd(res_age_flb)
drake::loadd(res_sex)
res_sex_comparison <- res_sex %>%
filter(sex == "Female") %>%
mutate(score_name = term) %>%
select(score_name, term, estimate:conf.high)
res_age_flb %<>% filter(term != "age_flb")
res_combined <- bind_rows(
raw = res_sex_comparison,
with_age = res_age_flb %>% select(score_name, term, estimate:conf.high),
.id = "reg.type"
) %>%
arrange(score_name)
raw_flb_comparison <- res_combined %>%
pivot_wider(
id_cols = score_name,
names_from = reg.type,
values_from = estimate
)
cor_raw_flb <- cor(raw_flb_comparison$raw, raw_flb_comparison$with_age)
opp_signed <- sum(
sign(raw_flb_comparison$raw) != sign(raw_flb_comparison$with_age)
)
```
Lastly, we split female respondents by age at first live birth
(AFLB).[^aflb-no-men] There is evidence for genetic effects on AFLB
[@Barban_2016], and there is a close link between this variable and number of
children born. Figure \@ref(fig:plot-age-flb) shows effect sizes estimated
separately for each tercile of AFLB. Effects are strikingly different
across terciles. Educational attainment, ADHD and MDD are selected for amongst
the youngest third of mothers, but selected against among the oldest two-thirds.
Similarly, several polygenic scores for body measurements are selected against
only among older mothers. The correlation between effect sizes for the youngest
and oldest terciles is `r cor_age_flb`. To investigate this further, we estimate
equation \@ref(eq:regression) among females, *controlling* for AFLB. In
`r opp_signed` out of `r length(score_names)` cases, effects change sign when
controls are added. The correlation between effect sizes controlling for AFLB,
and raw effect sizes, is `r cor_raw_flb`. Thus, selection effects seem to come
through two opposing channels: a correlation with AFLB, and an opposite-signed
correlation with number of children after AFLB is controlled for.
[^aflb-no-men]: AFLB is unavailable for men.
```{r plot-age-flb, fig.cap = "Selection effects by age at first live birth terciles (women only).", fig.align = "center"}
drake::loadd(res_age_flb_cross)
# this counts each cross term as a separate test:
n_regs <- as.double(nrow(res_age_flb_cross))
res_age_flb_cross %>%
mutate(
`Age at first live birth` = gsub("age_flb_cat(.*):.*", "\\1", term),
`Age at first live birth` = add_n(`Age at first live birth`, "age_flb_cat")
) %>%
standard_ggplot(score_col = score_name,
fill_col = `Age at first live birth`, n_regs = n_regs)
```
```{r calc-siblings-children}
sib_chn_cor <- cor.test(famhist$RLRS_parents, famhist$RLRS, use = "complete")
stopifnot(sib_chn_cor$p.value < 2e-16)
```
We emphasize that these categories are not exogenous to polygenic scores. For
example -- both in the data (Appendix Figure \@ref(fig:plot-age-flb-dv)) and in
our theoretical model -- education and age at first live birth are choice
variables, which are endogenous to a person's human capital and to relevant
polygenic scores. Nevertheless, differences in selection effects across
subgroups constrain the set of possible explanations. A good theory of contemporary
natural selection needs to show how these differences come about. As we describe
below, a model based on the economic theory of fertility can do just that.
We also examine selection effects among respondents' parents, using information
on respondents' number of siblings to calculate parents' RLRS. Effect sizes of
polygenic scores are highly correlated across the two generations (Appendix
Figure \@ref(fig:plot-res-sibs)). Median-splitting respondents by year of birth,
we find little evidence of change in effect sizes among the parents' generation.
There is some evidence that selection effect sizes are increasing in the
respondents' generation, with 8 polygenic scores showing a significant increase.
We also check whether selection effects vary by
AFLB and socio-economic status in the parents' generation, using the 1971
Townsend deprivation score of respondents' birthplace as a proxy for income
[@townsend1987deprivation]. Results show the same pattern as for the
respondents' generation. Effect sizes are larger and more often significant in
the most deprived areas (Appendix Figure \@ref(fig:plot-siblings-townsend)).
Effects are larger among younger fathers and mothers, and change sign when
controlling for AFLB (Appendix Figures \@ref(fig:plot-age-birth-parents-cross),
\@ref(fig:plot-age-birth-parents)). Lastly, we check for a "quantity-quality
tradeoff" between parents' number of children and number of grandchildren. We
don't find any: in fact, the correlation between respondents' and parents' RLRS
is positive ($\rho$ = `r sib_chn_cor$estimate`, $p < 2 \times 10^{-16}$).
\FloatBarrier
# Human capital and natural selection
These results show that selection effects are weaker, absent, or even reversed
among some subgroups of the population. A possible explanation for this comes
from the economic theory of fertility
[@becker1960economic; @willis1973new;@becker1976child]. According to this theory,
increases in a person's wage affect their fertility via two opposing channels.
There is an *income effect* by which children become more affordable, like any
other good. There is also a *substitution effect*: since childrearing has a cost
in time, the opportunity cost of childrearing increases if one's market wage is
higher. The income effect leads higher earners to have more children. The
substitution effect leads them to have fewer.
Suppose that certain genetic variants correlate with *human capital*: skills or
other characteristics that affect an individual's earnings in the labour market
[@mincer1958investment; @becker1964human]. These variants may then be associated
with opposing effects on fertility. The income effect will lead to natural
selection in favour of earnings-increasing variants (or variants that are merely
associated with higher earnings). The substitution effect will do the reverse.
To show this, consider a simple model of fertility choices. $h$ is
an individual's level of human capital. For now, we simply identify this with
his or her wage $W$. Raising a child takes time $b$. People maximize utility $U$
from the number of children $N$ and from income $Y\equiv(1-bN)W$:
\[
U = u(Y)+aN.
\]
Here $a$ captures the strength of preference for children. $u(\cdot)$ captures
the taste for income, and is increasing and concave. We treat $N$ as continuous,
in line with the literature: this can be thought of as the expected number of
children among people with a given $a$, $b$ and $W$. The marginal
benefit of an extra child is $\frac{dU}{dN} = -bWu'(Y)+a$. The effect of an
increase in human capital on this marginal benefit is
\[
\frac{d^{2}U}{dNdW}=\underbrace{-bu'(Y)}_{\textrm{Substitution effect}}\underbrace{-bYu''(Y)}_{\textrm{Income effect}}.
\]
The *substitution effect* is negative and reflects that when wages increase,
time devoted to childcare costs more in foregone income. The positive *income
effect* depends on the curvature of the utility function, and reflects that when
income is higher, the marginal loss of income from children is less painful.
To examine education and fertility timing, we extend the model to
two periods. For convenience we ignore time discounting, and assume
that credit markets are imperfect so that agents cannot borrow. Write
\begin{equation}
U(N_{1},N_{2}) = u(Y_{1}) + u(Y_{2}) + aN_{1} + aN_{2}\label{eq:U}
\end{equation}
Instead of identifying human capital with wages, we now allow individuals to
spend time $s \in [0,1]$ on education in period 1.
Education is complementary to human capital $h > 0$, and increases period 2
wages, which take the simple functional form $w(s,h) = sh$. We normalize period
1 wages to 1, and let $u(\cdot)$ take the constant relative risk aversion form
$u(y)=\frac{y^{1 - \sigma} - 1}{1 - \sigma}$. $\sigma > 0$ measures the
curvature of the utility function, i.e. the decline in marginal utility of
income as income increases. We examine total fertility
$N^{*} = N_{1}^{*} + N_{2}^{*}$ and the *fertility-human capital relationship*,
$\frac{dN^{*}}{dh}$. For $\sigma < 1$ and close enough to 1, Table
\@ref(tab:theory) shows five theoretical predictions, along with our
corresponding empirical results for the correlation between polygenic scores and
RLRS.[^one-period-results] The key insight of the model is that for middling
levels of $\sigma$, the substitution effect dominates at low income levels, but
as income increases, the income and substitution effect balance out.
[^one-period-results]: Predictions 1-3 also hold in the one-period model with
constant relative risk aversion. Our empirical results are actually stronger
than prediction 5, in that correlations with fertility are *reversed* at higher
AFLB. This prediction can be accommodated in the model if children have a money
cost as well as a time cost (Appendix Figure \@ref(fig:N-plot-with-m)).
------------------------------------------------------------------------------------
**Theory: the fertility-human capital **Empirical results**
relationship is...**
--- --------------------------------------------- ----------------------------------
1. Negative: $\frac{dN^{*}}{dh} < 0$. Figures \@ref(fig:plot-means-over-time)
and \@ref(fig:plot-res-wt).
2. Weaker (closer to zero) at higher wages Figure
and/or levels of human capital. \@ref(fig:plot-income-educ-level)a.
Selection effects are also weaker at
higher polygenic scores for
educational attainment
(Appendix Figure
\@ref(fig:plot-purifying)).
3. More negative when the time burden Stronger effects for single parents
of children $b$ is larger. (Figure \@ref(fig:plot-n-partners)).
4. Weaker at higher levels of education $s$. Figure \@ref(fig:plot-income-educ-level)b.
5. Weaker among those who start fertility Effects weaker among those starting
in period 2 ($N_{1}^{*} = 0$) than among fertility later
those who start fertility in period 1 (Figure \@ref(fig:plot-age-flb)).
($N_{1}^{*} > 0$).
------------------------------------------------------------------------------------
Table: (\#tab:theory) Predictions from the theoretical model and corresponding
empirical results.
Thus, a simple economic model can explain many of our results. Other empirical
work in economics also supports the link from human capital to fertility.
@caucutt2002women and @monstad2008education show that education and skills
affect age at first birth and fertility. Income decreases fertility at low
income levels, but increases it at higher income levels [@cohen2013financial].
US fertility decreases faster with education among single mothers than married
mothers [@baudin2015fertility], in line with our prediction 3 and as predicted
by @becker1981treatise. A related literature shows negative correlations between
IQ and fertility [e.g. @lynn2004new; @reeve2018systematic].
```{r plot-cors-earnings-educ, fig.cap="Selection effects by correlations with earnings and educational attainment. Each point represents one polygenic score. Selected scores are annotated."}
drake::loadd(res_all)
drake::loadd(res_age_flb)
drake::loadd(res_cor_educ)
drake::loadd(res_cor_income)
effect_size <- res_all %>%
filter(dep.var == "RLRS", reg.type == "controlled") %>%
pull(estimate)
effect_size_flb <- res_age_flb %>%
filter(term != "age_flb") %>%
pull(estimate)
dfr <- data.frame(
PGS = rep(score_names, 4),
Correlation = rep(c("Earnings", "Education"), each = 33, 2),
cor = rep(c(res_cor_income[,1], res_cor_educ[,1]), 2),
effect_size = c(rep(effect_size, 2), rep(effect_size_flb, 2)),
Controls = rep(c("None",
"Age at first live birth"), each = 66)
)
dfr %>%
mutate(
PGS = ifelse(abs(effect_size) > 0.027, PGS, ""),
PGS = sub("(^\\w*?)_.*", "\\1", PGS)
) %>%
filter(
Controls == "None"
) %>%
ggplot(aes(effect_size, cor)) +
geom_point(color = "steelblue4") +
geom_text(aes(label = PGS), size = 3, colour = "black",
family = "Abadi MT Condensed Light",
check_overlap = TRUE, nudge_x = 0.004) +
facet_wrap( ~ Correlation, scales = "free") +
my_vline +
my_hline +
labs(x = "Selection effect", y = "Correlation") +
coord_cartesian(clip = "off") +
theme(
legend.position = "none",
panel.spacing = unit(20, "pt")
)
```
# Testing the theory
We test the economic theory in two ways. First, it predicts that
genetic variants will be selected for (or against) in proportion to their
correlation with human capital. Figure \@ref(fig:plot-cors-earnings-educ) plots
selection effects on each polygenic score against that score's correlation with
two measures of human capital: earnings in a respondent's first job, and
educational attainment. The relationships are strongly negative. Thus, human
capital appears to be relevant to natural selection. The negative relationship
suggests that substitution effects dominate income effects, which fits the known
negative association between income and fertility
[@becker1960economic;@jones2006economic]. The correlations reverse when we
control for age at first live birth, suggesting that within AFLB categories, the
income effect dominates.
```{r calc-mediation}
drake::loadd(res_mediation)
res_mediation %<>% mutate(
# 0.025 not 0.05 because two-sided
sig = abs(statistic_ind) > qnorm(1 - 0.025/
nrow(res_mediation)),