Demographic data base (Sweden 1760-1880), main models

Loading details

source("0__helpers.R")
opts_chunk$set(warning=TRUE, cache=F,tidy=FALSE,dev=c('png'),fig.width=20,fig.height=12.5)

make_path = function(file) {
    get_coefficient_path(file, "ddb")
}
# options for each chunk calling knit_child
opts_chunk$set(warning=FALSE, message = FALSE, echo = FALSE)

Analysis description

Data subset

The ddb.1 dataset contains only those participants where paternal age is known and the birthdate is between 1760 and 1880.

Model description

All of the following models have the following in common:

Estimation

We fit all models using brms v. 1.2.0, a Bayesian regression analysis statistical package. brms uses Stan, a probabilistic programming langugage to fit models using Hamiltonian Monte Carlo.

Covariates

In our main models we adjust for average paternal age in the family, birth cohort (birth years in five equally large bins), for male sex, for age at paternal and maternal loss (0-1, 2-5, 6-10, …, 41-45, 45+, unknown), for maternal age (bins of 14-20, 20-35 and 35-50), for the number of siblings, for the number of older siblings (0-5, 5+) and for being last born.

Model stratification

We added random intercepts for each family (father-mother dyad). We then controlled for the average paternal age in the family. Hence, the paternal age effects in the plot are split into those between families and those within families or between siblings. We are interested in the effect of paternal age between siblings, as this effect cannot be explained by e.g. genetic propensities of the father to reproduce late.

m1: No sibling comparison

Here, we ignore the pedigree structure of the data to see whether it matters for the estimation of the paternal age effect.

Model summary

Full summary

model_summary = summary(model, use_cache = FALSE, priors = TRUE)
print(model_summary)
##  Family: hurdle_poisson (log) 
## Formula: children ~ paternalage + birth_cohort + male + maternalage.factor + paternal_loss + maternal_loss + older_siblings + nr.siblings + last_born 
##          hu ~ paternalage + birth_cohort + male + maternalage.factor + paternal_loss + maternal_loss + older_siblings + nr.siblings + last_born
##    Data: model_data (Number of observations: 56663) 
## Samples: 6 chains, each with iter = 800; warmup = 300; thin = 1; 
##          total post-warmup samples = 3000
##    WAIC: Not computed
##  
## Priors: 
## b ~ normal(0,5)
## b_hu ~ normal(0,5)
## 
## Population-Level Effects: 
##                           Estimate Est.Error l-95% CI u-95% CI Eff.Sample
## Intercept                     1.34      0.06     1.23     1.45        140
## paternalage                   0.01      0.00     0.00     0.01       3000
## birth_cohort1750M1755        -0.09      0.10    -0.29     0.10        445
## birth_cohort1755M1760         0.11      0.08    -0.04     0.25        247
## birth_cohort1760M1765         0.19      0.06     0.06     0.32        187
## birth_cohort1765M1770         0.14      0.06     0.01     0.26        180
## birth_cohort1770M1775         0.12      0.07    -0.01     0.25        188
## birth_cohort1775M1780         0.09      0.06    -0.03     0.21        186
## birth_cohort1780M1785         0.18      0.06     0.06     0.31        168
## birth_cohort1785M1790         0.17      0.06     0.05     0.29        156
## birth_cohort1790M1795         0.08      0.06    -0.03     0.20        154
## birth_cohort1795M1800         0.10      0.06     0.00     0.22        144
## birth_cohort1800M1805         0.05      0.06    -0.06     0.16        139
## birth_cohort1805M1810         0.07      0.06    -0.04     0.18        137
## birth_cohort1810M1815         0.08      0.06    -0.03     0.19        132
## birth_cohort1815M1820         0.15      0.05     0.04     0.26        129
## birth_cohort1820M1825         0.15      0.05     0.05     0.25        131
## birth_cohort1825M1830         0.11      0.05     0.01     0.22        131
## birth_cohort1830M1835         0.13      0.05     0.03     0.24        132
## birth_cohort1835M1840         0.12      0.05     0.02     0.23        133
## birth_cohort1840M1845         0.10      0.05     0.00     0.21        131
## birth_cohort1845M1850         0.11      0.05     0.01     0.22        130
## male1                         0.04      0.01     0.02     0.05       3000
## maternalage.factor1020        0.04      0.03    -0.01     0.09       3000
## maternalage.factor3559        0.06      0.01     0.05     0.08       3000
## paternal_loss01               0.08      0.03     0.03     0.14       3000
## paternal_loss15               0.02      0.02    -0.02     0.05       3000
## paternal_loss510             -0.02      0.02    -0.06     0.01       3000
## paternal_loss1015            -0.03      0.01    -0.06     0.00       3000
## paternal_loss1520            -0.07      0.01    -0.10    -0.05       3000
## paternal_loss2025            -0.03      0.01    -0.06    -0.01       3000
## paternal_loss2530            -0.02      0.01    -0.04     0.00       3000
## paternal_loss3035            -0.02      0.01    -0.04     0.00       3000
## paternal_loss3540             0.02      0.01     0.00     0.04       3000
## paternal_loss4045             0.02      0.01    -0.01     0.04       3000
## maternal_loss01               0.08      0.04    -0.01     0.16       3000
## maternal_loss15               0.03      0.02    -0.02     0.07       3000
## maternal_loss510             -0.02      0.02    -0.05     0.02       3000
## maternal_loss1015            -0.05      0.02    -0.08    -0.02       3000
## maternal_loss1520            -0.04      0.02    -0.07    -0.01       3000
## maternal_loss2025            -0.08      0.01    -0.10    -0.05       3000
## maternal_loss2530            -0.04      0.01    -0.07    -0.02       3000
## maternal_loss3035            -0.03      0.01    -0.05    -0.01       3000
## maternal_loss3540            -0.01      0.01    -0.03     0.01       3000
## maternal_loss4045            -0.02      0.01    -0.04     0.00       3000
## older_siblings1               0.00      0.01    -0.02     0.02       3000
## older_siblings2               0.00      0.01    -0.02     0.02       3000
## older_siblings3              -0.01      0.01    -0.03     0.01       2405
## older_siblings4              -0.04      0.01    -0.06    -0.01       3000
## older_siblings5P             -0.05      0.01    -0.08    -0.02       1975
## nr.siblings                   0.03      0.00     0.03     0.03       2567
## last_born1                   -0.01      0.01    -0.03     0.00       3000
## hu_Intercept                 -0.07      0.14    -0.35     0.22         77
## hu_paternalage               -0.04      0.01    -0.07    -0.01       2125
## hu_birth_cohort1750M1755      0.33      0.24    -0.14     0.82        675
## hu_birth_cohort1755M1760      0.11      0.19    -0.27     0.50        141
## hu_birth_cohort1760M1765      0.02      0.18    -0.33     0.37        132
## hu_birth_cohort1765M1770     -0.25      0.18    -0.59     0.10        124
## hu_birth_cohort1770M1775     -0.04      0.18    -0.38     0.31        131
## hu_birth_cohort1775M1780      0.11      0.16    -0.20     0.44        173
## hu_birth_cohort1780M1785      0.05      0.17    -0.28     0.37        115
## hu_birth_cohort1785M1790      0.16      0.15    -0.14     0.48        109
## hu_birth_cohort1790M1795      0.34      0.14     0.06     0.63         86
## hu_birth_cohort1795M1800      0.15      0.14    -0.12     0.44         83
## hu_birth_cohort1800M1805      0.11      0.14    -0.16     0.39         77
## hu_birth_cohort1805M1810      0.06      0.14    -0.22     0.34         79
## hu_birth_cohort1810M1815      0.15      0.14    -0.12     0.42         80
## hu_birth_cohort1815M1820     -0.02      0.13    -0.29     0.24         73
## hu_birth_cohort1820M1825     -0.12      0.13    -0.39     0.15         75
## hu_birth_cohort1825M1830     -0.12      0.13    -0.39     0.14         75
## hu_birth_cohort1830M1835     -0.10      0.13    -0.37     0.17         73
## hu_birth_cohort1835M1840     -0.11      0.13    -0.37     0.15         75
## hu_birth_cohort1840M1845     -0.09      0.13    -0.36     0.17         72
## hu_birth_cohort1845M1850     -0.07      0.13    -0.34     0.19         74
## hu_male1                      0.04      0.02     0.01     0.08       3000
## hu_maternalage.factor1020     0.04      0.08    -0.11     0.19       3000
## hu_maternalage.factor3559     0.07      0.02     0.02     0.12       2199
## hu_paternal_loss01            0.75      0.08     0.59     0.91       3000
## hu_paternal_loss15            0.59      0.05     0.49     0.69       3000
## hu_paternal_loss510           0.62      0.04     0.54     0.71       3000
## hu_paternal_loss1015          0.48      0.04     0.40     0.56       3000
## hu_paternal_loss1520          0.39      0.04     0.32     0.46       3000
## hu_paternal_loss2025          0.30      0.03     0.24     0.37       3000
## hu_paternal_loss2530          0.22      0.03     0.15     0.28       1644
## hu_paternal_loss3035          0.16      0.03     0.10     0.23       1748
## hu_paternal_loss3540          0.12      0.03     0.05     0.18       1731
## hu_paternal_loss4045          0.04      0.03    -0.02     0.11       3000
## hu_maternal_loss01            1.65      0.11     1.44     1.86       3000
## hu_maternal_loss15            0.88      0.06     0.77     1.00       3000
## hu_maternal_loss510           0.75      0.05     0.66     0.84       3000
## hu_maternal_loss1015          0.71      0.05     0.62     0.80       3000
## hu_maternal_loss1520          0.58      0.04     0.50     0.67       3000
## hu_maternal_loss2025          0.41      0.04     0.33     0.48       3000
## hu_maternal_loss2530          0.29      0.03     0.22     0.35       3000
## hu_maternal_loss3035          0.24      0.03     0.18     0.30       3000
## hu_maternal_loss3540          0.15      0.03     0.09     0.21       3000
## hu_maternal_loss4045          0.09      0.03     0.03     0.15       3000
## hu_older_siblings1           -0.01      0.03    -0.06     0.04       1773
## hu_older_siblings2            0.02      0.03    -0.03     0.08       1596
## hu_older_siblings3            0.04      0.03    -0.02     0.11       1261
## hu_older_siblings4            0.03      0.04    -0.05     0.11       1594
## hu_older_siblings5P          -0.02      0.04    -0.10     0.06       1229
## hu_nr.siblings                0.03      0.00     0.02     0.03       1794
## hu_last_born1                 0.00      0.02    -0.05     0.05       3000
##                           Rhat
## Intercept                 1.03
## paternalage               1.00
## birth_cohort1750M1755     1.01
## birth_cohort1755M1760     1.01
## birth_cohort1760M1765     1.02
## birth_cohort1765M1770     1.02
## birth_cohort1770M1775     1.02
## birth_cohort1775M1780     1.02
## birth_cohort1780M1785     1.02
## birth_cohort1785M1790     1.02
## birth_cohort1790M1795     1.02
## birth_cohort1795M1800     1.03
## birth_cohort1800M1805     1.03
## birth_cohort1805M1810     1.03
## birth_cohort1810M1815     1.03
## birth_cohort1815M1820     1.03
## birth_cohort1820M1825     1.03
## birth_cohort1825M1830     1.03
## birth_cohort1830M1835     1.03
## birth_cohort1835M1840     1.03
## birth_cohort1840M1845     1.03
## birth_cohort1845M1850     1.03
## male1                     1.00
## maternalage.factor1020    1.00
## maternalage.factor3559    1.00
## paternal_loss01           1.00
## paternal_loss15           1.00
## paternal_loss510          1.00
## paternal_loss1015         1.00
## paternal_loss1520         1.00
## paternal_loss2025         1.00
## paternal_loss2530         1.00
## paternal_loss3035         1.00
## paternal_loss3540         1.00
## paternal_loss4045         1.00
## maternal_loss01           1.00
## maternal_loss15           1.00
## maternal_loss510          1.00
## maternal_loss1015         1.00
## maternal_loss1520         1.00
## maternal_loss2025         1.00
## maternal_loss2530         1.00
## maternal_loss3035         1.00
## maternal_loss3540         1.00
## maternal_loss4045         1.00
## older_siblings1           1.00
## older_siblings2           1.00
## older_siblings3           1.00
## older_siblings4           1.00
## older_siblings5P          1.00
## nr.siblings               1.00
## last_born1                1.00
## hu_Intercept              1.07
## hu_paternalage            1.00
## hu_birth_cohort1750M1755  1.02
## hu_birth_cohort1755M1760  1.03
## hu_birth_cohort1760M1765  1.04
## hu_birth_cohort1765M1770  1.04
## hu_birth_cohort1770M1775  1.04
## hu_birth_cohort1775M1780  1.04
## hu_birth_cohort1780M1785  1.04
## hu_birth_cohort1785M1790  1.04
## hu_birth_cohort1790M1795  1.06
## hu_birth_cohort1795M1800  1.06
## hu_birth_cohort1800M1805  1.06
## hu_birth_cohort1805M1810  1.06
## hu_birth_cohort1810M1815  1.06
## hu_birth_cohort1815M1820  1.07
## hu_birth_cohort1820M1825  1.07
## hu_birth_cohort1825M1830  1.07
## hu_birth_cohort1830M1835  1.07
## hu_birth_cohort1835M1840  1.07
## hu_birth_cohort1840M1845  1.07
## hu_birth_cohort1845M1850  1.07
## hu_male1                  1.00
## hu_maternalage.factor1020 1.00
## hu_maternalage.factor3559 1.00
## hu_paternal_loss01        1.00
## hu_paternal_loss15        1.00
## hu_paternal_loss510       1.00
## hu_paternal_loss1015      1.00
## hu_paternal_loss1520      1.00
## hu_paternal_loss2025      1.00
## hu_paternal_loss2530      1.00
## hu_paternal_loss3035      1.00
## hu_paternal_loss3540      1.00
## hu_paternal_loss4045      1.00
## hu_maternal_loss01        1.00
## hu_maternal_loss15        1.00
## hu_maternal_loss510       1.00
## hu_maternal_loss1015      1.00
## hu_maternal_loss1520      1.00
## hu_maternal_loss2025      1.00
## hu_maternal_loss2530      1.00
## hu_maternal_loss3035      1.00
## hu_maternal_loss3540      1.00
## hu_maternal_loss4045      1.00
## hu_older_siblings1        1.00
## hu_older_siblings2        1.00
## hu_older_siblings3        1.00
## hu_older_siblings4        1.00
## hu_older_siblings5P       1.00
## hu_nr.siblings            1.00
## hu_last_born1             1.00
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).

