-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path05_fertility-and-reproduction.Rmd
1219 lines (1008 loc) · 48.1 KB
/
05_fertility-and-reproduction.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
# Fertility and reproduction
:::{.rmdnote}
## Learning objectives {.unnumbered}
* Explain differences between fertility and mortality processes
* Describe how demographers typically resolve the "two-body" problem of fertility process dynamics
* Define important fertility and reproduction definitions... and their inconsistencies across different fields
* Define the reproductive age range and how it features in fertility rates
* Learn the differences and relationships between crude birth rate, general fertility rate, age-specific fertility rates, total fertility rate, maternity rates, and net reproductive rates
* Learn about the proximate determinants of fertility
* Define parity, then explore parity progression ratios and other cohort measures related to fertility
* Explain why you should not summarize parity by asking people about how many kids their parents had
:::
```{r echo=FALSE, message=FALSE, warning=FALSE}
library(dplyr)
library(DT)
library(ggplot2)
library(ggridges)
library(HMDHFDplus)
library(latex2exp)
library(readr)
library(tibble)
library(wbstats)
knitr::opts_chunk$set(dev = "svglite", fig.ext = ".svg")
```
## Fertility vs. mortality {.unnumbered}
So far we've focused on mortality. This week, we cover **fertility**. Some differences between these two processes:
```{r fertility_vs_mortality, echo=FALSE, message=FALSE, warning=FALSE}
tibble::tibble(
Mortality = c(
"Decrement process",
"Individuals exit population",
"Mode of exit is through death",
"Involves one person",
"Possible at any age"
),
Fertility = c(
"Increment process",
"Individuals enter population",
"Mode of entrance is through living individuals producing live births",
"Involves two people with opposite sex organs",
"Not possible before puberty or after menopause"
)
) %>%
DT::datatable(
rownames = FALSE,
options = list(
dom = "t",
ordering = FALSE,
columnDefs = list(list(width = "50%", targets = "_all"))
)
)
```
## Solving the two-body problem {.unnumbered}
* Human demographers most often focus on people with female sex organs
* Yet many population models (especially in biology) explicitly consider the interaction of people with opposite sex organs
* Due to the field's history and the limitations of institutional demographic data collection process, human demographers tend to conflate biological sex with gender identity
* Because the data commits this conflation, so do I, if for nothing else to inspire people to fix institutions and data to better match the complexities of sex and gender
## Important fertility and reproduction definitions {.unnumbered}
* **Fertility** - The production of live offspring measured in count of offspring
* **Fecundity** - The biological capacity to reproduce
:::{.rmdcaution}
**Annoying fact** - In biology and ecology, the definitions fertility and fecundity are *completely reversed*! Anyway, more definitions...
:::
* **Fecund** - Capable of conception (as opposed to *infecund* or *infertile*)
* **Fecundability** - The *monthly* or *cycle-specific* probability of conception, given "exposure" to risk of pregnancy
* Human demographers' definition: Monthly probability of conception
* Physiologists' definition: Cycle-wise probability of conception (because menstrual cycles don't perfectly coincide with calendar months)
* Different definitions due to type of observations
* **Sterility** - Biologically unable to reproduce:
* *Primary* - lifetime sterility
* *Secondary* - Arising at reproductive ages
* **Parity** - The number of live offspring a women (or couple) has had (so far!)
* **Fetal loss** or **pregnancy loss** - Loss of any product of conception before birth
* *Embryonic loss* - prior to about 8 weeks
* *Miscarriage* or *spontaneous abortion* - loss before fetal viability
* *Stillbirth* - loss after fetal viability but before delivery
* *Induced abortion*
## Reproductive life history {.unnumbered}
![From Darryl Holman's Winter Quarter 2021 SOC 533 A notes](images/reproductive-life-history.png){width=100%}
:::{.rmdtip}
**DEMOGRAPHY & DATA SCIENCE**
## Some weak analogues for fertility and reproduction {.unnumbered}
**People analytics**
* Employee referrals, where current employees refer potential employees for consideration
* Job openings generated from a pre-existing job requisition
**Customer analytics**
* Customer referrals, where existing customers refer a product to a potential customer
:::
## Period fertility rates
### Crude birth rates {.unnumbered}
Recall from week 1:
$$\begin{align}
CBR[0,T] &= \frac{\textsf{Number of births between times } 0 \textsf{ and } T}
{\textsf{Person-years lived between times } 0 \textsf{ and } T} \\
&= \frac{B[0,T]}{PY[0,T]}
\end{align}$$
Below is chart of the distribution of national CBRs through time^[Based on data from the World Back Development Indicators: https://databank.worldbank.org/source/world-development-indicators]
<details>
<summary>What do you notice? **Tap for some answers**</summary>
* Persistently wide variation in national CBR
* CBR distribution decreasing over time
* CBR distribution is also bimodal
* From 2000 through 2019, normal range of CBR from ~10 to ~50
</details>
```{r wbi_cbr_data, cache = TRUE, echo=FALSE, message=FALSE, warning=FALSE}
wbi_cbr <- "SP.DYN.CBRT.IN" %>%
wbstats::wb_data(indicator = ., start_date = 2000, end_date = 2019) %>%
dplyr::rename(cbr = `SP.DYN.CBRT.IN`)
```
```{r wbi_cbr_plot, echo=FALSE, message=FALSE, warning=FALSE, width=600}
ggplot2::ggplot(wbi_cbr) +
ggridges::geom_density_ridges(
aes(x = cbr, y = factor(date, levels = rev(unique(date)))),
quantile_lines = TRUE,
quantiles = c(0.025, 0.5, 0.975),
alpha = 0.7
) +
ggplot2::scale_x_continuous(expand = c(0, 0)) +
ggplot2::scale_y_discrete(expand = c(0, 0)) +
ggplot2::coord_cartesian(clip = "off") +
ggplot2::labs(
title = "Distribution of annual national CBR per 1,000 person-years",
subtitle = "Vertical lines are median and empirical 95% interval",
x = NULL,
y = NULL,
caption = "Source: Complete Human Fertility Database"
) +
ggridges::theme_ridges() +
ggplot2::theme(panel.grid = element_blank())
```
<details>
<summary>What's wrong with person-years in the CBR denominator? **Tap for answer**</summary>
Includes all population person-years, including from people not at risk of a live birth, such as:
* People without female sex organs
* People with female sex organs who haven't reached "reproductive age"
* People with female sex organs who are beyond "reproductive age"
For some research questions, the person-years of interest might also exclude:
* People with female sex organs who have primary or secondary sterility
</details>
<br>
<details>
<summary>Despite this issue, why is CBR so frequently used? **Tap for answer**</summary>
* Doesn't require person-years to be dis-aggregated by sex or reproductive status
* Important component of the period crude growth rate (CGR)
</details>
<br><br>
### General fertility rates {.unnumbered}
Attempting limit person-years to a more relevant set than the CBR, the **General Fertility Rate** (GFR):
$$\begin{align}
GFR[0,T] = \frac{\textsf{Number of births between times } 0 \textsf{ and } T}
{\textsf{Person-years lived in the period } 0 \textsf{ and } T \textsf{ by women aged } \alpha \textsf{ to } \beta}
\end{align}$$
where ages $\alpha$ to $\beta$ form the **reproductive age** range.
Let's interrogate this passage from PHG pg. 93:
> The CBR only loosely approximates an occurrence/exposure fertility rate because only women in their reproductive ages can actually give birth. The length of the reproductive life span varies from one woman to another but, in most settings, the vast majority of births occurs to women aged 15 to 50.
```{r hfd_data, echo=FALSE, message=FALSE, warning=FALSE, cache=TRUE}
read_hfd_country <- function(CNTRY, item) {
HMDHFDplus::readHFDweb(
CNTRY = CNTRY,
item = item,
username = keyring::key_list("human-fertility-database")$username,
password = keyring::key_get(
service = "human-fertility-database",
username = keyring::key_list("human-fertility-database")$username
)
)
}
countries_hfd <- HMDHFDplus::getHFDcountries()
asfr <- countries_hfd %>%
# Returns a list of data.frames, adding a column for country code to each
purrr::map(function(country) {
read_hfd_country(country, "asfrRR") %>%
dplyr::mutate(country = country)
}) %>%
# Combines the data.frames into a single data.frame
dplyr::bind_rows()
births <- countries_hfd %>%
# Returns a list of data.frames, adding a column for country code to each
purrr::map(function(country) {
read_hfd_country(country, "birthsRR") %>%
dplyr::mutate(country = country)
}) %>%
# Combines the data.frames into a single data.frame
dplyr::bind_rows()
exposure <- countries_hfd %>%
# Returns a list of data.frames, adding a column for country code to each
purrr::map(function(country) {
read_hfd_country(country, "exposRR") %>%
dplyr::mutate(country = country)
}) %>%
# Combines the data.frames into a single data.frame
dplyr::bind_rows()
totbirths <- countries_hfd %>%
# Returns a list of data.frames, adding a column for country code to each
purrr::map(function(country) {
read_hfd_country(country, "totbirthsRR") %>%
dplyr::mutate(country = country)
}) %>%
# Combines the data.frames into a single data.frame
dplyr::bind_rows()
```
```{r hmd_tot_pop_data, cache = TRUE, echo=FALSE, message=FALSE, warning=FALSE}
read_hmd_country <- function(CNTRY, item) {
HMDHFDplus::readHMDweb(
CNTRY = CNTRY,
item = item,
username = keyring::key_list("human-mortality-database")$username,
password = keyring::key_get(
service = "human-mortality-database",
username = keyring::key_list("human-mortality-database")$username
)
)
}
countries_hmd <- HMDHFDplus::getHMDcountries()
totpop <- countries_hmd %>%
# Returns a list of data.frames, adding a column for country code to each
purrr::map(function(country) {
read_hmd_country(country, "Population") %>%
dplyr::mutate(country = country)
}) %>%
# Combines the data.frames into a single data.frame
dplyr::bind_rows() %>%
# Avg. beginning- and end-of-year population size estimates
dplyr::mutate(female = 0.5 * (Female1 + Female2),
male = 0.5 * (Male1 + Male2),
total = 0.5 * (Total1 + Total2))
```
Below are the annual national age-specific fertility rates below age 15 and above age 50 for all years and countries in the Human Fertility Database^[https://www.humanfertility.org]:
```{r asfr_below15_above50, echo=FALSE, warning=FALSE, message=FALSE}
asfr %>%
dplyr::mutate(country_year = paste(country, Year)) %>%
ggplot2::ggplot() +
ggplot2::aes(x = Age, y = ASFR * 1000, group = country_year) +
ggplot2::geom_line(alpha = 0.05) +
ggplot2::geom_vline(xintercept = 15) +
ggplot2::geom_vline(xintercept = 50) +
ggplot2::scale_x_continuous(breaks = c(15, 50)) +
ggplot2::labs(
title = "Age-specific fertility rate (per 1K person-years) by country-year",
subtitle = "Vertical lines at PHG-assumed reprocutive years 15 through 50",
x = "1-year age group",
y = NULL,
caption = "Source: Complete Human Fertility Database"
) +
ggplot2::theme_minimal() +
ggplot2::theme(panel.grid = element_blank())
```
```{r pbirths_repro_age, echo=FALSE, warning=FALSE, message=FALSE}
pbirths_ab <- function(a, b) {
births %>%
dplyr::filter(Age >= a, Age < b) %>%
dplyr::group_by(country, Year) %>%
dplyr::summarize(births = sum(Total)) %>%
dplyr::ungroup() %>%
dplyr::left_join(totbirths) %>%
dplyr::mutate(pbirths = births / Total) %>%
dplyr::pull(pbirths)
}
pbirths_15_50 <- pbirths_ab(15, 50)
q_pbirths_15_50 <- quantile(pbirths_15_50, c(0.025, 0.975))
```
<details>
<summary>What percentage of all country-years in the Human Fertility Database had over 99% of their births occur between ages 15 and 50? **Tap for answer**</summary>
* `r scales::percent(mean(pbirths_15_50 > 0.99), accuracy = 1L)` of `r format(length(pbirths_15_50), big.mark = ",")` country-years from `r length(unique(births$country))` countries between `r min(births$Year)` and `r max(births$Year)` (not all years represented for all countries)
* The empirical 95% interval of births between 15 and 50 as a percentage of total births lies between -- get this -- `r scales::percent(q_pbirths_15_50[1], accuracy = 0.000001)` and `r scales::percent(q_pbirths_15_50[2], accuracy = 0.000001)`
</details>
<br>
#### Relation between CBR and GFR {.unnumbered}
$$
CBR[0,T] = GFR[0,T] \cdot {}_{\beta - n}C_\alpha^F[0,T]
$$
where ${}_{\beta - n}C_\alpha^F[0,T]$ is the proportion of person-years lived among women in the exact reproductive age range $\alpha$ to $\beta$.
Thus:
$$
GFR[0,T] = CBR[0,T] \cdot \frac{1}{{}_{\beta - n}C_\alpha^F[0,T]}
$$
PHG pg. 94 writes (adopting $\alpha = 15$ and $\beta = 50$):
> ... [${}_{35}C_{15}^F$] [sic] varies relatively litte across populations, even with quite different demographic regimes. Comparing GFRs across populations often provides little additional insight relative to a comparison of CBRs, a measure more readily available.
**Mathematical justification for this statement**: Suppose two populations, $A$ and $B$, have constant ${}_{\beta - n}C_\alpha^F = C$.
* Difference in CBRs: $\Delta_{CBR} = CBR(A) - CBR(B)$
* Difference in GFRs: $\Delta_{GFR} = GFR(A) - GFR(B) = \frac{1}{C} \left(CBR(A) - CBR(B)\right)$
* Thus $\Delta_{CBR} \propto \Delta_{GFR}$
* Preserves the rank ordering of the populations by period birth rate
* If you know typical $C$, just divide $\Delta_{CBR}$ by it to approximate $\Delta_{GFR}$
**Empirical justification**: Let's assess how well the mathematical justification for relying on CBR matches reality.
*Question 1:* Does CBR rank preserve GFR rank?
Below is a table comparing CBR, GFR, and ${}_{35}C_{15}^F$ for 10 country-years randomly selected from the Human Fertility Database^[Data comes from (1) average of start and end population counts from Human Mortality Database (https://www.mortality.org/), and (2) total birth counts from Human Fertility Database (https://www.humanfertility.org/).]. Each country is ranked by both CBR and GFR. This is similar to how PHG answer the question on pg. 94.
```{r cbr_gfr_data, echo=FALSE, warning=FALSE, message=FALSE}
cbr_gfr <- totpop %>%
dplyr::group_by(country, Year) %>%
dplyr::summarize(
totpop = sum(total),
repropop = sum(female * (Age >= 15 & Age < 50))
) %>%
dplyr::ungroup() %>%
dplyr::mutate(c_ab = repropop / totpop) %>%
dplyr::inner_join(totbirths %>% dplyr::rename(totbirths = Total)) %>%
dplyr::mutate(
country_year = paste(country, Year),
cbr = totbirths / totpop,
gfr = totbirths / repropop
)
```
```{r, cbr_gfr_table, echo=FALSE, message=FALSE, warning=FALSE}
cbr_gfr %>%
dplyr::filter(country_year %in% sample(.$country_year, size = 10)) %>%
dplyr::mutate_at(vars(totpop, repropop, totbirths), ~ . / 1000) %>%
dplyr::select(country, Year, c_ab, cbr, gfr) %>%
dplyr::arrange(desc(cbr)) %>%
dplyr::mutate(cbr_rank = row_number()) %>%
dplyr::arrange(desc(gfr)) %>%
dplyr::mutate(gfr_rank = row_number()) %>%
dplyr::arrange(cbr_rank) %>%
DT::datatable(
rownames = FALSE,
colnames = c(
"Country",
"Year",
"% of total person-years lived by women aged 15-49",
"CBR",
"GFR",
"CBR rank",
"GFR rank"
),
options = list(dom = "T", ordering = FALSE)
) %>%
DT::formatRound(columns = 3:5, digits = 2)
```
* Seems to work okay?
* But that's just 10 country-years, whereas PHG claim CBR rank is mostly preserved even across populations "with quite different demographic regimes" (PHG pg. 94)
* Rank statistics have low statistical power
* Let's use a bigger sample size of all country-years available
* Let's plot GFR rank against CBR rank and comparing to a line of perfect match
* Let's calculate rank correlation coefficients, too
```{r gfr_vs_cbr_rank_comparison, echo=FALSE, message=FALSE, warning=FALSE, fig.height=50, fig.asp=1}
cbr_gfr_rho <- cor(cbr_gfr$cbr, cbr_gfr$gfr, method = "spearman")
cbr_gfr_tau <- cor(cbr_gfr$cbr, cbr_gfr$gfr, method = "kendall")
cbr_gfr %>%
dplyr::arrange(desc(gfr)) %>%
dplyr::mutate(gfr_rank = row_number()) %>%
dplyr::arrange(desc(cbr)) %>%
dplyr::mutate(cbr_rank = row_number()) %>%
ggplot2::ggplot() +
ggplot2::aes(x = cbr_rank, y = gfr_rank) +
ggplot2::geom_point(alpha = 0.5) +
ggplot2::geom_abline(intercept = 0, slope = 1, color = "lightgray") +
ggplot2::labs(
title = paste(
"GFR rank vs. CBR rank for",
format(nrow(cbr_gfr), big.mark = ","),
"country-years"
),
subtitle = "Source: Human Mortality Database and Human Fertility Database",
x = "CBR rank",
y = "GFR rank"
) +
ggplot2::annotate(
"text",
x = 0, y = 2500,
label = paste("Spearman's \u03c1 =", round(cbr_gfr_rho, 2), "so..."),
hjust = 0
) +
ggplot2::annotate(
"text",
x = 0, y = 2250,
label = paste(
scales::percent(round(cbr_gfr_rho^2, 2)),
"of variance in GFR rank explained by CBR rank"
),
hjust = 0
) +
ggplot2::annotate(
"text",
x = 0, y = 1750,
label = paste("Kendall's \u03c4 =", round(cbr_gfr_tau, 2), "so..."),
hjust = 0
) +
ggplot2::annotate(
"text",
x = 0, y = 1250,
label = paste(
scales::percent(1 - round(cbr_gfr_tau, 2)),
"chance that CBR ordering\n",
"differs from GFR ordering\n",
"for a random pair of\n",
"country-years"
),
hjust = 0
) +
ggplot2::theme_minimal() +
ggplot2::theme(panel.grid = element_blank(),
axis.title.y = element_text(angle = 0))
```
*Question 2:* Is assuming a constant ${}_{\beta - n}C_{\alpha}$ reasonable?
```{r c_ab_summary, echo=FALSE, warning=FALSE, message=FALSE}
c_ab_quantiles <- quantile(cbr_gfr$c_ab, probs = c(0.025, 0.975))
c_ab_mean <- mean(cbr_gfr$c_ab)
gfr_vs_gfr_estc <- cbr_gfr %>%
dplyr::mutate(
gfr_estc = cbr / c_ab_mean,
error = gfr_estc - gfr,
error_ratio = gfr_estc / gfr
)
q_error <- quantile(abs(gfr_vs_gfr_estc$error), probs = c(0.025, 0.975))
q_error_ratio <- quantile(gfr_vs_gfr_estc$error_ratio, probs = c(0.025, 0.975))
```
* Across country-years, the empirical 95% interval of ${}_{35}C_{15}$ across country-years lies between `r scales::percent(c_ab_quantiles[1], accuracy = 1L)` and `r scales::percent(c_ab_quantiles[2], accuracy = 1L)`.^[Again, data comes from (1) average of start and end population counts from Human Mortality Database (https://www.mortality.org/), and (2) total birth counts from Human Fertility Database (https://www.humanfertility.org/).]
* Average ${}_{35}C_{15}$ was `r scales::percent(c_ab_mean, accuracy = 1L)`
* Below is a plot of GFR estimated as $GFR_{estC} = CBR \div$ `r round(c_ab_mean, 2)`
* Empirical 95% interval of the absolute error lies between `r round(q_error[1], 2)` and `r round(q_error[2], 2)`
* Empirical 95% interval of the ratio of $GFR_{estC}$ to $GFR$ lies between `r round(q_error_ratio[1], 2)` and `r round(q_error_ratio[2], 2)`
* Depending on available data and desired accuracy, constant $C$ assumption could be reasonable... or god-awful
```{r c_ab_comparson_plot, echo=FALSE, message=FALSE, warning=FALSE, fig.height=50, fig.asp=1}
gfr_vs_gfr_estc %>%
ggplot2::ggplot() +
ggplot2::aes(x = gfr_estc, y = gfr) +
ggplot2::geom_point(alpha = 0.5) +
ggplot2::geom_abline(intercept = 0, slope = 1, color = "lightgray") +
ggplot2::labs(
title = "Actual GFR compared to GFR estimated from CBR and average C",
x = latex2exp::TeX("$GFR_{estC} = CBR \\div C$"),
y = "Actual GFR"
) +
ggplot2::theme_minimal() +
ggplot2::theme(panel.grid = element_blank(),
axis.title.y = element_text(angle = 0))
```
### Age-specific fertility rates {.unnumbered}
We've already encountered the age-specific fertility rate (ASFR) in [week 2](#age-specific-rates-and-probabilities) and our discussion this week about reproductive ages:
$$
{}_{n}F_x[0,T] = \frac{
\textsf{Births in the period } 0 \textsf{ to } T
\textsf{ to women aged } x \textsf{ to } x+n
}{
\textsf{Person-years lived in the period } 0 \textsf{ to } T
\textsf{ by women aged } x \textsf{ to } x+n
}
$$
### Age-standardized crude birth rates {.unnumbered}
Just as we discussed about crude death rates during [week 2](#age-specific-rates-and-probabilities) about [age-standardization](#age-standardization), we can construct an age-standardized crude birth rate (ASCBR):
$$
ASCBR[0,T] = \sum_{i} F_i \cdot C_i^S
$$
where reproductive age intervals are indexed by $i$ and $C_i^S$ is the proportion of total person-years (often approximated by population count) in age interval $i$ lived by women
### Total fertility rates {.unnumubered}
* Recall from [week 2](#age-specific-rates-and-probabilities) that the choice of standard population $S$ is crucial but arbitrary
* Demographers avoid this problem AND the choice of reproductive age range end-points by:
* Giving every age interval equal weight
* Choosing $\alpha$ and $\beta$ as the min. and max. ages at child-rearing in a population
* This equally-weighted measure is called the Total Fertility Rate (TFR)
$$
TFR[0,T] = n \cdot \sum_{x=\alpha}^{\beta - n} {}_{n}F_x[0,T]
$$
:::{.rmdimportant}
**KEY INSIGHTS**
The **total fertility rate** TFR is one of the most (*the* most?) important indicators of fertility because:
* It avoids the thorny issues of age-standardization, and potentially reproductive age range definition, too
* It is interpreted as the average number of children a woman would bear if they survived through the end of reproductive age and experienced at each age a particular set of age-specific fertility rates (ASFRs)
:::
### Comparison of TFR to CBR {.unnumbered}
* CBR and ASCBR both weight ASFR by population structure ${}_{n}C_x$
* Most population structure are weighted toward younger ages
* Therefore younger age groups get more weight
* TFR gives equal weight to all age groups
* Therefore:
* TFR more responsive than CBR to fertility changes later in reproductive lifespan
* CBR more responsive than TFR to fertility changes earlier in life
### Parity-specific fertility rate {.unnumbered}
Often-times we want to know the fertility rate among women have have a given **parity** (number of live births so far), thus:
$$
F_p[0,T] = \frac{
\textsf{Births in the period } 0 \textsf{ to } T
\textsf{ to women at parity } p
}{
\textsf{Person-years in the period } 0 \textsf{ to } T
\textsf{ lived by women at parity } p
}
$$
You could make this parity-specific rate age-specific, too, of course.
### Martital fertility rates {.unnumbered}
Because reproduction used to be more closely tied to marriage, demographers have studied the **age-specific marital fertility rate**:
$$
{}_{n}F_x^L[0,T] = \frac{
\textsf{Births in the period } 0 \textsf{ to } T
\textsf{ to married women}
}{
\textsf{Person-years in the period } 0 \textsf{ to } T
\textsf{ lived by married women}
}
$$
From this comes the martial analogue to the TFR, the **Total Marital Fertility Rate** (TMFR):
$$
TMFR[0,T] = n \cdot \sum_{x=\alpha}^{\beta - n} {}_{n}F_x^L[0,T]
$$
If there are no births out of wedlock (LOL), ${}_{n}F_x = {}_{n}F_x^L \cdot {}_{n}\Phi_x$, where ${}_{n}\Phi_x$ is proportion of women ages $x$ to $x+n$ who are married. Thus (assuming one-year age groups and dropping $[0,T]$ for simplicity):
$$\begin{align}
\frac{TFR}{TMFR}
&= \frac{
n \cdot \sum_{x=\alpha}^{\beta} {}_{n}F_x^L \cdot {}_{n}\Phi_x
}{
n \cdot \sum_{x=\alpha}^{\beta} {}_{n}F_x^L
} \\
&= \sum_{x=\alpha}^\beta \left(
\frac{{}_{n}F_x^L}{\sum_{x=\alpha}^{\beta} {}_{n}F_x^L}
\right) \cdot {}_{n}\Phi_x
\end{align}$$
This is a fertility-weighted average of the proportion of women married by age.
Wait a minute... why are we so hung up on marriage again?
```{r out_of_wedlock_plot, echo=FALSE, message=FALSE, warning=FALSE}
"data/NCHS_-_Births_to_Unmarried_Women_by_Age_Group__United_States.csv" %>%
readr::read_csv() %>%
dplyr::group_by(Year) %>%
dplyr::summarize(oow_births = sum(`Number of Births`)) %>%
dplyr::ungroup() %>%
dplyr::inner_join(totbirths %>% dplyr::filter(country == "USA")) %>%
dplyr::mutate(p_oow = oow_births / Total) %>%
ggplot2::ggplot() +
ggplot2::aes(x = Year, y = p_oow) +
ggplot2::geom_line() +
ggplot2::scale_y_continuous(labels = scales::percent) +
ggplot2::labs(
title = "U.S. share of births born out of wedlock (1940 - present)",
subtitle = "Hrmmmmmmmmmmm",
x = "Calendar year",
y = "Share born\nout of wedlock"
) +
ggplot2::theme_minimal() +
ggplot2::theme(panel.grid = element_blank(),
axis.title.y = element_text(angle = 0))
```
<details>
<summary>What are some ways to make these marital fertility rates more modern and more applicable to populations where reproduction is not so closely tied with marriage (including the U.S. for much of its recent history, apparently)? **Tap for answer**</summary>
* Replace "married" with "sexually active with at least one person who has male sex organs"
* Replace "women" with "people with female sex organs"
</details>
<details>
<summary>How would we define these more modern equivalents to ASMFR and TMFR? **Tap for answer**</summary>
* Age-specific sexually-active fertility rate (ASSFR?)
* Total sexually-active fertility rate (TSFR?)
</details>
<details>
<summary>How would interpret the ratio of TFR to this more modern analogue to TMFR? **Tap for answer**</summary>
Fertility-weighted average of the age-specific proportion of people with female sex organs who are sexually active with at least one person with male sex organs
</details>
<details>
<summary>What are some challenges to applying these more modern definitions? **Tap for answer**</summary>
* Easier to measure marital status than sexual activity at scale
* Most vital statistics conflate biological sex and gender identity
</details>
<br>
## Decomposition of period fertility
To better understand fertility patterns, demographers decompose fertility into its **proximate determinants**:
![From Darryl Holman's Winter 2021 SOC 533 A notes](images/proximate-fertility-factors.png){width=50%}
### Bongaarts proximate fertility determinants framework {.unnumbered}
PHG focuses on Bongaarts' [-@bongaarts1978framework] proximate fertility determinants framework, which works like this:
$$
\require{cancel}
\textsf{Multiply TFR by terms that cancel out but also have useful interpretations:} \\
\begin{align}
TFR
&= \color{dodgerblue}{\frac{TFR}{\bcancel{TMFR}}}
\cdot \color{darkorange}{\frac{\bcancel{TMFR}}{\bcancel{TNFR}}}
\cdot \color{blueviolet}{\frac{\bcancel{TNFR}}{\bcancel{MTFR}}}
\cdot \color{limegreen}{\bcancel{MTFR}}
\\
\hline
&\textsf{Let's interpret each of those new product terms:} \\
&= \color{dodgerblue}{
\frac{TFR}{TMFR}: \begin{cases}
&\textsf{Fertility-weighted average proportion} \\
&\textsf{of women who are in a sexual union.}
\end{cases}
} \\
&\times \color{darkorange}{
\frac{TMFR}{TNFR}: \begin{cases}
&\textsf{Ratio of total "marital" fertility rate to} \\
&\textsf{it's expected value among women who use no} \\
&\textsf{contraception or induced abortion; this is} \\
&\textsf{called the Total Natural Fertility Rate (TNFR)}
\end{cases}
} \\
&\times \color{blueviolet}{
\frac{TNFR}{MTFR}: \begin{cases}
&\textsf{Ratio of TNFR to the Maximal Total Fertility Rate (MTFR),} \\
&\textsf{i.e. the TNFR achieveable when individuals with mammary} \\
&\textsf{glands don't reduce their fecundability by nursing infants}
\end{cases}
} \\
&\times \color{limegreen}{MTFR}
\\
\hline
&\textsf{Now let's convert those terms into coefficients we can estimate:} \\
&= \color{limegreen}{
MTFR: \begin{cases}
&\textsf{Maximal Total Fertility Rate...}
\end{cases}
} \\
&\times \color{dodgerblue}{C_m}
\cdot \color{darkorange}{\left(C_c \cdot C_a\right)}
\cdot \color{blueviolet}{C_i}: \begin{cases}
&\textsf{... gets multiplied by coefficients between 0 and 1} \\
&\textsf{that discount it down to the observed TFR}
\end{cases}
\\
\hline
&\textsf{Lastly, let's interpret those coefficients and estimate them:} \\
&= \color{limegreen}{MTFR} \\
&\times \color{dodgerblue}{
C_m: \begin{cases}
&\underline{\textbf{Coefficient of non-union}} \\
&\textsf{Estimated as TFR/TMFR}
\end{cases}
} \\
&\times \color{darkorange}{
C_c: \begin{cases}
&\underline{\textbf{Coefficient of contraception}} \\
&\textsf{Empirically estimated as } 1 - 1.08 \cdot u \cdot e \\
&\textsf{where } u \textsf{ is proportion of women using contraception} \\
&\textsf{and } e \textsf{ is average use-effectiveness of contraception} \\
&\textsf{and 1.08 upweights } u \cdot e \textsf{ to account for sterile couples} \\
&\textsf{not using contraception because they know they're not at risk}
\end{cases}
} \\
&\times \color{darkorange}{
C_a: \begin{cases}
&\underline{\textbf{Coefficient of abortion}} \\
&\textsf{Estimated as } \frac{TFR}{
TFR + 0.4 \times (1+u) \times TA
} \\
& \textsf{where:} \\
& \begin{align}
&\unicode{x2022} \textsf{ } TA \textsf{
is the total abortion rate construction similarly to TFR
} \\
&\unicode{x2022} \textsf{ } 0.4 \times (1+u) \textsf{
reflects the number of births averted by one abortion
}
\end{align} \\
&\textsf{The figure 0.4 assumes that an abortion use up} \\
&\textsf{40% of the reproductive life than a birth does}
\end{cases}
} \\
&\times \color{blueviolet}{
C_i: \begin{cases}
&\underline{\textbf{Coefficient of post-partum infecundity}} \\
&\textsf{Estimated as } \frac{20}{18.5 + i} \\
&\textsf{ where } i \textsf{ is length of post-partum infecundity.} \\
&\textsf{If } i = 1.5 \textsf{, three's no reduction to MTFR.} \\
&\textsf{If } i \textsf{ can't be measured, it's estimated as:} \\
&i = 1.753 \cdot e^{0.1396 \cdot BF - 0.001872 \cdot BF^2} \\
&\textsf{where } BF \textsf{ is the average months of breastfeeding}
\end{cases}
}
\\
\hline
&\textsf{And putting it all together with substitutions:} \\
&= \color{limegreen}{MTFR} \\
&\times \color{dodgerblue}{\frac{TFR}{TMFR}} \\
&\times \color{darkorange}{
\left(1 - 1.08 \cdot u \cdot e\right)
\cdot \frac{TFR}{ TFR + 0.4 \times (1+u) \times TA}
} \\
&\times \color{blueviolet}{
\frac{20}{
18.5 + 1.753 \cdot e^{0.1396 \cdot BF - 0.001872 \cdot BF^2}
}
}
\end{align}
$$
Bongaarts assumed that MTFR was 15.3 based on some back-of-the-envelope assumptions about inter-birth intervals.
<details>
<summary>How could you estimate $e$, the use-effectiveness of contraception? **Hint:** You could use a method we learned last week! **Tap for answer**</summary>
* A cause-deleted life table where the focal risk is contraceptive failure and the competing risk is discontinuation of contraception.
* See PHG box 5.3 pg. 102 for a hypothetical example.
* See below for typical 12-month contraceptive failure probabilities.
![From Polis et. al^[https://www.guttmacher.org/report/contraceptive-failure-rates-in-developing-world]](https://www.guttmacher.org/sites/default/files/images/confailuresreportfigure15.png){width=75%}
:::{.rmdcaution}
Careful here: Polis et. al [-@polis2016typical] use the term *contraceptive failure rate* describe the **probability** of failure within 12 months. By "rate" they mean "per 100 episodes" of a given length (in this case 12 months)
:::
</details>
<br>
### Updates to Bongaarts' framework and alternative frameworks
* Bongaarts proximate determinants framework above was recently updated by Bongaarts [-@bongaarts2015modeling]
* Wood [-@wood1990fertility] offers a bioanthropological perspective
## Cohort fertility
<details>
<summary>For 1-year age groups, what do a cohort's age-specific fertility rates over their entire reproductive lifespan sum up to? **Tap for answer**</summary>
Cohort TFR! Also known as:
* Cohort fertility rate
* Mean completed family size
</details>
<br>
<details>
<summary>What can cause a cohort TFR to differ from a period TFR? **Tap for answer**</summary>
* Changes in period fertility rates over time
* Changes in the age pattern of fertility over time
PHG pg. 103 Table 5.3 shows an example where period TFR changes but cohort TFR remains the same due to changes in a cohort's timing of births.
</details>
### Parity progression ratios {.unnumbered}
Aside from tracking cohort fertility across age, you can track how cohort fertility progresses from one child to the next with **parity progression ratios** (PPRs):
$$
PPR_{\left(i, i+1\right)} = \frac{
\textsf{Number of women at parity } i + 1 \textsf{ or more}
}{
\textsf{Number of women at parity } i \textsf{ or more}
} = \frac{P_{i+1}}{P_i} = \frac{
\sum_{a = i+1}^{max(\textsf{parity})} W_a
}{
\sum_{a = i}^{max(\textsf{parity})} W_a
}
$$
* $W_i$ is the number of women in the cohort with completed parity $i$
* A PPR is interpreted as the proportion in a cohort with $i$ children who go on to have $i+1$ children
* The "or more" comes from the fact that cohort PPR is calculated using parity-specific counts from a cohort that has completed their reproductive lifespan
### PPR patterns in "natural" vs. "controlled" fertility populations {.unnumbered}
* In contraceptive-using populations, PPR dips sharply then flattens due to decision-making around desired family size
* In natural fertility populations, PPR dips more gradually since completed family size decision-making doesn't factor into fertility as much
![From Wood [-@wood1994maternal]](images/ppr-norway-us.png){width=75%}
### TFR as a function of PPRs {.unnumbered}
It turns out that for cohort TFR denoted $TFR^C$:
$$\begin{align}
TFR^C
&= PPR_{(0,1)} \textsf{ (Completed fertility if have 1 kid)}\\
&+ PPR_{(0,1)} \cdot PPR_{(1,2)} \textsf{ (Added fertility if I had 1 kid and then go on to have 2 kids)} \\
&+ PPR_{(1,2)} \cdot PPR_{(2,3)} \textsf{ (Added fertility if I had 2 kids and go on to have 3 kids)} \\
&+ ... \textsf{ (And so on until maximal parity in the cohort)}
\end{align}$$
This is important because sometimes all you have to calculate $TFR^C$ is responses to a survey of completed fertility summarized as counts by parity, as opposed to the individual-level responses
### Parity from the child's vs. the mother's perspective {.unnumbered}
Consider two methods of estimating parity:
1. Survey people with female sex organs about their number of live births. Denote average parity measured from their perspective as $\overline{P}$.
2. Survey people about the number of live births that came from the same womb they did. Denote the average parity measured from the child's perspective as $\overline{C}$.
It turns out that:
$$
\overline{C} = \overline{P} + \frac{\sigma^2}{\overline{P}}
$$
where $\sigma^2$ is the variance in parity among individual people with female sex organs.
<details>
<summary>What does this equation tell us about the consequences of measuring parity from a survey of children about their parent's parity? **Tap for answer**</summary>
* If there is any parity variation, $\overline{C} > \overline{P}$ and $\overline{C}$ over-estimates parity
* The greater the variation in parity, the greater the bias
</details>
<br>
<details>
<summary>What might this equation tell us about how our communication with other people influences our *perception* of average fertility in a previous generation? **Tap for answer**</summary>
Suppose that when you talk about the previous generation's fertility, you listen to that generation about how many kids they had $a \times 100$ percent of the time, and to people in your generation about how many kids their parents had $b \times 100 = (1-a) \times 100$ percent of the time.
Your perception of the average parity in the previous generation is:
$$
(1-b) \cdot \overline{P}
+ b \cdot \left(\overline{P} + \frac{\sigma^2}{\overline{P}}\right)
= \overline{P} + b \cdot \frac{\sigma^2}{\overline{P}}
$$
The more attention $b$ you pay to your own generation, the more upwardly biased your perception of the parity in your parent's generation.
</details>
<br>
:::{.rmdtip}
**DEMOGRAPHY & DATA SCIENCE**
#### Biased egocentric network estimates from surveying people about friends {.unnumbered}
* If you end up working at a social media company, don't ever estimate the number of people's followers from the number of followers their followers have!
* Don't look at the friend counts of your friends' friends, because it will downwardly bias your perception of your own social network size
* Don't build products that let people to do that; oops, too late!
#### Biased team size estimates from survey people about their boss {.unnumbered}
* If you survey your coworkers about how big their manager's team size is, your estimate of average team size will be upwardly biased unless all teams have the same size
* Your coworker's team size is a metric specific to *their* experience within a team of that size, *not* of team sizes writ large
:::
## Birth interval analysis
![From Darryl Holman's Winter Quarter 2021 SOC 533 A notes](images/birth-intervals.png){width=100%}
:::{.rmdcaution}
* PHG use the word "month" a lot, e.g., "monthly probability or conception." Ugh.
* Let's use the word "cycle" instead, as in "menstrual cycle", since cycles don't perfectly coincide with calendar months (obviously)
:::
### Birth interval analysis with homogeneous fecundability {.unnumbered}
Let's start with a simple model of birth intervals where every couple is the same and (definitely contrary to fact) every couple is heterosexual.
Let $p$ be the homogeneous, time-invariant per-cycle fecundability (chance of conception during a single cycle).
<details>
<summary>What is one method to estimate fecundability that we've studied already? **Hint:** We studied it during week 3! **Tap for answer**</summary>
Single decrement table where the event of interest is conception and time is measured in cycles (or months, if you can't measure cycles directly)
</details>
<br>
<details>
<summary>What is the chance of waiting exactly two cycles until conception? **Hint:** Think of it like a weighted coin toss and use the basic rules of probability. **Tap for answer**</summary>
$(1-p) \cdot p$: Failed on the first cycle, conceived in the second cycle
</details>
<br>
<details>
<summary>Exactly three cycles? **Tap for answer**</summary>
$(1-p)^2 \cdot p$: Failed on the first two cycles, conceived in the third
</details>
<br>
<details>
<summary>Exactly $t$ cycles? **Tap for answer**</summary>
$(1-p)^{t-1} \cdot p$: Failed on the first $t-1$ cycles, conceived in the $t$^th^
This is a geometric distribution.
</details>
<br>
<details>
<summary>What is the expected waiting time to conception? To birth? **Tap for answer**</summary>
* $1/p$ cycles to conception (the mean of the geometric distribution)
* $1/p \textsf{ cycles} + 9 \textsf{ months}$ to birth
</details>
<br>
<details>
<summary>Suppose there is a period of $s_b$ cycles of post-partum non-susceptibility to the risk of conception. What is the expected waiting time to next birth after latest birth? **Tap for answer**</summary>
$\left(1/p + s_b\ \textsf{ cycles}\right) + 9 \textsf{ months}$
</details>
<br>
Moving our time units to months for notational simplicity, the TMFR divides the time left after a first birth by the average birth interval, then adds the first birth. Thus the TFR is:
$$
TFR = 1 + \frac{
\beta - \alpha - \left(\frac{1}{p} + 9\right)
}{
\frac{1}{p} + 9 + s_b
} = \frac{\beta - \alpha + s_b}{\frac{1}{p} + 9 + s_b}
= \frac{\beta - \alpha + s_b}{I_b}
$$
Above, $\beta$ and $\alpha$ are measured in months, not years.
Suppose (contrary to fact) that $\alpha_m$ the expected time until a person with female sex organs first initiates sexual activity with persons who have male sex organs. Then:
$$
TFR = \frac{\beta - \alpha_m + s_b}{I_b}
$$
Notice that this changes our interpretation of $p$, which before defining $a_m$ included the effects of waiting time to sexual activity.
Extending our model to include fetal loss:
* $s_w < s_b$ is the non-susceptible period after a pregnancy that leads to fetal loss
* $w$ is the probability that a conception leads to fetal loss
* So with probability $w$, an inter-birth interval is $(1/p) + s_w$
* With probability $w^{n}$, $n$ successive pregnancies end in fetal loss, increasing the birth interval by that same amount
Adding these birth interval increments to $I_b$ in the TMFR and TFR denominators and closing the sum:
$$
I_b = \frac{1}{p \cdot (1-w)} + 9 + s_b + \frac{s_w \cdot w}{1-w}
$$
Plug in the values $p = 0.2$, $w = 0.2$, $s_b = 7.5$, $s_w = 5$, $\beta = 45 \cdot 12$ and $\alpha_m = 15 \cdot 12$ into the TFR formula. You will get Bongaarts' $MTFR \approx 15.3$.
Now add contraceptive efficiency $e$. As a proportionate reduction to fecundity, it replaces $p$ in the equations above with $p \cdot (1-e)$. Not that this again would change the interpretation of the parameter $p$.
Now suppose contraceptive efficiency is $e = 0.9$ and $\alpha_m = 25 \cdot 12$. All else equal, TFR drops to 3.08.
### Heterogeneous fecundability {.unnumbered}