Table of fixed effects

fixed_eff = data.frame(model_summary$fixed, check.names = F)
fixed_eff$Est.Error = fixed_eff$Eff.Sample = fixed_eff$Rhat = NULL
fixed_eff$OR = exp(fixed_eff$Estimate)
fixed_eff$OR_low = exp(fixed_eff$`l-95% CI`)
fixed_eff$OR_high = exp(fixed_eff$`u-95% CI`)
pander::pander(fixed_eff)
  Estimate l-95% CI u-95% CI OR OR_low OR_high
Intercept 1.342 1.23 1.454 3.827 3.422 4.28
paternalage 0.005068 -0.004423 0.01441 1.005 0.9956 1.015
birth_cohort1750M1755 -0.09077 -0.2904 0.09909 0.9132 0.7479 1.104
birth_cohort1755M1760 0.1059 -0.04009 0.2533 1.112 0.9607 1.288
birth_cohort1760M1765 0.1923 0.06461 0.3184 1.212 1.067 1.375
birth_cohort1765M1770 0.1375 0.01094 0.2649 1.147 1.011 1.303
birth_cohort1770M1775 0.1187 -0.007892 0.2503 1.126 0.9921 1.284
birth_cohort1775M1780 0.09045 -0.03344 0.2133 1.095 0.9671 1.238
birth_cohort1780M1785 0.1834 0.05936 0.3074 1.201 1.061 1.36
birth_cohort1785M1790 0.1706 0.05411 0.2914 1.186 1.056 1.338
birth_cohort1790M1795 0.08002 -0.03302 0.1976 1.083 0.9675 1.218
birth_cohort1795M1800 0.1024 -0.004947 0.2158 1.108 0.9951 1.241
birth_cohort1800M1805 0.05091 -0.05915 0.1642 1.052 0.9426 1.178
birth_cohort1805M1810 0.07 -0.03685 0.1801 1.073 0.9638 1.197
birth_cohort1810M1815 0.08242 -0.0257 0.1923 1.086 0.9746 1.212
birth_cohort1815M1820 0.1452 0.04143 0.255 1.156 1.042 1.29
birth_cohort1820M1825 0.1498 0.04721 0.254 1.162 1.048 1.289
birth_cohort1825M1830 0.1111 0.006469 0.2176 1.117 1.006 1.243
birth_cohort1830M1835 0.131 0.02765 0.2409 1.14 1.028 1.272
birth_cohort1835M1840 0.1241 0.01825 0.2333 1.132 1.018 1.263
birth_cohort1840M1845 0.1028 -0.003472 0.2107 1.108 0.9965 1.235
birth_cohort1845M1850 0.1111 0.009462 0.2175 1.118 1.01 1.243
male1 0.03594 0.02449 0.04743 1.037 1.025 1.049
maternalage.factor1020 0.03516 -0.01435 0.08628 1.036 0.9857 1.09
maternalage.factor3559 0.06491 0.04892 0.0811 1.067 1.05 1.084
paternal_loss01 0.08372 0.0253 0.1405 1.087 1.026 1.151
paternal_loss15 0.01829 -0.01825 0.05491 1.018 0.9819 1.056
paternal_loss510 -0.02309 -0.0564 0.008878 0.9772 0.9452 1.009
paternal_loss1015 -0.02898 -0.05612 -0.001523 0.9714 0.9454 0.9985
paternal_loss1520 -0.07445 -0.09976 -0.04832 0.9283 0.9051 0.9528
paternal_loss2025 -0.03195 -0.05515 -0.009393 0.9686 0.9463 0.9907
paternal_loss2530 -0.01991 -0.04193 0.002531 0.9803 0.9589 1.003
paternal_loss3035 -0.02217 -0.04338 -0.001031 0.9781 0.9575 0.999
paternal_loss3540 0.0195 -0.001049 0.03946 1.02 0.999 1.04
paternal_loss4045 0.01706 -0.005324 0.0392 1.017 0.9947 1.04
maternal_loss01 0.07603 -0.01284 0.163 1.079 0.9872 1.177
maternal_loss15 0.02625 -0.01792 0.07106 1.027 0.9822 1.074
maternal_loss510 -0.01828 -0.05377 0.01624 0.9819 0.9477 1.016
maternal_loss1015 -0.04971 -0.08225 -0.01742 0.9515 0.921 0.9827
maternal_loss1520 -0.04053 -0.07162 -0.009112 0.9603 0.9309 0.9909
maternal_loss2025 -0.07618 -0.1033 -0.04817 0.9266 0.9018 0.953
maternal_loss2530 -0.04288 -0.0661 -0.02023 0.958 0.936 0.98
maternal_loss3035 -0.02945 -0.05136 -0.007952 0.971 0.9499 0.9921
maternal_loss3540 -0.01067 -0.03047 0.008206 0.9894 0.97 1.008
maternal_loss4045 -0.02303 -0.04235 -0.002681 0.9772 0.9585 0.9973
older_siblings1 -0.0008157 -0.0182 0.01648 0.9992 0.982 1.017
older_siblings2 -0.001213 -0.0201 0.01773 0.9988 0.9801 1.018
older_siblings3 -0.007186 -0.0295 0.01422 0.9928 0.9709 1.014
older_siblings4 -0.03748 -0.06417 -0.01178 0.9632 0.9378 0.9883
older_siblings5P -0.05026 -0.07891 -0.02326 0.951 0.9241 0.977
nr.siblings 0.03187 0.02923 0.0344 1.032 1.03 1.035
last_born1 -0.01197 -0.02829 0.004055 0.9881 0.9721 1.004
hu_Intercept -0.07308 -0.3492 0.2174 0.9295 0.7052 1.243
hu_paternalage -0.03834 -0.06575 -0.01136 0.9624 0.9364 0.9887
hu_birth_cohort1750M1755 0.3339 -0.1405 0.8245 1.396 0.8689 2.281
hu_birth_cohort1755M1760 0.111 -0.2666 0.5003 1.117 0.766 1.649
hu_birth_cohort1760M1765 0.01644 -0.3329 0.367 1.017 0.7168 1.443
hu_birth_cohort1765M1770 -0.2465 -0.5867 0.1004 0.7816 0.5562 1.106
hu_birth_cohort1770M1775 -0.03883 -0.3796 0.3053 0.9619 0.6842 1.357
hu_birth_cohort1775M1780 0.1134 -0.1989 0.4386 1.12 0.8196 1.551
hu_birth_cohort1780M1785 0.04983 -0.2773 0.3729 1.051 0.7578 1.452
hu_birth_cohort1785M1790 0.1596 -0.1403 0.4767 1.173 0.8691 1.611
hu_birth_cohort1790M1795 0.343 0.05806 0.6268 1.409 1.06 1.872
hu_birth_cohort1795M1800 0.155 -0.1211 0.4385 1.168 0.8859 1.55
hu_birth_cohort1800M1805 0.1096 -0.165 0.3926 1.116 0.8479 1.481
hu_birth_cohort1805M1810 0.05874 -0.2212 0.3407 1.06 0.8016 1.406
hu_birth_cohort1810M1815 0.1524 -0.1178 0.4248 1.165 0.8889 1.529
hu_birth_cohort1815M1820 -0.02479 -0.2906 0.2447 0.9755 0.7478 1.277
hu_birth_cohort1820M1825 -0.1221 -0.391 0.1477 0.8851 0.6764 1.159
hu_birth_cohort1825M1830 -0.1228 -0.3915 0.1421 0.8844 0.676 1.153
hu_birth_cohort1830M1835 -0.1014 -0.3675 0.1658 0.9035 0.6925 1.18
hu_birth_cohort1835M1840 -0.1077 -0.3736 0.1547 0.8979 0.6882 1.167
hu_birth_cohort1840M1845 -0.09494 -0.3587 0.174 0.9094 0.6986 1.19
hu_birth_cohort1845M1850 -0.0733 -0.3381 0.1889 0.9293 0.7132 1.208
hu_male1 0.04437 0.00834 0.07994 1.045 1.008 1.083
hu_maternalage.factor1020 0.04164 -0.1071 0.1939 1.043 0.8984 1.214
hu_maternalage.factor3559 0.0708 0.02373 0.1165 1.073 1.024 1.124
hu_paternal_loss01 0.7529 0.5941 0.9121 2.123 1.811 2.49
hu_paternal_loss15 0.5911 0.492 0.6916 1.806 1.636 1.997
hu_paternal_loss510 0.6246 0.5422 0.7061 1.868 1.72 2.026
hu_paternal_loss1015 0.4816 0.4028 0.5601 1.619 1.496 1.751
hu_paternal_loss1520 0.3872 0.3189 0.4572 1.473 1.376 1.58
hu_paternal_loss2025 0.3015 0.2373 0.3661 1.352 1.268 1.442
hu_paternal_loss2530 0.216 0.1531 0.2823 1.241 1.165 1.326
hu_paternal_loss3035 0.1634 0.0997 0.2254 1.178 1.105 1.253
hu_paternal_loss3540 0.1185 0.05477 0.1782 1.126 1.056 1.195
hu_paternal_loss4045 0.04437 -0.02496 0.1136 1.045 0.9753 1.12
hu_maternal_loss01 1.645 1.441 1.86 5.182 4.224 6.427
hu_maternal_loss15 0.885 0.7734 0.9988 2.423 2.167 2.715
hu_maternal_loss510 0.7498 0.6579 0.8413 2.117 1.931 2.319
hu_maternal_loss1015 0.7123 0.6227 0.8007 2.039 1.864 2.227
hu_maternal_loss1520 0.5823 0.5014 0.6656 1.79 1.651 1.946
hu_maternal_loss2025 0.4075 0.3314 0.4845 1.503 1.393 1.623
hu_maternal_loss2530 0.2877 0.2212 0.3545 1.333 1.248 1.425
hu_maternal_loss3035 0.237 0.1773 0.2961 1.267 1.194 1.345
hu_maternal_loss3540 0.1492 0.09294 0.205 1.161 1.097 1.228
hu_maternal_loss4045 0.09067 0.03066 0.1523 1.095 1.031 1.164
hu_older_siblings1 -0.009103 -0.0611 0.04429 0.9909 0.9407 1.045
hu_older_siblings2 0.02487 -0.03083 0.08348 1.025 0.9696 1.087
hu_older_siblings3 0.03977 -0.02407 0.1079 1.041 0.9762 1.114
hu_older_siblings4 0.02991 -0.04775 0.1075 1.03 0.9534 1.113
hu_older_siblings5P -0.01941 -0.09998 0.06274 0.9808 0.9049 1.065
hu_nr.siblings 0.0269 0.0188 0.03493 1.027 1.019 1.036
hu_last_born1 -0.004373 -0.05297 0.04533 0.9956 0.9484 1.046

Paternal age effect

pander::pander(paternal_age_10y_effect(model))
effect median_estimate ci_95 ci_80
estimate father 25y 2.34 [1.98;2.72] [2.1;2.57]
estimate father 35y 2.39 [2.02;2.78] [2.16;2.63]
percentage change 2.37 [0.69;4.08] [1.27;3.49]
OR/IRR 1.01 [1;1.01] [1;1.01]
OR hurdle 0.96 [0.94;0.99] [0.95;0.98]

Marginal effect plots

plot.brmsMarginalEffects_shades(
    x = marginal_effects(model, re_formula = NA, probs = c(0.025,0.975)),
    y = marginal_effects(model, re_formula = NA, probs = c(0.1,0.9)), 
    ask = FALSE)

plot of chunk unnamed-chunk-11plot of chunk unnamed-chunk-11plot of chunk unnamed-chunk-11plot of chunk unnamed-chunk-11plot of chunk unnamed-chunk-11plot of chunk unnamed-chunk-11plot of chunk unnamed-chunk-11plot of chunk unnamed-chunk-11plot of chunk unnamed-chunk-11

Coefficient plot

Coefficient estimates (95% and 80% credibility).

mcmc_intervals(as.matrix(model$fit), regex_pars = "b_[^I]")
plot of chunk unnamed-chunk-12

plot of chunk unnamed-chunk-12

mcmc_areas(as.matrix(model$fit), regex_pars = "b")
plot of chunk unnamed-chunk-12

plot of chunk unnamed-chunk-12

Diagnostics

These plots were made to diagnose misfit and nonconvergence.

Posterior predictive checks

brms::pp_check(model, re_formula = NA, type = "dens_overlay")
plot of chunk unnamed-chunk-13

plot of chunk unnamed-chunk-13

brms::pp_check(model, re_formula = NA, type = "hist")
plot of chunk unnamed-chunk-13

plot of chunk unnamed-chunk-13

Rhat

Did the 6 chains converge?

stanplot(model, pars = "^b_[^I]", type = 'rhat')
plot of chunk unnamed-chunk-14

plot of chunk unnamed-chunk-14

Effective sample size by average sample size

stanplot(model, pars = "^b", type = 'ess')
plot of chunk unnamed-chunk-15

plot of chunk unnamed-chunk-15

Monte Carlo SE

stanplot(model, pars = "^b", type = 'mcse')
plot of chunk unnamed-chunk-16

plot of chunk unnamed-chunk-16

Trace plots

if(any( summary(model)$fixed[,"Rhat"] > 1.1)) { # only do traceplots if not converged
    plot(model, N = 3, ask = FALSE)
}

Further plots

stanplot(model, pars = "^b", type = 'diag')
plot of chunk unnamed-chunk-18

plot of chunk unnamed-chunk-18

File name

coefs/ddb/m1_children_linear_noranef.rds

Cluster script

opts_chunk$set(echo = FALSE)
clusterscript = str_replace(basename(model_filename), "\\.rds",".html")
cat("[Cluster script](" , clusterscript, ")", sep = "")

Cluster script

m2: Sibling comparison, no paternal age effect

Here, we compared siblings by including a random intercept for the family, but we modelled no effect for paternal age differences among siblings.

Model summary

Full summary

model_summary = summary(model, use_cache = FALSE, priors = TRUE)
print(model_summary)
##  Family: hurdle_poisson (log) 
## Formula: children ~ birth_cohort + male + maternalage.factor + paternalage.mean + paternal_loss + maternal_loss + older_siblings + nr.siblings + last_born + (1 | idParents) 
##          hu ~ birth_cohort + male + maternalage.factor + paternalage.mean + paternal_loss + maternal_loss + older_siblings + nr.siblings + last_born + (1 | idParents)
##    Data: model_data (Number of observations: 56663) 
## Samples: 6 chains, each with iter = 1500; warmup = 1000; thin = 1; 
##          total post-warmup samples = 3000
##    WAIC: Not computed
##  
## Priors: 
## b ~ normal(0,5)
## sd ~ student_t(3, 0, 5)
## b_hu ~ normal(0,5)
## sd_hu ~ student_t(3, 0, 10)
## 
## Group-Level Effects: 
## ~idParents (Number of levels: 14746) 
##                  Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sd(Intercept)        0.36      0.01     0.34     0.37        895    1
## sd(hu_Intercept)     0.82      0.02     0.79     0.85       1092    1
## 
## Population-Level Effects: 
##                           Estimate Est.Error l-95% CI u-95% CI Eff.Sample
## Intercept                     1.32      0.08     1.17     1.49        191
## birth_cohort1750M1755        -0.16      0.12    -0.40     0.07        638
## birth_cohort1755M1760         0.09      0.10    -0.10     0.28        281
## birth_cohort1760M1765         0.15      0.09    -0.02     0.32        217
## birth_cohort1765M1770         0.10      0.09    -0.07     0.27        224
## birth_cohort1770M1775         0.06      0.09    -0.12     0.23        212
## birth_cohort1775M1780         0.04      0.09    -0.13     0.21        193
## birth_cohort1780M1785         0.15      0.09    -0.03     0.32        203
## birth_cohort1785M1790         0.13      0.08    -0.04     0.29        196
## birth_cohort1790M1795         0.03      0.08    -0.13     0.19        186
## birth_cohort1795M1800         0.03      0.08    -0.14     0.18        180
## birth_cohort1800M1805        -0.02      0.08    -0.18     0.12        174
## birth_cohort1805M1810        -0.01      0.08    -0.17     0.14        175
## birth_cohort1810M1815         0.02      0.08    -0.14     0.17        176
## birth_cohort1815M1820         0.07      0.08    -0.09     0.22        169
## birth_cohort1820M1825         0.09      0.08    -0.07     0.24        165
## birth_cohort1825M1830         0.04      0.08    -0.11     0.19        169
## birth_cohort1830M1835         0.07      0.08    -0.09     0.22        168
## birth_cohort1835M1840         0.07      0.08    -0.09     0.22        164
## birth_cohort1840M1845         0.04      0.08    -0.11     0.19        164
## birth_cohort1845M1850         0.05      0.08    -0.10     0.20        164
## male1                         0.04      0.01     0.03     0.05       3000
## maternalage.factor1020        0.04      0.03    -0.01     0.10       3000
## maternalage.factor3559        0.05      0.01     0.03     0.07       1547
## paternalage.mean              0.01      0.01    -0.01     0.02       1388
## paternal_loss01               0.05      0.04    -0.02     0.12       1860
## paternal_loss15               0.02      0.02    -0.03     0.06       1155
## paternal_loss510             -0.03      0.02    -0.07     0.01       1207
## paternal_loss1015            -0.03      0.02    -0.06     0.01       1132
## paternal_loss1520            -0.08      0.02    -0.11    -0.04       1205
## paternal_loss2025            -0.03      0.02    -0.07     0.00       1167
## paternal_loss2530            -0.03      0.01    -0.05     0.00       1055
## paternal_loss3035            -0.02      0.01    -0.05     0.01       1118
## paternal_loss3540             0.02      0.01    -0.01     0.04        777
## paternal_loss4045             0.03      0.01     0.00     0.05       1556
## maternal_loss01               0.06      0.05    -0.05     0.16       1844
## maternal_loss15               0.00      0.03    -0.06     0.05       1656
## maternal_loss510             -0.03      0.02    -0.07     0.02       1604
## maternal_loss1015            -0.04      0.02    -0.09     0.00       1694
## maternal_loss1520            -0.04      0.02    -0.08     0.00       1822
## maternal_loss2025            -0.07      0.02    -0.11    -0.04       1440
## maternal_loss2530            -0.03      0.02    -0.06     0.00       1448
## maternal_loss3035            -0.02      0.01    -0.05     0.00       1200
## maternal_loss3540             0.00      0.01    -0.03     0.02       1504
## maternal_loss4045            -0.02      0.01    -0.05     0.00       1809
## older_siblings1               0.01      0.01    -0.01     0.02       1466
## older_siblings2               0.01      0.01    -0.02     0.03       1291
## older_siblings3               0.00      0.01    -0.02     0.03       1065
## older_siblings4              -0.03      0.02    -0.06     0.00       1210
## older_siblings5P             -0.03      0.02    -0.07     0.00        940
## nr.siblings                   0.03      0.00     0.02     0.03        775
## last_born1                   -0.02      0.01    -0.04     0.00       3000
## hu_Intercept                 -0.06      0.21    -0.48     0.36        170
## hu_birth_cohort1750M1755      0.36      0.30    -0.22     0.94        347
## hu_birth_cohort1755M1760      0.08      0.27    -0.44     0.59        254
## hu_birth_cohort1760M1765     -0.05      0.24    -0.51     0.41        210
## hu_birth_cohort1765M1770     -0.34      0.24    -0.83     0.12        199
## hu_birth_cohort1770M1775     -0.11      0.24    -0.58     0.38        198
## hu_birth_cohort1775M1780      0.05      0.23    -0.39     0.52        190
## hu_birth_cohort1780M1785     -0.01      0.23    -0.48     0.45        197
## hu_birth_cohort1785M1790      0.13      0.22    -0.30     0.55        183
## hu_birth_cohort1790M1795      0.31      0.21    -0.11     0.72        173
## hu_birth_cohort1795M1800      0.11      0.21    -0.29     0.51        165
## hu_birth_cohort1800M1805      0.03      0.21    -0.38     0.43        162
## hu_birth_cohort1805M1810     -0.01      0.21    -0.42     0.39        158
## hu_birth_cohort1810M1815      0.06      0.21    -0.35     0.45        162
## hu_birth_cohort1815M1820     -0.10      0.20    -0.51     0.29        153
## hu_birth_cohort1820M1825     -0.21      0.20    -0.61     0.17        151
## hu_birth_cohort1825M1830     -0.21      0.20    -0.60     0.19        150
## hu_birth_cohort1830M1835     -0.19      0.20    -0.58     0.20        153
## hu_birth_cohort1835M1840     -0.21      0.20    -0.61     0.18        155
## hu_birth_cohort1840M1845     -0.20      0.20    -0.60     0.20        153
## hu_birth_cohort1845M1850     -0.16      0.20    -0.55     0.24        151
## hu_male1                      0.04      0.02     0.01     0.08       3000
## hu_maternalage.factor1020     0.05      0.09    -0.12     0.23       3000
## hu_maternalage.factor3559     0.08      0.03     0.03     0.13       3000
## hu_paternalage.mean          -0.03      0.02    -0.07     0.01       2052
## hu_paternal_loss01            0.87      0.09     0.69     1.05       3000
## hu_paternal_loss15            0.68      0.06     0.55     0.80       3000
## hu_paternal_loss510           0.69      0.05     0.59     0.80       1207
## hu_paternal_loss1015          0.53      0.05     0.44     0.62       1189
## hu_paternal_loss1520          0.43      0.04     0.34     0.51       1223
## hu_paternal_loss2025          0.32      0.04     0.24     0.40       1164
## hu_paternal_loss2530          0.23      0.04     0.15     0.31       1196
## hu_paternal_loss3035          0.16      0.04     0.08     0.24       1270
## hu_paternal_loss3540          0.12      0.04     0.05     0.19       1627
## hu_paternal_loss4045          0.04      0.04    -0.04     0.12       1949
## hu_maternal_loss01            1.86      0.12     1.62     2.09       3000
## hu_maternal_loss15            1.03      0.07     0.90     1.16       3000
## hu_maternal_loss510           0.87      0.06     0.76     0.98       3000
## hu_maternal_loss1015          0.81      0.05     0.70     0.91       3000
## hu_maternal_loss1520          0.67      0.05     0.58     0.77       2112
## hu_maternal_loss2025          0.46      0.04     0.37     0.54       3000
## hu_maternal_loss2530          0.31      0.04     0.24     0.39       3000
## hu_maternal_loss3035          0.24      0.04     0.17     0.32       2011
## hu_maternal_loss3540          0.14      0.03     0.08     0.21       3000
## hu_maternal_loss4045          0.08      0.03     0.01     0.14       3000
## hu_older_siblings1           -0.03      0.03    -0.09     0.02       3000
## hu_older_siblings2           -0.01      0.03    -0.08     0.05       1774
## hu_older_siblings3           -0.02      0.04    -0.09     0.05       1643
## hu_older_siblings4           -0.04      0.04    -0.13     0.04       1505
## hu_older_siblings5P          -0.09      0.05    -0.18     0.00       1182
## hu_nr.siblings                0.04      0.01     0.03     0.05       1349
## hu_last_born1                 0.01      0.03    -0.04     0.06       3000
##                           Rhat
## Intercept                 1.03
## birth_cohort1750M1755     1.01
## birth_cohort1755M1760     1.01
## birth_cohort1760M1765     1.02
## birth_cohort1765M1770     1.02
## birth_cohort1770M1775     1.02
## birth_cohort1775M1780     1.03
## birth_cohort1780M1785     1.02
## birth_cohort1785M1790     1.02
## birth_cohort1790M1795     1.02
## birth_cohort1795M1800     1.02
## birth_cohort1800M1805     1.02
## birth_cohort1805M1810     1.02
## birth_cohort1810M1815     1.03
## birth_cohort1815M1820     1.03
## birth_cohort1820M1825     1.03
## birth_cohort1825M1830     1.03
## birth_cohort1830M1835     1.03
## birth_cohort1835M1840     1.03
## birth_cohort1840M1845     1.03
## birth_cohort1845M1850     1.03
## male1                     1.00
## maternalage.factor1020    1.00
## maternalage.factor3559    1.00
## paternalage.mean          1.00
## paternal_loss01           1.00
## paternal_loss15           1.00
## paternal_loss510          1.00
## paternal_loss1015         1.01
## paternal_loss1520         1.00
## paternal_loss2025         1.01
## paternal_loss2530         1.01
## paternal_loss3035         1.01
## paternal_loss3540         1.00
## paternal_loss4045         1.00
## maternal_loss01           1.00
## maternal_loss15           1.00
## maternal_loss510          1.00
## maternal_loss1015         1.00
## maternal_loss1520         1.00
## maternal_loss2025         1.00
## maternal_loss2530         1.00
## maternal_loss3035         1.00
## maternal_loss3540         1.00
## maternal_loss4045         1.00
## older_siblings1           1.00
## older_siblings2           1.00
## older_siblings3           1.00
## older_siblings4           1.00
## older_siblings5P          1.00
## nr.siblings               1.01
## last_born1                1.00
## hu_Intercept              1.02
## hu_birth_cohort1750M1755  1.01
## hu_birth_cohort1755M1760  1.02
## hu_birth_cohort1760M1765  1.02
## hu_birth_cohort1765M1770  1.02
## hu_birth_cohort1770M1775  1.02
## hu_birth_cohort1775M1780  1.02
## hu_birth_cohort1780M1785  1.02
## hu_birth_cohort1785M1790  1.02
## hu_birth_cohort1790M1795  1.02
## hu_birth_cohort1795M1800  1.02
## hu_birth_cohort1800M1805  1.03
## hu_birth_cohort1805M1810  1.03
## hu_birth_cohort1810M1815  1.03
## hu_birth_cohort1815M1820  1.03
## hu_birth_cohort1820M1825  1.03
## hu_birth_cohort1825M1830  1.03
## hu_birth_cohort1830M1835  1.03
## hu_birth_cohort1835M1840  1.03
## hu_birth_cohort1840M1845  1.03
## hu_birth_cohort1845M1850  1.03
## hu_male1                  1.00
## hu_maternalage.factor1020 1.00
## hu_maternalage.factor3559 1.00
## hu_paternalage.mean       1.01
## hu_paternal_loss01        1.00
## hu_paternal_loss15        1.00
## hu_paternal_loss510       1.00
## hu_paternal_loss1015      1.01
## hu_paternal_loss1520      1.01
## hu_paternal_loss2025      1.01
## hu_paternal_loss2530      1.01
## hu_paternal_loss3035      1.01
## hu_paternal_loss3540      1.00
## hu_paternal_loss4045      1.00
## hu_maternal_loss01        1.00
## hu_maternal_loss15        1.00
## hu_maternal_loss510       1.00
## hu_maternal_loss1015      1.00
## hu_maternal_loss1520      1.00
## hu_maternal_loss2025      1.00
## hu_maternal_loss2530      1.00
## hu_maternal_loss3035      1.00
## hu_maternal_loss3540      1.00
## hu_maternal_loss4045      1.00
## hu_older_siblings1        1.00
## hu_older_siblings2        1.00
## hu_older_siblings3        1.00
## hu_older_siblings4        1.00
## hu_older_siblings5P       1.00
## hu_nr.siblings            1.00
## hu_last_born1             1.00
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).

Table of fixed effects

fixed_eff = data.frame(model_summary$fixed, check.names = F)
fixed_eff$Est.Error = fixed_eff$Eff.Sample = fixed_eff$Rhat = NULL
fixed_eff$OR = exp(fixed_eff$Estimate)
fixed_eff$OR_low = exp(fixed_eff$`l-95% CI`)
fixed_eff$OR_high = exp(fixed_eff$`u-95% CI`)
pander::pander(fixed_eff)
  Estimate l-95% CI u-95% CI OR OR_low OR_high
Intercept 1.324 1.167 1.491 3.757 3.212 4.44
birth_cohort1750M1755 -0.1586 -0.3964 0.0693 0.8533 0.6727 1.072
birth_cohort1755M1760 0.09467 -0.09801 0.2787 1.099 0.9066 1.321
birth_cohort1760M1765 0.1527 -0.02271 0.3198 1.165 0.9775 1.377
birth_cohort1765M1770 0.1017 -0.07075 0.2697 1.107 0.9317 1.31
birth_cohort1770M1775 0.05917 -0.1172 0.2281 1.061 0.8894 1.256
birth_cohort1775M1780 0.04413 -0.1324 0.2106 1.045 0.876 1.234
birth_cohort1780M1785 0.1516 -0.02952 0.3178 1.164 0.9709 1.374
birth_cohort1785M1790 0.1254 -0.03916 0.286 1.134 0.9616 1.331
birth_cohort1790M1795 0.0288 -0.1334 0.1894 1.029 0.8751 1.209
birth_cohort1795M1800 0.02548 -0.1387 0.1757 1.026 0.8705 1.192
birth_cohort1800M1805 -0.02281 -0.1833 0.1248 0.9775 0.8325 1.133
birth_cohort1805M1810 -0.007598 -0.1691 0.1411 0.9924 0.8444 1.152
birth_cohort1810M1815 0.01693 -0.1427 0.1664 1.017 0.867 1.181
birth_cohort1815M1820 0.06825 -0.0888 0.2168 1.071 0.915 1.242
birth_cohort1820M1825 0.08681 -0.0674 0.2351 1.091 0.9348 1.265
birth_cohort1825M1830 0.04452 -0.1104 0.1907 1.046 0.8955 1.21
birth_cohort1830M1835 0.06891 -0.08646 0.2171 1.071 0.9172 1.242
birth_cohort1835M1840 0.06701 -0.08952 0.217 1.069 0.9144 1.242
birth_cohort1840M1845 0.04377 -0.1105 0.1942 1.045 0.8954 1.214
birth_cohort1845M1850 0.05233 -0.1044 0.2021 1.054 0.9009 1.224
male1 0.04001 0.0264 0.05312 1.041 1.027 1.055
maternalage.factor1020 0.04313 -0.01425 0.1031 1.044 0.9859 1.109
maternalage.factor3559 0.05128 0.03183 0.07065 1.053 1.032 1.073
paternalage.mean 0.009184 -0.005862 0.0244 1.009 0.9942 1.025
paternal_loss01 0.04776 -0.02363 0.1207 1.049 0.9766 1.128
paternal_loss15 0.01508 -0.03284 0.06371 1.015 0.9677 1.066
paternal_loss510 -0.02945 -0.0718 0.01139 0.971 0.9307 1.011
paternal_loss1015 -0.0279 -0.06329 0.009102 0.9725 0.9387 1.009
paternal_loss1520 -0.08022 -0.1127 -0.04463 0.9229 0.8934 0.9564
paternal_loss2025 -0.03365 -0.06522 -0.001898 0.9669 0.9369 0.9981
paternal_loss2530 -0.02592 -0.05422 0.001965 0.9744 0.9472 1.002
paternal_loss3035 -0.01967 -0.04658 0.008589 0.9805 0.9545 1.009
paternal_loss3540 0.01859 -0.007818 0.04457 1.019 0.9922 1.046
paternal_loss4045 0.02655 0.001609 0.05234 1.027 1.002 1.054
maternal_loss01 0.06116 -0.04563 0.1615 1.063 0.9554 1.175
maternal_loss15 -0.004662 -0.06229 0.05166 0.9953 0.9396 1.053
maternal_loss510 -0.02629 -0.07104 0.02051 0.9741 0.9314 1.021
maternal_loss1015 -0.04086 -0.08563 0.001211 0.96 0.9179 1.001
maternal_loss1520 -0.03989 -0.08011 0.0005557 0.9609 0.923 1.001
maternal_loss2025 -0.07373 -0.1075 -0.04055 0.9289 0.8981 0.9603
maternal_loss2530 -0.03077 -0.05996 -0.00131 0.9697 0.9418 0.9987
maternal_loss3035 -0.02368 -0.05069 0.004172 0.9766 0.9506 1.004
maternal_loss3540 -0.0005577 -0.02549 0.02288 0.9994 0.9748 1.023
maternal_loss4045 -0.02133 -0.04514 0.003627 0.9789 0.9559 1.004
older_siblings1 0.005016 -0.01389 0.02435 1.005 0.9862 1.025
older_siblings2 0.006413 -0.01509 0.02875 1.006 0.985 1.029
older_siblings3 0.003906 -0.02195 0.03026 1.004 0.9783 1.031
older_siblings4 -0.02887 -0.05943 0.001388 0.9715 0.9423 1.001
older_siblings5P -0.03352 -0.06552 -0.001208 0.967 0.9366 0.9988
nr.siblings 0.02759 0.02332 0.03159 1.028 1.024 1.032
last_born1 -0.02124 -0.03981 -0.002417 0.979 0.961 0.9976
hu_Intercept -0.06196 -0.4758 0.3624 0.9399 0.6214 1.437
hu_birth_cohort1750M1755 0.3595 -0.2205 0.9447 1.433 0.8021 2.572
hu_birth_cohort1755M1760 0.07792 -0.4418 0.5859 1.081 0.6429 1.797
hu_birth_cohort1760M1765 -0.05128 -0.506 0.4101 0.95 0.6029 1.507
hu_birth_cohort1765M1770 -0.3389 -0.8264 0.1188 0.7125 0.4376 1.126
hu_birth_cohort1770M1775 -0.1052 -0.5784 0.3769 0.9001 0.5608 1.458
hu_birth_cohort1775M1780 0.05375 -0.3937 0.5164 1.055 0.6746 1.676
hu_birth_cohort1780M1785 -0.01086 -0.4802 0.4545 0.9892 0.6186 1.575
hu_birth_cohort1785M1790 0.1312 -0.2961 0.5476 1.14 0.7437 1.729
hu_birth_cohort1790M1795 0.3076 -0.112 0.7205 1.36 0.894 2.056
hu_birth_cohort1795M1800 0.1135 -0.2945 0.5111 1.12 0.7449 1.667
hu_birth_cohort1800M1805 0.03326 -0.38 0.4294 1.034 0.6839 1.536
hu_birth_cohort1805M1810 -0.01138 -0.418 0.386 0.9887 0.6584 1.471
hu_birth_cohort1810M1815 0.06337 -0.3475 0.4537 1.065 0.7065 1.574
hu_birth_cohort1815M1820 -0.103 -0.508 0.2945 0.9022 0.6017 1.342
hu_birth_cohort1820M1825 -0.2083 -0.6056 0.1722 0.812 0.5457 1.188
hu_birth_cohort1825M1830 -0.2072 -0.5975 0.189 0.8129 0.5502 1.208
hu_birth_cohort1830M1835 -0.1887 -0.583 0.2039 0.828 0.5582 1.226
hu_birth_cohort1835M1840 -0.2089 -0.6076 0.1814 0.8115 0.5447 1.199
hu_birth_cohort1840M1845 -0.1958 -0.5978 0.1977 0.8221 0.55 1.219
hu_birth_cohort1845M1850 -0.1596 -0.5548 0.2402 0.8525 0.5742 1.271
hu_male1 0.04485 0.00717 0.08263 1.046 1.007 1.086
hu_maternalage.factor1020 0.05343 -0.1179 0.2278 1.055 0.8888 1.256
hu_maternalage.factor3559 0.08142 0.02882 0.133 1.085 1.029 1.142
hu_paternalage.mean -0.029 -0.06644 0.009185 0.9714 0.9357 1.009
hu_paternal_loss01 0.8724 0.6863 1.054 2.393 1.986 2.87
hu_paternal_loss15 0.6769 0.5517 0.7977 1.968 1.736 2.22
hu_paternal_loss510 0.6947 0.5896 0.7977 2.003 1.803 2.22
hu_paternal_loss1015 0.5267 0.4354 0.6201 1.693 1.546 1.859
hu_paternal_loss1520 0.4275 0.3378 0.514 1.533 1.402 1.672
hu_paternal_loss2025 0.3248 0.2401 0.4049 1.384 1.271 1.499
hu_paternal_loss2530 0.2281 0.1467 0.3103 1.256 1.158 1.364
hu_paternal_loss3035 0.1605 0.08226 0.2366 1.174 1.086 1.267
hu_paternal_loss3540 0.1204 0.04549 0.19 1.128 1.047 1.209
hu_paternal_loss4045 0.03897 -0.03853 0.1152 1.04 0.9622 1.122
hu_maternal_loss01 1.858 1.621 2.093 6.408 5.059 8.108
hu_maternal_loss15 1.029 0.9011 1.16 2.797 2.462 3.189
hu_maternal_loss510 0.8662 0.7594 0.9788 2.378 2.137 2.661
hu_maternal_loss1015 0.806 0.7025 0.913 2.239 2.019 2.492
hu_maternal_loss1520 0.6728 0.5753 0.767 1.96 1.778 2.153
hu_maternal_loss2025 0.4579 0.3668 0.5404 1.581 1.443 1.717
hu_maternal_loss2530 0.3141 0.2362 0.3936 1.369 1.266 1.482
hu_maternal_loss3035 0.2446 0.1747 0.3153 1.277 1.191 1.371
hu_maternal_loss3540 0.1444 0.07747 0.2141 1.155 1.081 1.239
hu_maternal_loss4045 0.07564 0.007866 0.1405 1.079 1.008 1.151
hu_older_siblings1 -0.03132 -0.08623 0.02268 0.9692 0.9174 1.023
hu_older_siblings2 -0.01436 -0.07884 0.05133 0.9857 0.9242 1.053
hu_older_siblings3 -0.02106 -0.09089 0.05392 0.9792 0.9131 1.055
hu_older_siblings4 -0.04481 -0.1276 0.04488 0.9562 0.8802 1.046
hu_older_siblings5P -0.09197 -0.1814 -0.002605 0.9121 0.8341 0.9974
hu_nr.siblings 0.04348 0.03257 0.05413 1.044 1.033 1.056
hu_last_born1 0.006975 -0.04415 0.06038 1.007 0.9568 1.062

Paternal age effect

pander::pander(paternal_age_10y_effect(model))

Marginal effect plots

plot.brmsMarginalEffects_shades(
    x = marginal_effects(model, re_formula = NA, probs = c(0.025,0.975)),
    y = marginal_effects(model, re_formula = NA, probs = c(0.1,0.9)), 
    ask = FALSE)

plot of chunk unnamed-chunk-24plot of chunk unnamed-chunk-24plot of chunk unnamed-chunk-24plot of chunk unnamed-chunk-24plot of chunk unnamed-chunk-24plot of chunk unnamed-chunk-24plot of chunk unnamed-chunk-24plot of chunk unnamed-chunk-24plot of chunk unnamed-chunk-24

Coefficient plot

Coefficient estimates (95% and 80% credibility).

mcmc_intervals(as.matrix(model$fit), regex_pars = "b_[^I]")
plot of chunk unnamed-chunk-25

plot of chunk unnamed-chunk-25

mcmc_areas(as.matrix(model$fit), regex_pars = "b")
plot of chunk unnamed-chunk-25

plot of chunk unnamed-chunk-25

Diagnostics

These plots were made to diagnose misfit and nonconvergence.

Posterior predictive checks

brms::pp_check(model, re_formula = NA, type = "dens_overlay")
plot of chunk unnamed-chunk-26

plot of chunk unnamed-chunk-26

brms::pp_check(model, re_formula = NA, type = "hist")
plot of chunk unnamed-chunk-26

plot of chunk unnamed-chunk-26

Rhat

Did the 6 chains converge?

stanplot(model, pars = "^b_[^I]", type = 'rhat')
plot of chunk unnamed-chunk-27

plot of chunk unnamed-chunk-27

Effective sample size by average sample size

stanplot(model, pars = "^b", type = 'ess')
plot of chunk unnamed-chunk-28

plot of chunk unnamed-chunk-28

Monte Carlo SE

stanplot(model, pars = "^b", type = 'mcse')
plot of chunk unnamed-chunk-29

plot of chunk unnamed-chunk-29

Trace plots

if(any( summary(model)$fixed[,"Rhat"] > 1.1)) { # only do traceplots if not converged
    plot(model, N = 3, ask = FALSE)
}

Further plots

stanplot(model, pars = "^b", type = 'diag')
plot of chunk unnamed-chunk-31

plot of chunk unnamed-chunk-31

File name

coefs/ddb/m2_children_linear_no_diff.rds

Cluster script

opts_chunk$set(echo = FALSE)
clusterscript = str_replace(basename(model_filename), "\\.rds",".html")
cat("[Cluster script](" , clusterscript, ")", sep = "")

Cluster script

m3: Sibling comparison, linear paternal age effect

Here, we compared siblings by including a random intercept for the family, and we modelled a linear effect for paternal age differences among siblings.

Model summary

Full summary

model_summary = summary(model, use_cache = FALSE, priors = TRUE)
print(model_summary)
##  Family: hurdle_poisson (log) 
## Formula: children ~ paternalage + birth_cohort + male + maternalage.factor + paternalage.mean + paternal_loss + maternal_loss + older_siblings + nr.siblings + last_born + (1 | idParents) 
##          hu ~ paternalage + birth_cohort + male + maternalage.factor + paternalage.mean + paternal_loss + maternal_loss + older_siblings + nr.siblings + last_born + (1 | idParents)
##    Data: model_data (Number of observations: 56663) 
## Samples: 6 chains, each with iter = 800; warmup = 300; thin = 1; 
##          total post-warmup samples = 3000
##    WAIC: Not computed
##  
## Priors: 
## b ~ normal(0,5)
## sd ~ student_t(3, 0, 5)
## b_hu ~ normal(0,5)
## sd_hu ~ student_t(3, 0, 10)
## 
## Group-Level Effects: 
## ~idParents (Number of levels: 14746) 
##                  Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sd(Intercept)        0.36      0.01     0.34     0.37       1049    1
## sd(hu_Intercept)     0.82      0.02     0.78     0.85       1292    1
## 
## Population-Level Effects: 
##                           Estimate Est.Error l-95% CI u-95% CI Eff.Sample
## Intercept                     1.32      0.08     1.16     1.48        247
## paternalage                  -0.05      0.02    -0.09    -0.02        896
## birth_cohort1750M1755        -0.17      0.12    -0.40     0.06        607
## birth_cohort1755M1760         0.09      0.10    -0.10     0.27        380
## birth_cohort1760M1765         0.15      0.09    -0.02     0.31        285
## birth_cohort1765M1770         0.10      0.09    -0.07     0.27        284
## birth_cohort1770M1775         0.06      0.09    -0.12     0.23        279
## birth_cohort1775M1780         0.04      0.09    -0.13     0.22        263
## birth_cohort1780M1785         0.15      0.09    -0.01     0.32        287
## birth_cohort1785M1790         0.12      0.08    -0.04     0.29        271
## birth_cohort1790M1795         0.03      0.08    -0.13     0.18        247
## birth_cohort1795M1800         0.02      0.08    -0.13     0.18        234
## birth_cohort1800M1805        -0.03      0.08    -0.18     0.13        230
## birth_cohort1805M1810        -0.01      0.08    -0.16     0.14        228
## birth_cohort1810M1815         0.01      0.08    -0.14     0.17        223
## birth_cohort1815M1820         0.07      0.08    -0.08     0.22        218
## birth_cohort1820M1825         0.08      0.08    -0.07     0.24        221
## birth_cohort1825M1830         0.04      0.08    -0.11     0.19        223
## birth_cohort1830M1835         0.07      0.08    -0.08     0.22        217
## birth_cohort1835M1840         0.07      0.08    -0.08     0.22        219
## birth_cohort1840M1845         0.04      0.08    -0.10     0.19        219
## birth_cohort1845M1850         0.05      0.08    -0.10     0.21        219
## male1                         0.04      0.01     0.03     0.05       3000
## maternalage.factor1020        0.04      0.03    -0.02     0.10       3000
## maternalage.factor3559        0.06      0.01     0.04     0.09       3000
## paternalage.mean              0.06      0.02     0.02     0.10        957
## paternal_loss01               0.06      0.04    -0.01     0.13       2274
## paternal_loss15               0.03      0.02    -0.02     0.07       1751
## paternal_loss510             -0.02      0.02    -0.06     0.02       1638
## paternal_loss1015            -0.02      0.02    -0.06     0.02       1590
## paternal_loss1520            -0.07      0.02    -0.11    -0.04       1533
## paternal_loss2025            -0.03      0.02    -0.06     0.00       1561
## paternal_loss2530            -0.02      0.01    -0.05     0.01       1443
## paternal_loss3035            -0.02      0.01    -0.04     0.01       1691
## paternal_loss3540             0.02      0.01     0.00     0.05       1855
## paternal_loss4045             0.03      0.01     0.00     0.05       3000
## maternal_loss01               0.07      0.05    -0.04     0.17       3000
## maternal_loss15               0.00      0.03    -0.05     0.06       3000
## maternal_loss510             -0.02      0.02    -0.07     0.03       1929
## maternal_loss1015            -0.04      0.02    -0.08     0.01       2085
## maternal_loss1520            -0.04      0.02    -0.08     0.00       2052
## maternal_loss2025            -0.07      0.02    -0.11    -0.03       1705
## maternal_loss2530            -0.03      0.02    -0.06     0.00       1788
## maternal_loss3035            -0.02      0.01    -0.05     0.01       1966
## maternal_loss3540             0.00      0.01    -0.02     0.03       1975
## maternal_loss4045            -0.02      0.01    -0.04     0.00       3000
## older_siblings1               0.02      0.01    -0.01     0.04       1769
## older_siblings2               0.03      0.01     0.00     0.06       1239
## older_siblings3               0.04      0.02     0.00     0.07       1042
## older_siblings4               0.01      0.02    -0.03     0.06       1025
## older_siblings5P              0.03      0.03    -0.03     0.08        996
## nr.siblings                   0.02      0.00     0.02     0.03       1097
## last_born1                   -0.02      0.01    -0.04     0.00       3000
## hu_Intercept                 -0.07      0.20    -0.44     0.32        184
## hu_paternalage                0.05      0.06    -0.06     0.16        948
## hu_birth_cohort1750M1755      0.37      0.28    -0.18     0.93        658
## hu_birth_cohort1755M1760      0.09      0.24    -0.38     0.59        358
## hu_birth_cohort1760M1765     -0.04      0.22    -0.46     0.40        298
## hu_birth_cohort1765M1770     -0.33      0.22    -0.76     0.09        279
## hu_birth_cohort1770M1775     -0.09      0.22    -0.55     0.34        286
## hu_birth_cohort1775M1780      0.06      0.22    -0.37     0.48        262
## hu_birth_cohort1780M1785      0.00      0.21    -0.42     0.43        271
## hu_birth_cohort1785M1790      0.14      0.20    -0.26     0.52        246
## hu_birth_cohort1790M1795      0.33      0.19    -0.06     0.68        188
## hu_birth_cohort1795M1800      0.13      0.19    -0.25     0.50        181
## hu_birth_cohort1800M1805      0.05      0.19    -0.34     0.41        210
## hu_birth_cohort1805M1810      0.00      0.19    -0.37     0.36        169
## hu_birth_cohort1810M1815      0.08      0.19    -0.30     0.43        181
## hu_birth_cohort1815M1820     -0.09      0.19    -0.46     0.27        176
## hu_birth_cohort1820M1825     -0.19      0.19    -0.57     0.16        175
## hu_birth_cohort1825M1830     -0.19      0.18    -0.55     0.16        201
## hu_birth_cohort1830M1835     -0.18      0.19    -0.55     0.17        171
## hu_birth_cohort1835M1840     -0.20      0.18    -0.57     0.15        171
## hu_birth_cohort1840M1845     -0.19      0.18    -0.55     0.16        175
## hu_birth_cohort1845M1850     -0.15      0.18    -0.51     0.20        173
## hu_male1                      0.04      0.02     0.01     0.08       3000
## hu_maternalage.factor1020     0.06      0.09    -0.12     0.24       3000
## hu_maternalage.factor3559     0.07      0.03     0.01     0.13       3000
## hu_paternalage.mean          -0.08      0.06    -0.19     0.03       1009
## hu_paternal_loss01            0.87      0.09     0.68     1.05       3000
## hu_paternal_loss15            0.67      0.06     0.55     0.79       1867
## hu_paternal_loss510           0.69      0.05     0.58     0.79       3000
## hu_paternal_loss1015          0.52      0.05     0.43     0.62       1712
## hu_paternal_loss1520          0.42      0.05     0.33     0.51       1607
## hu_paternal_loss2025          0.32      0.04     0.24     0.40       1494
## hu_paternal_loss2530          0.22      0.04     0.14     0.30       1463
## hu_paternal_loss3035          0.16      0.04     0.08     0.23       1857
## hu_paternal_loss3540          0.12      0.04     0.05     0.19       2071
## hu_paternal_loss4045          0.04      0.04    -0.04     0.12       3000
## hu_maternal_loss01            1.86      0.12     1.63     2.10       3000
## hu_maternal_loss15            1.02      0.07     0.88     1.16       3000
## hu_maternal_loss510           0.86      0.06     0.75     0.98       3000
## hu_maternal_loss1015          0.80      0.06     0.69     0.92       3000
## hu_maternal_loss1520          0.67      0.05     0.57     0.77       3000
## hu_maternal_loss2025          0.46      0.05     0.37     0.55       3000
## hu_maternal_loss2530          0.31      0.04     0.23     0.40       3000
## hu_maternal_loss3035          0.24      0.04     0.17     0.32       1995
## hu_maternal_loss3540          0.14      0.03     0.08     0.21       3000
## hu_maternal_loss4045          0.08      0.04     0.01     0.15       3000
## hu_older_siblings1           -0.04      0.03    -0.10     0.02       3000
## hu_older_siblings2           -0.04      0.04    -0.12     0.05       1069
## hu_older_siblings3           -0.05      0.05    -0.15     0.05       1098
## hu_older_siblings4           -0.09      0.06    -0.21     0.04       1014
## hu_older_siblings5P          -0.15      0.08    -0.31     0.01        918
## hu_nr.siblings                0.05      0.01     0.03     0.06       1241
## hu_last_born1                 0.01      0.03    -0.04     0.06       3000
##                           Rhat
## Intercept                 1.04
## paternalage               1.00
## birth_cohort1750M1755     1.01
## birth_cohort1755M1760     1.02
## birth_cohort1760M1765     1.03
## birth_cohort1765M1770     1.03
## birth_cohort1770M1775     1.03
## birth_cohort1775M1780     1.04
## birth_cohort1780M1785     1.03
## birth_cohort1785M1790     1.04
## birth_cohort1790M1795     1.04
## birth_cohort1795M1800     1.04
## birth_cohort1800M1805     1.04
## birth_cohort1805M1810     1.04
## birth_cohort1810M1815     1.05
## birth_cohort1815M1820     1.05
## birth_cohort1820M1825     1.05
## birth_cohort1825M1830     1.04
## birth_cohort1830M1835     1.05
## birth_cohort1835M1840     1.05
## birth_cohort1840M1845     1.04
## birth_cohort1845M1850     1.04
## male1                     1.00
## maternalage.factor1020    1.00
## maternalage.factor3559    1.00
## paternalage.mean          1.00
## paternal_loss01           1.00
## paternal_loss15           1.00
## paternal_loss510          1.00
## paternal_loss1015         1.00
## paternal_loss1520         1.00
## paternal_loss2025         1.00
## paternal_loss2530         1.00
## paternal_loss3035         1.00
## paternal_loss3540         1.00
## paternal_loss4045         1.00
## maternal_loss01           1.00
## maternal_loss15           1.00
## maternal_loss510          1.00
## maternal_loss1015         1.00
## maternal_loss1520         1.00
## maternal_loss2025         1.00
## maternal_loss2530         1.00
## maternal_loss3035         1.00
## maternal_loss3540         1.00
## maternal_loss4045         1.00
## older_siblings1           1.00
## older_siblings2           1.00
## older_siblings3           1.01
## older_siblings4           1.00
## older_siblings5P          1.00
## nr.siblings               1.00
## last_born1                1.00
## hu_Intercept              1.02
## hu_paternalage            1.01
## hu_birth_cohort1750M1755  1.00
## hu_birth_cohort1755M1760  1.01
## hu_birth_cohort1760M1765  1.01
## hu_birth_cohort1765M1770  1.01
## hu_birth_cohort1770M1775  1.01
## hu_birth_cohort1775M1780  1.01
## hu_birth_cohort1780M1785  1.01
## hu_birth_cohort1785M1790  1.01
## hu_birth_cohort1790M1795  1.01
## hu_birth_cohort1795M1800  1.02
## hu_birth_cohort1800M1805  1.02
## hu_birth_cohort1805M1810  1.02
## hu_birth_cohort1810M1815  1.02
## hu_birth_cohort1815M1820  1.02
## hu_birth_cohort1820M1825  1.02
## hu_birth_cohort1825M1830  1.02
## hu_birth_cohort1830M1835  1.02
## hu_birth_cohort1835M1840  1.02
## hu_birth_cohort1840M1845  1.02
## hu_birth_cohort1845M1850  1.02
## hu_male1                  1.00
## hu_maternalage.factor1020 1.00
## hu_maternalage.factor3559 1.00
## hu_paternalage.mean       1.01
## hu_paternal_loss01        1.00
## hu_paternal_loss15        1.00
## hu_paternal_loss510       1.00
## hu_paternal_loss1015      1.00
## hu_paternal_loss1520      1.00
## hu_paternal_loss2025      1.00
## hu_paternal_loss2530      1.00
## hu_paternal_loss3035      1.00
## hu_paternal_loss3540      1.00
## hu_paternal_loss4045      1.00
## hu_maternal_loss01        1.00
## hu_maternal_loss15        1.00
## hu_maternal_loss510       1.00
## hu_maternal_loss1015      1.00
## hu_maternal_loss1520      1.00
## hu_maternal_loss2025      1.00
## hu_maternal_loss2530      1.00
## hu_maternal_loss3035      1.00
## hu_maternal_loss3540      1.00
## hu_maternal_loss4045      1.00
## hu_older_siblings1        1.00
## hu_older_siblings2        1.01
## hu_older_siblings3        1.01
## hu_older_siblings4        1.01
## hu_older_siblings5P       1.01
## hu_nr.siblings            1.01
## hu_last_born1             1.00
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).

Table of fixed effects

fixed_eff = data.frame(model_summary$fixed, check.names = F)
fixed_eff$Est.Error = fixed_eff$Eff.Sample = fixed_eff$Rhat = NULL
fixed_eff$OR = exp(fixed_eff$Estimate)
fixed_eff$OR_low = exp(fixed_eff$`l-95% CI`)
fixed_eff$OR_high = exp(fixed_eff$`u-95% CI`)
pander::pander(fixed_eff)
  Estimate l-95% CI u-95% CI OR OR_low OR_high
Intercept 1.319 1.161 1.48 3.74 3.194 4.392
paternalage -0.05307 -0.09123 -0.01525 0.9483 0.9128 0.9849
birth_cohort1750M1755 -0.1708 -0.4016 0.05504 0.843 0.6693 1.057
birth_cohort1755M1760 0.09244 -0.09589 0.2746 1.097 0.9086 1.316
birth_cohort1760M1765 0.148 -0.02455 0.3149 1.16 0.9757 1.37
birth_cohort1765M1770 0.09768 -0.07109 0.2667 1.103 0.9314 1.306
birth_cohort1770M1775 0.05961 -0.1186 0.2314 1.061 0.8882 1.26
birth_cohort1775M1780 0.04475 -0.1315 0.2175 1.046 0.8768 1.243
birth_cohort1780M1785 0.1506 -0.01349 0.3167 1.163 0.9866 1.373
birth_cohort1785M1790 0.1232 -0.03961 0.2897 1.131 0.9612 1.336
birth_cohort1790M1795 0.02509 -0.1311 0.1825 1.025 0.8771 1.2
birth_cohort1795M1800 0.02094 -0.1317 0.18 1.021 0.8766 1.197
birth_cohort1800M1805 -0.02595 -0.1793 0.1283 0.9744 0.8359 1.137
birth_cohort1805M1810 -0.01225 -0.1623 0.141 0.9878 0.8502 1.151
birth_cohort1810M1815 0.01294 -0.1357 0.1676 1.013 0.8731 1.182
birth_cohort1815M1820 0.06559 -0.08069 0.2155 1.068 0.9225 1.24
birth_cohort1820M1825 0.08301 -0.06577 0.2362 1.087 0.9363 1.266
birth_cohort1825M1830 0.04113 -0.1062 0.1926 1.042 0.8992 1.212
birth_cohort1830M1835 0.06663 -0.08056 0.2195 1.069 0.9226 1.245
birth_cohort1835M1840 0.06655 -0.08007 0.2176 1.069 0.9231 1.243
birth_cohort1840M1845 0.0444 -0.1004 0.193 1.045 0.9045 1.213
birth_cohort1845M1850 0.05285 -0.09672 0.2055 1.054 0.9078 1.228
male1 0.04003 0.0266 0.0529 1.041 1.027 1.054
maternalage.factor1020 0.03605 -0.02243 0.09779 1.037 0.9778 1.103
maternalage.factor3559 0.06378 0.04305 0.08529 1.066 1.044 1.089
paternalage.mean 0.05943 0.02019 0.09945 1.061 1.02 1.105
paternal_loss01 0.0613 -0.01393 0.1348 1.063 0.9862 1.144
paternal_loss15 0.02618 -0.02047 0.07423 1.027 0.9797 1.077
paternal_loss510 -0.01845 -0.06041 0.02472 0.9817 0.9414 1.025
paternal_loss1015 -0.01865 -0.05661 0.01819 0.9815 0.945 1.018
paternal_loss1520 -0.07229 -0.1062 -0.03847 0.9303 0.8992 0.9623
paternal_loss2025 -0.0274 -0.05871 0.003651 0.973 0.943 1.004
paternal_loss2530 -0.02012 -0.04905 0.007979 0.9801 0.9521 1.008
paternal_loss3035 -0.01502 -0.04188 0.01251 0.9851 0.959 1.013
paternal_loss3540 0.02157 -0.004056 0.04719 1.022 0.996 1.048
paternal_loss4045 0.02784 0.003725 0.0527 1.028 1.004 1.054
maternal_loss01 0.06609 -0.0395 0.1687 1.068 0.9613 1.184
maternal_loss15 0.003091 -0.05279 0.0571 1.003 0.9486 1.059
maternal_loss510 -0.02009 -0.06685 0.02672 0.9801 0.9353 1.027
maternal_loss1015 -0.03614 -0.07773 0.007906 0.9645 0.9252 1.008
maternal_loss1520 -0.03579 -0.07548 0.00325 0.9648 0.9273 1.003
maternal_loss2025 -0.06972 -0.1052 -0.03426 0.9327 0.9001 0.9663
maternal_loss2530 -0.02715 -0.05837 0.003299 0.9732 0.9433 1.003
maternal_loss3035 -0.02087 -0.04813 0.006208 0.9793 0.953 1.006
maternal_loss3540 0.001899 -0.02243 0.02664 1.002 0.9778 1.027
maternal_loss4045 -0.0197 -0.04415 0.004451 0.9805 0.9568 1.004
older_siblings1 0.01615 -0.005112 0.03678 1.016 0.9949 1.037
older_siblings2 0.02853 -0.0001051 0.05689 1.029 0.9999 1.059
older_siblings3 0.03617 0.0001908 0.07061 1.037 1 1.073
older_siblings4 0.01242 -0.03208 0.05533 1.012 0.9684 1.057
older_siblings5P 0.02728 -0.02937 0.08278 1.028 0.9711 1.086
nr.siblings 0.02332 0.01841 0.0286 1.024 1.019 1.029
last_born1 -0.02141 -0.04059 -0.002621 0.9788 0.9602 0.9974
hu_Intercept -0.07106 -0.4369 0.3193 0.9314 0.6461 1.376
hu_paternalage 0.05008 -0.05602 0.1576 1.051 0.9455 1.171
hu_birth_cohort1750M1755 0.3691 -0.1812 0.9306 1.446 0.8342 2.536
hu_birth_cohort1755M1760 0.08635 -0.3793 0.5896 1.09 0.6843 1.803
hu_birth_cohort1760M1765 -0.03809 -0.4592 0.4013 0.9626 0.6318 1.494
hu_birth_cohort1765M1770 -0.326 -0.7615 0.09489 0.7218 0.467 1.1
hu_birth_cohort1770M1775 -0.09156 -0.5519 0.3359 0.9125 0.5758 1.399
hu_birth_cohort1775M1780 0.06498 -0.3675 0.4789 1.067 0.6925 1.614
hu_birth_cohort1780M1785 0.003627 -0.4207 0.4262 1.004 0.6566 1.531
hu_birth_cohort1785M1790 0.141 -0.2599 0.5211 1.151 0.7711 1.684
hu_birth_cohort1790M1795 0.3259 -0.06493 0.6751 1.385 0.9371 1.964
hu_birth_cohort1795M1800 0.1273 -0.2522 0.4995 1.136 0.7771 1.648
hu_birth_cohort1800M1805 0.04604 -0.3378 0.413 1.047 0.7134 1.511
hu_birth_cohort1805M1810 0.001124 -0.3685 0.3629 1.001 0.6917 1.438
hu_birth_cohort1810M1815 0.0776 -0.2956 0.4325 1.081 0.7441 1.541
hu_birth_cohort1815M1820 -0.09005 -0.4589 0.2658 0.9139 0.632 1.304
hu_birth_cohort1820M1825 -0.1936 -0.5717 0.1561 0.824 0.5646 1.169
hu_birth_cohort1825M1830 -0.1933 -0.5531 0.1627 0.8243 0.5752 1.177
hu_birth_cohort1830M1835 -0.1762 -0.549 0.1698 0.8385 0.5775 1.185
hu_birth_cohort1835M1840 -0.198 -0.568 0.1505 0.8204 0.5667 1.162
hu_birth_cohort1840M1845 -0.1857 -0.5498 0.1621 0.8305 0.5771 1.176
hu_birth_cohort1845M1850 -0.1479 -0.5109 0.1989 0.8625 0.5999 1.22
hu_male1 0.04445 0.005844 0.08398 1.045 1.006 1.088
hu_maternalage.factor1020 0.05567 -0.1169 0.2363 1.057 0.8897 1.267
hu_maternalage.factor3559 0.07085 0.01081 0.1292 1.073 1.011 1.138
hu_paternalage.mean -0.07667 -0.1876 0.02972 0.9262 0.829 1.03
hu_paternal_loss01 0.8656 0.683 1.049 2.376 1.98 2.855
hu_paternal_loss15 0.6704 0.5491 0.7914 1.955 1.732 2.207
hu_paternal_loss510 0.6884 0.5829 0.7942 1.991 1.791 2.213
hu_paternal_loss1015 0.5219 0.4273 0.6189 1.685 1.533 1.857
hu_paternal_loss1520 0.4226 0.3317 0.5108 1.526 1.393 1.667
hu_paternal_loss2025 0.3208 0.2384 0.4044 1.378 1.269 1.498
hu_paternal_loss2530 0.2244 0.1438 0.3025 1.252 1.155 1.353
hu_paternal_loss3035 0.1577 0.08387 0.234 1.171 1.087 1.264
hu_paternal_loss3540 0.1185 0.04583 0.1901 1.126 1.047 1.209
hu_paternal_loss4045 0.03928 -0.03519 0.1173 1.04 0.9654 1.124
hu_maternal_loss01 1.856 1.626 2.098 6.399 5.082 8.148
hu_maternal_loss15 1.022 0.8817 1.164 2.779 2.415 3.204
hu_maternal_loss510 0.863 0.7478 0.9803 2.37 2.112 2.665
hu_maternal_loss1015 0.8029 0.6886 0.9159 2.232 1.991 2.499
hu_maternal_loss1520 0.6719 0.5741 0.7711 1.958 1.776 2.162
hu_maternal_loss2025 0.4564 0.3693 0.5453 1.578 1.447 1.725
hu_maternal_loss2530 0.3137 0.2314 0.4013 1.368 1.26 1.494
hu_maternal_loss3035 0.2446 0.1717 0.3224 1.277 1.187 1.38
hu_maternal_loss3540 0.1431 0.07634 0.2093 1.154 1.079 1.233
hu_maternal_loss4045 0.07564 0.007096 0.1459 1.079 1.007 1.157
hu_older_siblings1 -0.04178 -0.1013 0.01796 0.9591 0.9037 1.018
hu_older_siblings2 -0.03587 -0.1188 0.04715 0.9648 0.888 1.048
hu_older_siblings3 -0.05262 -0.1498 0.04911 0.9487 0.8608 1.05
hu_older_siblings4 -0.08609 -0.2099 0.0391 0.9175 0.8107 1.04
hu_older_siblings5P -0.152 -0.3141 0.005718 0.859 0.7305 1.006
hu_nr.siblings 0.04772 0.03404 0.06186 1.049 1.035 1.064
hu_last_born1 0.007909 -0.04227 0.05887 1.008 0.9586 1.061

Paternal age effect

pander::pander(paternal_age_10y_effect(model))
effect median_estimate ci_95 ci_80
estimate father 25y 2.26 [1.78;2.79] [1.95;2.61]
estimate father 35y 2.1 [1.64;2.62] [1.79;2.43]
percentage change -7.29 [-13.4;-1.07] [-11.15;-3.33]
OR/IRR 0.95 [0.91;0.98] [0.92;0.97]
OR hurdle 1.05 [0.95;1.17] [0.98;1.13]

Marginal effect plots

plot.brmsMarginalEffects_shades(
    x = marginal_effects(model, re_formula = NA, probs = c(0.025,0.975)),
    y = marginal_effects(model, re_formula = NA, probs = c(0.1,0.9)), 
    ask = FALSE)

plot of chunk unnamed-chunk-37plot of chunk unnamed-chunk-37plot of chunk unnamed-chunk-37plot of chunk unnamed-chunk-37plot of chunk unnamed-chunk-37plot of chunk unnamed-chunk-37plot of chunk unnamed-chunk-37plot of chunk unnamed-chunk-37plot of chunk unnamed-chunk-37plot of chunk unnamed-chunk-37

Coefficient plot

Coefficient estimates (95% and 80% credibility).

mcmc_intervals(as.matrix(model$fit), regex_pars = "b_[^I]")
plot of chunk unnamed-chunk-38

plot of chunk unnamed-chunk-38

mcmc_areas(as.matrix(model$fit), regex_pars = "b")
plot of chunk unnamed-chunk-38

plot of chunk unnamed-chunk-38

Diagnostics

These plots were made to diagnose misfit and nonconvergence.

Posterior predictive checks

brms::pp_check(model, re_formula = NA, type = "dens_overlay")
plot of chunk unnamed-chunk-39

plot of chunk unnamed-chunk-39

brms::pp_check(model, re_formula = NA, type = "hist")
plot of chunk unnamed-chunk-39

plot of chunk unnamed-chunk-39

Rhat

Did the 6 chains converge?

stanplot(model, pars = "^b_[^I]", type = 'rhat')
plot of chunk unnamed-chunk-40

plot of chunk unnamed-chunk-40

Effective sample size by average sample size

stanplot(model, pars = "^b", type = 'ess')
plot of chunk unnamed-chunk-41

plot of chunk unnamed-chunk-41

Monte Carlo SE

stanplot(model, pars = "^b", type = 'mcse')
plot of chunk unnamed-chunk-42

plot of chunk unnamed-chunk-42

Trace plots

if(any( summary(model)$fixed[,"Rhat"] > 1.1)) { # only do traceplots if not converged
    plot(model, N = 3, ask = FALSE)
}

Further plots

stanplot(model, pars = "^b", type = 'diag')
plot of chunk unnamed-chunk-44

plot of chunk unnamed-chunk-44

File name

coefs/ddb/m3_children_linear.rds

Cluster script

opts_chunk$set(echo = FALSE)
clusterscript = str_replace(basename(model_filename), "\\.rds",".html")
cat("[Cluster script](" , clusterscript, ")", sep = "")

Cluster script

m4: Sibling comparison, nonlinear paternal age effect

Here, we compared siblings by including a random intercept for the family, and we modelled a possibly nonlinear effect for paternal age differences among siblings.

Model summary

Full summary

model_summary = summary(model, use_cache = FALSE, priors = TRUE)
print(model_summary)
##  Family: hurdle_poisson (log) 
## Formula: children ~ s(paternalage) + birth_cohort + male + maternalage.factor + paternalage.mean + paternal_loss + maternal_loss + older_siblings + nr.siblings + last_born + (1 | idParents) 
##          hu ~ s(paternalage) + birth_cohort + male + maternalage.factor + paternalage.mean + paternal_loss + maternal_loss + older_siblings + nr.siblings + last_born + (1 | idParents)
##    Data: model_data (Number of observations: 56663) 
## Samples: 6 chains, each with iter = 800; warmup = 300; thin = 1; 
##          total post-warmup samples = 3000
##    WAIC: Not computed
##  
## Priors: 
## b ~ normal(0,5)
## sd ~ student_t(3, 0, 5)
## sds ~ student_t(3, 0, 10)
## b_hu ~ normal(0,5)
## sd_hu ~ student_t(3, 0, 10)
## sds_hu ~ student_t(3, 0, 10)
## 
## Spline Effects: 
##                        Estimate Est.Error l-95% CI u-95% CI Eff.Sample
## sds(spaternalage_1)        0.28      0.19     0.03     0.75        904
## sds(hu_spaternalage_1)     0.36      0.33     0.01     1.30       1069
##                        Rhat
## sds(spaternalage_1)    1.01
## sds(hu_spaternalage_1) 1.00
## 
## Group-Level Effects: 
## ~idParents (Number of levels: 14746) 
##                  Estimate Est.Error l-95% CI u-95% CI Eff.Sample Rhat
## sd(Intercept)        0.36      0.01     0.35     0.37       1239 1.01
## sd(hu_Intercept)     0.82      0.02     0.79     0.85        818 1.00
## 
## Population-Level Effects: 
##                           Estimate Est.Error l-95% CI u-95% CI Eff.Sample
## Intercept                     1.15      0.11     0.93     1.35        220
## birth_cohort1750M1755        -0.17      0.12    -0.39     0.06        484
## birth_cohort1755M1760         0.09      0.10    -0.09     0.28        226
## birth_cohort1760M1765         0.15      0.09    -0.02     0.33        177
## birth_cohort1765M1770         0.10      0.09    -0.07     0.28        166
## birth_cohort1770M1775         0.06      0.09    -0.10     0.25        166
## birth_cohort1775M1780         0.05      0.09    -0.11     0.22        165
## birth_cohort1780M1785         0.16      0.09    -0.01     0.32        156
## birth_cohort1785M1790         0.13      0.08    -0.03     0.30        151
## birth_cohort1790M1795         0.03      0.08    -0.13     0.19        158
## birth_cohort1795M1800         0.02      0.08    -0.13     0.18        142
## birth_cohort1800M1805        -0.02      0.08    -0.18     0.14        141
## birth_cohort1805M1810        -0.01      0.08    -0.16     0.14        139
## birth_cohort1810M1815         0.02      0.08    -0.13     0.17        138
## birth_cohort1815M1820         0.07      0.08    -0.08     0.22        136
## birth_cohort1820M1825         0.09      0.08    -0.06     0.24        133
## birth_cohort1825M1830         0.04      0.08    -0.10     0.20        134
## birth_cohort1830M1835         0.07      0.08    -0.08     0.23        133
## birth_cohort1835M1840         0.07      0.08    -0.08     0.23        133
## birth_cohort1840M1845         0.05      0.08    -0.10     0.21        133
## birth_cohort1845M1850         0.06      0.08    -0.09     0.21        132
## male1                         0.04      0.01     0.03     0.05       3000
## maternalage.factor1020        0.04      0.03    -0.02     0.10       3000
## maternalage.factor3559        0.06      0.01     0.04     0.08       3000
## paternalage.mean              0.06      0.02     0.01     0.10        622
## paternal_loss01               0.06      0.04    -0.01     0.13       1762
## paternal_loss15               0.03      0.02    -0.02     0.08       1283
## paternal_loss510             -0.02      0.02    -0.06     0.02       1318
## paternal_loss1015            -0.02      0.02    -0.06     0.02       1142
## paternal_loss1520            -0.08      0.02    -0.11    -0.04       1168
## paternal_loss2025            -0.03      0.02    -0.06     0.00       1199
## paternal_loss2530            -0.02      0.02    -0.05     0.01       1113
## paternal_loss3035            -0.02      0.01    -0.05     0.01       1199
## paternal_loss3540             0.02      0.01    -0.01     0.04       1202
## paternal_loss4045             0.02      0.01     0.00     0.05       1669
## maternal_loss01               0.07      0.06    -0.04     0.17       2209
## maternal_loss15               0.00      0.03    -0.05     0.06       1979
## maternal_loss510             -0.02      0.02    -0.06     0.03       1580
## maternal_loss1015            -0.03      0.02    -0.08     0.01       1776
## maternal_loss1520            -0.03      0.02    -0.07     0.00       1668
## maternal_loss2025            -0.07      0.02    -0.10    -0.04       1857
## maternal_loss2530            -0.03      0.02    -0.06     0.00       1739
## maternal_loss3035            -0.02      0.01    -0.05     0.01       1842
## maternal_loss3540             0.00      0.01    -0.02     0.03       1771
## maternal_loss4045            -0.02      0.01    -0.04     0.00       2209
## older_siblings1               0.01      0.01    -0.01     0.04        919
## older_siblings2               0.02      0.01     0.00     0.05        740
## older_siblings3               0.03      0.02    -0.01     0.07        649
## older_siblings4               0.00      0.02    -0.04     0.05        628
## older_siblings5P              0.02      0.03    -0.04     0.07        587
## nr.siblings                   0.02      0.00     0.02     0.03        659
## last_born1                   -0.02      0.01    -0.04     0.00       3000
## spaternalage_1               -0.05      0.04    -0.14     0.03       1110
## hu_Intercept                  0.09      0.28    -0.45     0.64        364
## hu_birth_cohort1750M1755      0.36      0.28    -0.16     0.92        770
## hu_birth_cohort1755M1760      0.08      0.24    -0.39     0.55        465
## hu_birth_cohort1760M1765     -0.04      0.22    -0.46     0.38        369
## hu_birth_cohort1765M1770     -0.34      0.22    -0.78     0.08        347
## hu_birth_cohort1770M1775     -0.10      0.22    -0.55     0.33        347
## hu_birth_cohort1775M1780      0.06      0.21    -0.36     0.45        314
## hu_birth_cohort1780M1785     -0.01      0.21    -0.42     0.40        340
## hu_birth_cohort1785M1790      0.14      0.20    -0.25     0.52        292
## hu_birth_cohort1790M1795      0.32      0.19    -0.05     0.69        276
## hu_birth_cohort1795M1800      0.12      0.18    -0.24     0.47        268
## hu_birth_cohort1800M1805      0.04      0.19    -0.32     0.40        268
## hu_birth_cohort1805M1810      0.00      0.18    -0.36     0.34        258
## hu_birth_cohort1810M1815      0.07      0.18    -0.29     0.40        256
## hu_birth_cohort1815M1820     -0.10      0.18    -0.45     0.23        250
## hu_birth_cohort1820M1825     -0.20      0.18    -0.56     0.13        249
## hu_birth_cohort1825M1830     -0.20      0.18    -0.55     0.13        249
## hu_birth_cohort1830M1835     -0.18      0.18    -0.54     0.15        251
## hu_birth_cohort1835M1840     -0.20      0.18    -0.55     0.12        254
## hu_birth_cohort1840M1845     -0.19      0.18    -0.54     0.14        253
## hu_birth_cohort1845M1850     -0.16      0.18    -0.51     0.18        251
## hu_male1                      0.04      0.02     0.01     0.08       3000
## hu_maternalage.factor1020     0.06      0.09    -0.12     0.24       3000
## hu_maternalage.factor3559     0.07      0.03     0.01     0.13       3000
## hu_paternalage.mean          -0.07      0.06    -0.18     0.04        670
## hu_paternal_loss01            0.87      0.09     0.68     1.05       3000
## hu_paternal_loss15            0.67      0.06     0.55     0.79       1731
## hu_paternal_loss510           0.69      0.05     0.59     0.79       1450
## hu_paternal_loss1015          0.52      0.05     0.43     0.61       1503
## hu_paternal_loss1520          0.42      0.04     0.33     0.51       1377
## hu_paternal_loss2025          0.32      0.04     0.24     0.40       1219
## hu_paternal_loss2530          0.23      0.04     0.15     0.31       1260
## hu_paternal_loss3035          0.16      0.04     0.08     0.24       1440
## hu_paternal_loss3540          0.12      0.04     0.05     0.19       1382
## hu_paternal_loss4045          0.04      0.04    -0.03     0.12       3000
## hu_maternal_loss01            1.85      0.12     1.61     2.08       3000
## hu_maternal_loss15            1.02      0.07     0.89     1.15       2186
## hu_maternal_loss510           0.87      0.06     0.75     0.98       1803
## hu_maternal_loss1015          0.81      0.06     0.69     0.91       3000
## hu_maternal_loss1520          0.67      0.05     0.58     0.77       3000
## hu_maternal_loss2025          0.46      0.05     0.37     0.55       1666
## hu_maternal_loss2530          0.32      0.04     0.24     0.40       2060
## hu_maternal_loss3035          0.24      0.04     0.17     0.32       1829
## hu_maternal_loss3540          0.14      0.04     0.07     0.21       3000
## hu_maternal_loss4045          0.08      0.03     0.01     0.14       3000
## hu_older_siblings1           -0.04      0.03    -0.10     0.03       1202
## hu_older_siblings2           -0.03      0.04    -0.11     0.05        787
## hu_older_siblings3           -0.04      0.06    -0.15     0.07        728
## hu_older_siblings4           -0.07      0.07    -0.20     0.06        703
## hu_older_siblings5P          -0.13      0.09    -0.31     0.03        635
## hu_nr.siblings                0.05      0.01     0.03     0.06        682
## hu_last_born1                 0.01      0.03    -0.04     0.06       3000
## hu_spaternalage_1             0.03      0.08    -0.13     0.21        656
##                           Rhat
## Intercept                 1.00
## birth_cohort1750M1755     1.00
## birth_cohort1755M1760     1.01
## birth_cohort1760M1765     1.01
## birth_cohort1765M1770     1.01
## birth_cohort1770M1775     1.01
## birth_cohort1775M1780     1.01
## birth_cohort1780M1785     1.01
## birth_cohort1785M1790     1.01
## birth_cohort1790M1795     1.01
## birth_cohort1795M1800     1.01
## birth_cohort1800M1805     1.01
## birth_cohort1805M1810     1.01
## birth_cohort1810M1815     1.01
## birth_cohort1815M1820     1.01
## birth_cohort1820M1825     1.01
## birth_cohort1825M1830     1.01
## birth_cohort1830M1835     1.01
## birth_cohort1835M1840     1.01
## birth_cohort1840M1845     1.01
## birth_cohort1845M1850     1.01
## male1                     1.00
## maternalage.factor1020    1.00
## maternalage.factor3559    1.00
## paternalage.mean          1.01
## paternal_loss01           1.00
## paternal_loss15           1.00
## paternal_loss510          1.00
## paternal_loss1015         1.00
## paternal_loss1520         1.00
## paternal_loss2025         1.00
## paternal_loss2530         1.00
## paternal_loss3035         1.00
## paternal_loss3540         1.00
## paternal_loss4045         1.00
## maternal_loss01           1.00
## maternal_loss15           1.00
## maternal_loss510          1.00
## maternal_loss1015         1.00
## maternal_loss1520         1.00
## maternal_loss2025         1.00
## maternal_loss2530         1.00
## maternal_loss3035         1.00
## maternal_loss3540         1.00
## maternal_loss4045         1.00
## older_siblings1           1.00
## older_siblings2           1.01
## older_siblings3           1.01
## older_siblings4           1.01
## older_siblings5P          1.01
## nr.siblings               1.01
## last_born1                1.00
## spaternalage_1            1.00
## hu_Intercept              1.01
## hu_birth_cohort1750M1755  1.01
## hu_birth_cohort1755M1760  1.01
## hu_birth_cohort1760M1765  1.02
## hu_birth_cohort1765M1770  1.02
## hu_birth_cohort1770M1775  1.02
## hu_birth_cohort1775M1780  1.02
## hu_birth_cohort1780M1785  1.02
## hu_birth_cohort1785M1790  1.02
## hu_birth_cohort1790M1795  1.02
## hu_birth_cohort1795M1800  1.02
## hu_birth_cohort1800M1805  1.02
## hu_birth_cohort1805M1810  1.03
## hu_birth_cohort1810M1815  1.02
## hu_birth_cohort1815M1820  1.03
## hu_birth_cohort1820M1825  1.02
## hu_birth_cohort1825M1830  1.03
## hu_birth_cohort1830M1835  1.03
## hu_birth_cohort1835M1840  1.02
## hu_birth_cohort1840M1845  1.02
## hu_birth_cohort1845M1850  1.02
## hu_male1                  1.00
## hu_maternalage.factor1020 1.00
## hu_maternalage.factor3559 1.00
## hu_paternalage.mean       1.01
## hu_paternal_loss01        1.00
## hu_paternal_loss15        1.00
## hu_paternal_loss510       1.00
## hu_paternal_loss1015      1.00
## hu_paternal_loss1520      1.00
## hu_paternal_loss2025      1.00
## hu_paternal_loss2530      1.00
## hu_paternal_loss3035      1.00
## hu_paternal_loss3540      1.00
## hu_paternal_loss4045      1.00
## hu_maternal_loss01        1.00
## hu_maternal_loss15        1.00
## hu_maternal_loss510       1.00
## hu_maternal_loss1015      1.00
## hu_maternal_loss1520      1.00
## hu_maternal_loss2025      1.00
## hu_maternal_loss2530      1.00
## hu_maternal_loss3035      1.00
## hu_maternal_loss3540      1.00
## hu_maternal_loss4045      1.00
## hu_older_siblings1        1.00
## hu_older_siblings2        1.00
## hu_older_siblings3        1.00
## hu_older_siblings4        1.00
## hu_older_siblings5P       1.00
## hu_nr.siblings            1.00
## hu_last_born1             1.00
## hu_spaternalage_1         1.01
## 
## Samples were drawn using sampling(NUTS). For each parameter, Eff.Sample 
## is a crude measure of effective sample size, and Rhat is the potential 
## scale reduction factor on split chains (at convergence, Rhat = 1).

Table of fixed effects

fixed_eff = data.frame(model_summary$fixed, check.names = F)
fixed_eff$Est.Error = fixed_eff$Eff.Sample = fixed_eff$Rhat = NULL
fixed_eff$OR = exp(fixed_eff$Estimate)
fixed_eff$OR_low = exp(fixed_eff$`l-95% CI`)
fixed_eff$OR_high = exp(fixed_eff$`u-95% CI`)
pander::pander(fixed_eff)
  Estimate l-95% CI u-95% CI OR OR_low OR_high
Intercept 1.146 0.9334 1.349 3.145 2.543 3.853
birth_cohort1750M1755 -0.171 -0.3891 0.05658 0.8428 0.6777 1.058
birth_cohort1755M1760 0.09323 -0.08979 0.2829 1.098 0.9141 1.327
birth_cohort1760M1765 0.1505 -0.01895 0.3288 1.162 0.9812 1.389
birth_cohort1765M1770 0.09953 -0.06835 0.2826 1.105 0.9339 1.327
birth_cohort1770M1775 0.06264 -0.1049 0.2457 1.065 0.9004 1.278
birth_cohort1775M1780 0.05023 -0.1111 0.2249 1.052 0.8949 1.252
birth_cohort1780M1785 0.1557 -0.006093 0.3237 1.168 0.9939 1.382
birth_cohort1785M1790 0.1271 -0.03011 0.295 1.135 0.9703 1.343
birth_cohort1790M1795 0.0269 -0.1295 0.1909 1.027 0.8786 1.21
birth_cohort1795M1800 0.02269 -0.1337 0.1835 1.023 0.8749 1.201
birth_cohort1800M1805 -0.0235 -0.1772 0.1397 0.9768 0.8376 1.15
birth_cohort1805M1810 -0.009418 -0.1622 0.1441 0.9906 0.8503 1.155
birth_cohort1810M1815 0.01506 -0.1328 0.1745 1.015 0.8757 1.191
birth_cohort1815M1820 0.06802 -0.08174 0.2221 1.07 0.9215 1.249
birth_cohort1820M1825 0.08606 -0.06388 0.2417 1.09 0.9381 1.273
birth_cohort1825M1830 0.04424 -0.1042 0.1989 1.045 0.901 1.22
birth_cohort1830M1835 0.06937 -0.08199 0.2262 1.072 0.9213 1.254
birth_cohort1835M1840 0.06932 -0.07854 0.2268 1.072 0.9245 1.255
birth_cohort1840M1845 0.04733 -0.1047 0.2056 1.048 0.9006 1.228
birth_cohort1845M1850 0.05558 -0.09218 0.2113 1.057 0.9119 1.235
male1 0.0399 0.02705 0.05356 1.041 1.027 1.055
maternalage.factor1020 0.03626 -0.02197 0.09677 1.037 0.9783 1.102
maternalage.factor3559 0.06266 0.04219 0.08354 1.065 1.043 1.087
paternalage.mean 0.05587 0.0138 0.0958 1.057 1.014 1.101
paternal_loss01 0.05895 -0.01442 0.1314 1.061 0.9857 1.14
paternal_loss15 0.02578 -0.02146 0.07518 1.026 0.9788 1.078
paternal_loss510 -0.01969 -0.06247 0.02417 0.9805 0.9394 1.024
paternal_loss1015 -0.02056 -0.05769 0.01605 0.9796 0.9439 1.016
paternal_loss1520 -0.07511 -0.1089 -0.0406 0.9276 0.8969 0.9602
paternal_loss2025 -0.03052 -0.06174 0.0007074 0.9699 0.9401 1.001
paternal_loss2530 -0.02347 -0.05339 0.006053 0.9768 0.948 1.006
paternal_loss3035 -0.01891 -0.0475 0.009672 0.9813 0.9536 1.01
paternal_loss3540 0.01805 -0.008224 0.04364 1.018 0.9918 1.045
paternal_loss4045 0.02492 -0.0006503 0.05141 1.025 0.9993 1.053
maternal_loss01 0.0667 -0.04026 0.1737 1.069 0.9605 1.19
maternal_loss15 0.003787 -0.05265 0.05873 1.004 0.9487 1.06
maternal_loss510 -0.01855 -0.06216 0.02789 0.9816 0.9397 1.028
maternal_loss1015 -0.03444 -0.07707 0.008587 0.9662 0.9258 1.009
maternal_loss1520 -0.03378 -0.07252 0.004797 0.9668 0.93 1.005
maternal_loss2025 -0.06931 -0.1031 -0.03524 0.933 0.902 0.9654
maternal_loss2530 -0.02598 -0.05633 0.003463 0.9744 0.9452 1.003
maternal_loss3035 -0.01981 -0.04741 0.006907 0.9804 0.9537 1.007
maternal_loss3540 0.002536 -0.02207 0.02672 1.003 0.9782 1.027
maternal_loss4045 -0.01957 -0.0438 0.004834 0.9806 0.9571 1.005
older_siblings1 0.01421 -0.006461 0.03564 1.014 0.9936 1.036
older_siblings2 0.02379 -0.004623 0.05255 1.024 0.9954 1.054
older_siblings3 0.02846 -0.008341 0.06584 1.029 0.9917 1.068
older_siblings4 0.002536 -0.04177 0.04727 1.003 0.9591 1.048
older_siblings5P 0.01542 -0.04226 0.0726 1.016 0.9586 1.075
nr.siblings 0.02402 0.01861 0.02951 1.024 1.019 1.03
last_born1 -0.02128 -0.0395 -0.00296 0.9789 0.9613 0.997
spaternalage_1 -0.04981 -0.1373 0.03115 0.9514 0.8717 1.032
hu_Intercept 0.08785 -0.4535 0.6429 1.092 0.6354 1.902
hu_birth_cohort1750M1755 0.3619 -0.1565 0.9162 1.436 0.8551 2.5
hu_birth_cohort1755M1760 0.07907 -0.3859 0.5461 1.082 0.6798 1.727
hu_birth_cohort1760M1765 -0.04432 -0.4571 0.3791 0.9567 0.6331 1.461
hu_birth_cohort1765M1770 -0.337 -0.7759 0.08238 0.7139 0.4603 1.086
hu_birth_cohort1770M1775 -0.1028 -0.5458 0.3293 0.9023 0.5794 1.39
hu_birth_cohort1775M1780 0.05545 -0.3565 0.4472 1.057 0.7001 1.564
hu_birth_cohort1780M1785 -0.005673 -0.4165 0.4048 0.9943 0.6593 1.499
hu_birth_cohort1785M1790 0.1392 -0.2526 0.5187 1.149 0.7768 1.68
hu_birth_cohort1790M1795 0.3209 -0.05496 0.6903 1.378 0.9465 1.994
hu_birth_cohort1795M1800 0.1209 -0.2358 0.4657 1.129 0.7899 1.593
hu_birth_cohort1800M1805 0.04028 -0.3154 0.4007 1.041 0.7295 1.493
hu_birth_cohort1805M1810 -0.004422 -0.3595 0.3398 0.9956 0.698 1.405
hu_birth_cohort1810M1815 0.06894 -0.2947 0.405 1.071 0.7447 1.499
hu_birth_cohort1815M1820 -0.0964 -0.449 0.23 0.9081 0.6383 1.259
hu_birth_cohort1820M1825 -0.2015 -0.5585 0.1312 0.8175 0.5721 1.14
hu_birth_cohort1825M1830 -0.201 -0.5489 0.1343 0.8179 0.5776 1.144
hu_birth_cohort1830M1835 -0.1847 -0.5373 0.1491 0.8314 0.5843 1.161
hu_birth_cohort1835M1840 -0.205 -0.5519 0.1209 0.8147 0.5758 1.129
hu_birth_cohort1840M1845 -0.1916 -0.5383 0.1435 0.8256 0.5838 1.154
hu_birth_cohort1845M1850 -0.156 -0.5073 0.1797 0.8556 0.6021 1.197
hu_male1 0.04477 0.006618 0.08222 1.046 1.007 1.086
hu_maternalage.factor1020 0.0569 -0.1203 0.2356 1.059 0.8866 1.266
hu_maternalage.factor3559 0.06993 0.01404 0.1289 1.072 1.014 1.138
hu_paternalage.mean -0.0714 -0.1842 0.03707 0.9311 0.8317 1.038
hu_paternal_loss01 0.8651 0.6812 1.047 2.375 1.976 2.849
hu_paternal_loss15 0.667 0.5453 0.7885 1.948 1.725 2.2
hu_paternal_loss510 0.6892 0.5907 0.7926 1.992 1.805 2.209
hu_paternal_loss1015 0.5208 0.4256 0.6148 1.683 1.531 1.849
hu_paternal_loss1520 0.4232 0.3321 0.5083 1.527 1.394 1.662
hu_paternal_loss2025 0.3215 0.2392 0.4026 1.379 1.27 1.496
hu_paternal_loss2530 0.2272 0.1466 0.308 1.255 1.158 1.361
hu_paternal_loss3035 0.1611 0.08459 0.2363 1.175 1.088 1.267
hu_paternal_loss3540 0.1219 0.04828 0.1926 1.13 1.049 1.212
hu_paternal_loss4045 0.04247 -0.03429 0.1199 1.043 0.9663 1.127
hu_maternal_loss01 1.851 1.615 2.079 6.365 5.026 8
hu_maternal_loss15 1.023 0.8892 1.154 2.781 2.433 3.171
hu_maternal_loss510 0.8654 0.7504 0.9793 2.376 2.118 2.663
hu_maternal_loss1015 0.8057 0.6918 0.9142 2.238 1.997 2.495
hu_maternal_loss1520 0.6707 0.5756 0.7691 1.956 1.778 2.158
hu_maternal_loss2025 0.4574 0.3652 0.5462 1.58 1.441 1.727
hu_maternal_loss2530 0.3152 0.2355 0.3958 1.37 1.266 1.486
hu_maternal_loss3035 0.2448 0.1685 0.3197 1.277 1.183 1.377
hu_maternal_loss3540 0.144 0.07307 0.2147 1.155 1.076 1.24
hu_maternal_loss4045 0.07551 0.008551 0.1417 1.078 1.009 1.152
hu_older_siblings1 -0.03633 -0.09934 0.02612 0.9643 0.9054 1.026
hu_older_siblings2 -0.02577 -0.1115 0.05428 0.9746 0.8945 1.056
hu_older_siblings3 -0.03872 -0.1489 0.06865 0.962 0.8616 1.071
hu_older_siblings4 -0.06891 -0.204 0.06494 0.9334 0.8154 1.067
hu_older_siblings5P -0.1324 -0.3103 0.0298 0.876 0.7332 1.03
hu_nr.siblings 0.04673 0.03223 0.06244 1.048 1.033 1.064
hu_last_born1 0.007565 -0.04349 0.05673 1.008 0.9574 1.058
hu_spaternalage_1 0.03392 -0.1332 0.2057 1.035 0.8753 1.228

Paternal age effect

pander::pander(paternal_age_10y_effect(model))
effect median_estimate ci_95 ci_80
estimate father 25y 2.23 [1.76;2.78] [1.9;2.57]
estimate father 35y 2.13 [1.67;2.69] [1.81;2.47]
percentage change -4.43 [-11.65;2.93] [-9.1;0.47]
OR/IRR 0.95 [0.87;1.03] [0.9;1]
OR hurdle 1.03 [0.88;1.23] [0.94;1.13]

Marginal effect plots

plot.brmsMarginalEffects_shades(
    x = marginal_effects(model, re_formula = NA, probs = c(0.025,0.975)),
    y = marginal_effects(model, re_formula = NA, probs = c(0.1,0.9)), 
    ask = FALSE)

plot of chunk unnamed-chunk-50plot of chunk unnamed-chunk-50plot of chunk unnamed-chunk-50plot of chunk unnamed-chunk-50plot of chunk unnamed-chunk-50plot of chunk unnamed-chunk-50plot of chunk unnamed-chunk-50plot of chunk unnamed-chunk-50plot of chunk unnamed-chunk-50plot of chunk unnamed-chunk-50

Coefficient plot

Coefficient estimates (95% and 80% credibility).

mcmc_intervals(as.matrix(model$fit), regex_pars = "b_[^I]")
plot of chunk unnamed-chunk-51

plot of chunk unnamed-chunk-51

mcmc_areas(as.matrix(model$fit), regex_pars = "b")
plot of chunk unnamed-chunk-51

plot of chunk unnamed-chunk-51

Diagnostics

These plots were made to diagnose misfit and nonconvergence.

Posterior predictive checks

brms::pp_check(model, re_formula = NA, type = "dens_overlay")
plot of chunk unnamed-chunk-52

plot of chunk unnamed-chunk-52

brms::pp_check(model, re_formula = NA, type = "hist")
plot of chunk unnamed-chunk-52

plot of chunk unnamed-chunk-52

Rhat

Did the 6 chains converge?

stanplot(model, pars = "^b_[^I]", type = 'rhat')
plot of chunk unnamed-chunk-53

plot of chunk unnamed-chunk-53

Effective sample size by average sample size

stanplot(model, pars = "^b", type = 'ess')
plot of chunk unnamed-chunk-54

plot of chunk unnamed-chunk-54

Monte Carlo SE

stanplot(model, pars = "^b", type = 'mcse')
plot of chunk unnamed-chunk-55

plot of chunk unnamed-chunk-55

Trace plots

if(any( summary(model)$fixed[,"Rhat"] > 1.1)) { # only do traceplots if not converged
    plot(model, N = 3, ask = FALSE)
}

Further plots

stanplot(model, pars = "^b", type = 'diag')
plot of chunk unnamed-chunk-57

plot of chunk unnamed-chunk-57

File name

coefs/ddb/m4_children_nonlinear.rds

Cluster script

opts_chunk$set(echo = FALSE)
clusterscript = str_replace(basename(model_filename), "\\.rds",".html")
cat("[Cluster script](" , clusterscript, ")", sep = "")

Cluster script

Model comparison

We compare the four models using an approximative leave-one-out cross-validation information criterion as implemented in brms and loo and the Watanabe-Akaike information criterion.

##             LOOIC     SE
## m1      191797.98 758.74
## m2      185251.17 723.02
## m3      185225.78 722.90
## m4      185248.05 723.02
## m1 - m2   6546.81 217.76
## m1 - m3   6572.20 218.12
## m1 - m4   6549.93 218.30
## m2 - m3     25.39  15.36
## m2 - m4      3.12  16.38
## m3 - m4    -22.27  14.58

plot of chunk unnamed-chunk-6plot of chunk unnamed-chunk-6plot of chunk unnamed-chunk-6plot of chunk unnamed-chunk-6

##              WAIC     SE
## m1      191797.98 758.74
## m2      184257.60 715.33
## m3      184249.95 715.39
## m4      184258.71 715.41
## m1 - m2   7540.38 219.52
## m1 - m3   7548.03 219.78
## m1 - m4   7539.27 219.87
## m2 - m3      7.65  11.75
## m2 - m4     -1.11  12.89
## m3 - m4     -8.76  10.85