PART 1: ‘Minimal’ models (testing maternal effects - Predictions 1 & 2)

Default code for minimal models for ALL the continuous traits

This file is to be used with the continuous life-history traits from the study (duration of larval development, body mass and adult lifespan). We alternate between analyses of respective traits through assigning them into the response variable y.

Data preparation

Load libraries and read the full dataset (N = 3 431). We analyse data on female and male offspring separately due to the profound sexual dimorphism in seed beetle life history. We remove offspring of dams for which host preference was not recorded. We also exclude outliers in the response variable that are larger than 3-times trait SD.

Adult lifespan of female offspring (daughters)

## [1] "The number of removed missing and outlier values:"
## [1] 19
##      Cowpea   Mung
## mean 22.926 26.189
## SD    6.368  6.129
## SE    0.093  0.095
## 'data.frame':    1425 obs. of  27 variables:
##  $ day.mated : Factor w/ 6 levels "11.3.18","12.3.18",..: 3 3 3 3 3 3 3 3 3 3 ...
##  $ IDf       : Factor w/ 246 levels "d101","d102",..: 1 1 1 1 1 2 2 2 2 2 ...
##  $ IDm       : Factor w/ 82 levels "s11","s12","s13",..: 18 18 18 18 18 20 20 20 20 20 ...
##  $ ord.f     : int  1 1 1 1 1 1 1 1 1 1 ...
##  $ pref.C    : int  8 8 8 8 8 3 3 3 3 3 ...
##  $ pref.tot  : int  13 13 13 13 13 10 10 10 10 10 ...
##  $ host      : Factor w/ 2 levels "C","M": 2 2 1 1 1 1 2 1 2 2 ...
##  $ Whost     : num  70.9 62.6 328.4 310.1 210.4 ...
##  $ IDo       : int  1 3 6 7 8 1 2 3 3 5 ...
##  $ code      : Factor w/ 1425 levels "C-101-6","C-101-7",..: 745 746 1 2 3 4 747 5 748 749 ...
##  $ state     : Factor w/ 1 level "emerged": 1 1 1 1 1 1 1 1 1 1 ...
##  $ day.em    : Factor w/ 19 levels "1.5.18","10.4.18",..: 5 4 8 6 4 5 4 5 4 4 ...
##  $ dev.dur.o : int  31 30 34 32 30 31 30 31 30 30 ...
##  $ Wo        : num  7.98 7.79 5.99 5.55 7.03 ...
##  $ sex       : Factor w/ 1 level "f": 1 1 1 1 1 1 1 1 1 1 ...
##  $ mated     : Factor w/ 3 levels "not","succ","unsucc": 2 2 1 2 2 2 1 2 1 2 ...
##  $ pref.C.o  : int  0 10 NA 15 9 15 NA 18 NA 10 ...
##  $ pref.tot.o: int  1 19 NA 31 13 21 NA 20 NA 19 ...
##  $ day.dead  : Factor w/ 39 levels "1.5.18","10.5.18",..: 16 6 8 12 12 30 2 35 14 36 ...
##  $ adsurv.o  : int  38 32 30 18 20 16 28 22 38 24 ...
##  $ rel.pref  : num  0.615 0.615 0.615 0.615 0.615 ...
##  $ rel.pref.o: num  0 0.526 NA 0.484 0.692 ...
##  $ y         : int  38 32 30 18 20 16 28 22 38 24 ...
##  $ WH        : num  -0.154 -1.226 0.84 0.434 -1.774 ...
##  $ PREF      : num  -0.398 -0.398 -0.398 -0.398 -0.398 ...
##  $ date      : num  3 3 3 3 3 3 3 3 3 3 ...
##  $ DATE      : num  -0.478 -0.478 -0.478 -0.478 -0.478 ...
Creating pedigree for the animal model approach

We have dams, sires and their offspring, i.e. parental and offspring generation.

##   offspring dams sires
## 1      1425  246    82

Bayesian ‘animal’ model approach to comparison of minimal models (DIC) and phenotypic variance partitioning

The minimal model contains only fixed effects stemming from our experimental design. The fixed effects are: host type (host, “C” (original)/“M” (novel)), bean mass (WH, standardized within each host type), dam mating order (ord.f, mating sequence, 1 to 4), and day mated (DATE, 1-6). Additive genetic variance is specified using the pedigree and the identity of the offspring as animal in the random-effect part. Maternal effects above the additive genetic variance (including non-genetic and genetic maternal effects, but also genetic dominance) is specified with calling dam in the random-effect part of the model. We defined the random effects for each host separately as interaction with host - animal (host:animal) and dam (host:dam). We extracted additive genetic (proxy of GxE) and maternal effects covariance (MxE) between novel and original host using term us (unstructured). We called host-specific variance only (with idh) in the models where we ignore covariance between the additive genetic (or maternal) effects in different host types. Residual variance was allowed to be estimated separately per host type (rcov=~idh(host):units).

Below, we provide outcome for each of the alternative models that estimate additive genetic variance and maternal effects differently per host. They include/exclude specific variance per host type and the cross-host covariance.


The Gcov + Mcov model

Here, we specify both separate variance per host type and the cross-environmental covariance for both additive genetic (animal) and maternal effects (dam). We estimate residual variance (units) separately per each host type.

## [1]   1   6  16  26  31  61  76  91 121
##  [1]   1   6  11  16  21  26  28  31  33  41  46  51  56  61  66  71  76  77  81
## [20]  82  91  96 101 106 111 116 121 126 127 131 132 141 146 151 156 161 166 176
## [39] 181 186 191 196 201 206 211 221 226 231 241 251 256 261 266 271 276 281 286
## [58] 291 301 306 311 316 321 326 331 336 341 366 376 381 386 401 406 411 416 421
## [77] 426 431 441 446 451 456 461 466 491 496
## 
##  Iterations = 50001:549501
##  Thinning interval  = 500
##  Sample size  = 1000 
## 
##  DIC: 8894.491 
## 
##  G-structure:  ~us(host):animal
## 
##                    post.mean l-95% CI u-95% CI eff.samp
## hostC:hostC.animal     16.80    9.165    26.52     1000
## hostM:hostC.animal     14.31    8.130    20.67     1000
## hostC:hostM.animal     14.31    8.130    20.67     1000
## hostM:hostM.animal     18.52   10.376    27.38     1000
## 
##                ~us(host):dam
## 
##                 post.mean   l-95% CI u-95% CI eff.samp
## hostC:hostC.dam    1.0841  1.211e-05    3.673     1212
## hostM:hostC.dam    0.0453 -8.536e-01    1.157     1000
## hostC:hostM.dam    0.0453 -8.536e-01    1.157     1000
## hostM:hostM.dam    0.7122  2.430e-07    2.530     1000
## 
##  R-structure:  ~idh(host):units
## 
##             post.mean l-95% CI u-95% CI eff.samp
## hostC.units     22.43    16.48    27.98     1000
## hostM.units     19.29    13.12    25.46     1000
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean l-95% CI u-95% CI eff.samp  pMCMC    
## (Intercept)  23.43644 22.23644 24.52722   1000.0 <0.001 ***
## hostM         3.37970  2.60747  4.09727   1000.0 <0.001 ***
## WH           -0.25974 -0.54514  0.05355   1165.4  0.098 .  
## ord.f        -0.34362 -0.74061  0.08847   1104.0  0.118    
## DATE          0.28411 -0.40577  0.83805    871.8  0.352    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 25.65444 mins
Estimating heritability, evolvability and maternal effects

We calculate heritability, evolvability and maternal effects proportion based on the minimal model, i.e. after accounting for the design effects (bean mass, dam mating order, day mated). Additive genetic variance is given by animal and maternal effects variance by dam.

Additive genetic variance: \(V_{A} = V_{animal}\)

Maternal effects above the additive genetic effects: \(V_M = V_{dam}\)

Maternal effects proportion: \(m^2 = V_{M}/(V_{A} + V_{M} + V_{residual})\)

Heritability: \(h^{2} = V_{A}/(V_{A} + V_{M} + V_{residual})\)

Coef. of add. gen. variation: \(CV_{A} = \sqrt{V_{A}}/\overline{y}\)

Evolvability: \(e_{\mu} = V_{A}/\overline{y}^2\), or \(e_{\mu} = CV_{A}^2\)

Parameter estimates in the original host type (Cowpea)

##         Est         CredI
## Vadd 15.218  9.165,26.516
## Vmat  0.018       0,3.673
## Vres 22.342 16.481,27.979
## Vtot 39.745 36.153,45.302
## m2    0.000       0,0.093
## h2    0.376   0.238,0.605
## CVa   0.170   0.132,0.225
## emu   0.029    0.017,0.05

and in the novel host type (Mung)

##         Est         CredI
## Vadd 18.308 10.376,27.377
## Vmat  0.013        0,2.53
## Vres 19.047 13.117,25.465
## Vtot 37.475 33.659,43.108
## m2    0.001       0,0.065
## h2    0.476   0.304,0.668
## CVa   0.163   0.128,0.203
## emu   0.027    0.015,0.04
Estimating the cross-environmental additive genetic correlation and maternal effects covariance

additive genetic correlation: \(r_{G} = COV_{A(novel-original)}/\sqrt{(V_{A(novel)}V_{A(orignal)})}\)

dam-related covariance between offspring in the original and novel host: \(COV_{dam(novel-original)}\) (Due to low maternal effects variance in both hosts and potential computational problems - dividing by zero; we do not estimate maternal effects correlation (\(r_{M}\)). The covariance estimate is unreliable because of the low variance too.)

##                             Est       CredI
## genetic correlation (rG): 0.895 0.629,0.996
##                                          Est        CredI
## dam-related covariance novel-original -0.004 -0.854,1.157

The Gcov + Msep model

Here, we specify both separate variance per host type and the cross-environmental covariance for additive genetic (animal) effects and separate maternal effects variance per host type without the covariance. We estimate residual variance (units) separately per each host type.

##  [1]   1   6  16  26  31  61  76  91  96 116 121
##  [1]   1   6  11  16  21  31  41  46  51  56  61  71  76  81  86  91  96 101 111
## [20] 116 121 126 131 136 146 156 161 166 171 181 191 216 226 236 241 246 251 261
## [39] 271 286 291 296 306 316
## 
##  Iterations = 60001:359701
##  Thinning interval  = 300
##  Sample size  = 1000 
## 
##  DIC: 8893.534 
## 
##  G-structure:  ~us(host):animal
## 
##                    post.mean l-95% CI u-95% CI eff.samp
## hostC:hostC.animal     17.07    8.986    25.60   1000.0
## hostM:hostC.animal     14.57    8.341    20.65    894.2
## hostC:hostM.animal     14.57    8.341    20.65    894.2
## hostM:hostM.animal     18.90   10.082    27.27   1000.0
## 
##                ~idh(host):dam
## 
##           post.mean  l-95% CI u-95% CI eff.samp
## hostC.dam    1.1595 2.802e-06    3.851    618.9
## hostM.dam    0.7413 7.369e-07    2.559   1000.0
## 
##  R-structure:  ~idh(host):units
## 
##             post.mean l-95% CI u-95% CI eff.samp
## hostC.units     22.25    16.88    28.92    833.7
## hostM.units     19.09    13.27    25.69   1000.0
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean l-95% CI u-95% CI eff.samp  pMCMC    
## (Intercept)  23.41238 22.33460 24.44808   1142.8 <0.001 ***
## hostM         3.38517  2.71775  4.09944   1000.0 <0.001 ***
## WH           -0.25141 -0.56963  0.01004   1272.0  0.076 .  
## ord.f        -0.33993 -0.73566  0.04196   1140.6  0.094 .  
## DATE          0.27018 -0.35273  0.89490    933.8  0.424    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 14.65646 mins
Estimating heritability, evolvability and maternal effects

We calculate heritability, evolvability and maternal effects proportion based on the minimal model, i.e. after accounting for the design effects (bean mass, dam mating order, day mated). Additive genetic variance is given by animal and maternal effects variance by dam.

Additive genetic variance: \(V_{A} = V_{animal}\)

Maternal effects above the additive genetic effects: \(V_M = V_{dam}\)

Maternal effects proportion: \(m^2 = V_{M}/(V_{A} + V_{M} + V_{residual})\)

Heritability: \(h^{2} = V_{A}/(V_{A} + V_{M} + V_{residual})\)

Coef. of add. gen. variation: \(CV_{A} = \sqrt{V_{A}}/\overline{y}\)

Evolvability: \(e_{\mu} = V_{A}/\overline{y}^2\), or \(e_{\mu} = CV_{A}^2\)

Parameter estimates in the original host type (Cowpea)

##         Est         CredI
## Vadd 19.151  8.986,25.596
## Vmat  0.026       0,3.851
## Vres 22.078 16.881,28.923
## Vtot 39.849 35.479,45.046
## m2    0.000       0,0.095
## h2    0.436   0.227,0.595
## CVa   0.191   0.133,0.222
## emu   0.036   0.017,0.049

and in the novel (Mung)

##         Est         CredI
## Vadd 19.343 10.082,27.273
## Vmat  0.013       0,2.559
## Vres 18.600 13.272,25.688
## Vtot 38.186 34.364,43.805
## m2    0.000       0,0.066
## h2    0.516   0.288,0.662
## CVa   0.168   0.128,0.205
## emu   0.028    0.015,0.04
Estimating cross-environmental additive genetic correlation

Using the additive genetic covariance between the two hosts, we estimate

genetic correlation: \(r_{G} = COV_{A(novel-original)}/\sqrt{(V_{A(novel)}V_{A(orignal)})}\)

##                             Est       CredI
## genetic correlation (rG): 0.903 0.632,0.995

The Gsep + Msep model

Here, we specify separate variance per host type for both additive genetic (animal) and maternal effects (dam), but ignore potential cross-environmental covariances. We estimate residual variance (units) separately per each host type.

##  [1]   1   6  16  21  26  31  61  76  91  96 101 116 121
##  [1]   1  11  21  22  36  46  56  61  71  81  96 106 116 121 131 141 156 166 176
## 
##  Iterations = 60001:359701
##  Thinning interval  = 300
##  Sample size  = 1000 
## 
##  DIC: 8916.51 
## 
##  G-structure:  ~idh(host):animal
## 
##              post.mean l-95% CI u-95% CI eff.samp
## hostC.animal     16.68    7.729    26.27    828.7
## hostM.animal     18.21    8.959    27.21   1102.1
## 
##                ~idh(host):dam
## 
##           post.mean  l-95% CI u-95% CI eff.samp
## hostC.dam    1.3385 3.712e-09    4.614    895.5
## hostM.dam    0.8961 3.376e-07    3.329   1000.0
## 
##  R-structure:  ~idh(host):units
## 
##             post.mean l-95% CI u-95% CI eff.samp
## hostC.units     22.64    16.49    29.31     1132
## hostM.units     19.52    12.30    25.24     1302
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean l-95% CI u-95% CI eff.samp  pMCMC    
## (Intercept)  23.29423 22.17755 24.33564    896.7 <0.001 ***
## hostM         3.23868  2.27392  4.20958    867.1 <0.001 ***
## WH           -0.24388 -0.51015  0.07683   1000.0  0.128    
## ord.f        -0.27894 -0.66493  0.14555    894.6  0.194    
## DATE          0.34555 -0.20528  0.83389    797.5  0.210    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 11.79493 mins
Estimating heritability, evolvability and maternal effects

We calculate heritability, evolvability and maternal effects proportion based on the minimal model, i.e. after accounting for the design effects (bean mass, dam mating order, day mated). Additive genetic variance is given by animal and maternal effects variance by dam.

Additive genetic variance: \(V_{A} = V_{animal}\)

Maternal effects above the additive genetic effects: \(V_M = V_{dam}\)

Maternal effects proportion: \(m^2 = V_{M}/(V_{A} + V_{M} + V_{residual})\)

Heritability: \(h^{2} = V_{A}/(V_{A} + V_{M} + V_{residual})\)

Coef. of add. gen. variation: \(CV_{A} = \sqrt{V_{A}}/\overline{y}\)

Evolvability: \(e_{\mu} = V_{A}/\overline{y}^2\), or \(e_{\mu} = CV_{A}^2\)

Parameter estimates in the original host type (Cowpea)

##         Est         CredI
## Vadd 16.704  7.729,26.272
## Vmat  0.030       0,4.614
## Vres 22.463 16.486,29.308
## Vtot 38.815 35.974,45.414
## m2    0.001       0,0.113
## h2    0.388     0.192,0.6
## CVa   0.178   0.121,0.224
## emu   0.032    0.015,0.05

and in the novel (Mung)

##         Est         CredI
## Vadd 18.528  8.959,27.208
## Vmat  0.019       0,3.329
## Vres 19.805 12.298,25.238
## Vtot 37.959 33.645,42.993
## m2    0.000       0,0.086
## h2    0.449   0.247,0.662
## CVa   0.165   0.119,0.203
## emu   0.027    0.013,0.04

The Gcov model

Here, we specify both separate variance per host type and cross-environmental covariance for additive genetic (animal). Maternal effects are ignored. We estimate residual variance (units) separately per each host type.

## [1]   1   6  16  26  31  61  76  91 121
##  [1]   1   6  11  16  21  31  36  41  46  51  56  61  66  71  76  81  86  91  96
## [20] 101 106 116 121 126 131 141 156 161 166 176
## 
##  Iterations = 60001:359701
##  Thinning interval  = 300
##  Sample size  = 1000 
## 
##  DIC: 8877.276 
## 
##  G-structure:  ~us(host):animal
## 
##                    post.mean l-95% CI u-95% CI eff.samp
## hostC:hostC.animal     18.65    11.42    26.85    897.3
## hostM:hostC.animal     15.14     9.63    22.08    877.1
## hostC:hostM.animal     15.14     9.63    22.08    877.1
## hostM:hostM.animal     19.59    10.97    27.71   1000.0
## 
##  R-structure:  ~idh(host):units
## 
##             post.mean l-95% CI u-95% CI eff.samp
## hostC.units     21.76    15.77    28.02     1029
## hostM.units     18.90    12.68    24.92     1000
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean l-95% CI u-95% CI eff.samp  pMCMC    
## (Intercept)  23.43717 22.40030 24.70371    909.7 <0.001 ***
## hostM         3.38295  2.61878  4.09575   1000.0 <0.001 ***
## WH           -0.25822 -0.55214  0.04741   1000.0  0.102    
## ord.f        -0.34528 -0.75361  0.06306    912.6  0.092 .  
## DATE          0.25127 -0.40068  0.90758   1000.0  0.410    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 12.83797 mins
Estimating heritability and evolvability

We calculate heritability and evolvability based on the minimal model, i.e. after accounting for the design effects (bean mass, dam mating order, day mated). Additive genetic variance is given by animal. Maternal effects variance is ignored.

Additive genetic variance: \(V_{A} = V_{animal}\)

Heritability: \(h^{2} = V_{A}/(V_{A} + V_{residual})\)

Coef. of add. gen. variation: \(CV_{A} = \sqrt{V_{A}}/\overline{y}\)

Evolvability: \(e_{\mu} = V_{A}/\overline{y}^2\), or \(e_{\mu} = CV_{A}^2\)

Parameter estimates in the original host type (Cowpea)

##         Est         CredI
## Vadd 19.981 11.423,26.851
## Vres 21.381 15.775,28.017
## Vtot 39.267 35.595,45.099
## h2    0.459   0.301,0.624
## CVa   0.195   0.148,0.226
## emu   0.038   0.022,0.051

and in the novel (Mung)

##         Est         CredI
## Vadd 16.664 10.973,27.715
## Vres 17.439 12.684,24.922
## Vtot 37.645 33.595,43.241
## h2    0.507   0.334,0.684
## CVa   0.168   0.131,0.204
## emu   0.024    0.016,0.04
Estimating cross-environmental genetic correlation

Using the additive genetic covariance between the two hosts, we estimate

genetic correlation: \(r_{G} = COV_{A(novel-original)}/\sqrt{(V_{A(novel)}V_{A(orignal)})}\)

##                            Est       CredI
## genetic correlation (rG): 0.79 0.615,0.982

The Gsep model

Here, we specify separate variance per host type for additive genetic (animal) effects only, but ignore potential cross-environmental covariance. Maternal effects were also ignored. We estimate residual variance (units) separately per each host type.

## [1]   1   6  16  26  31  61  76  91 121
## [1]  1 11 26 36 41 51 66 76
## 
##  Iterations = 20001:219801
##  Thinning interval  = 200
##  Sample size  = 1000 
## 
##  DIC: 8892.886 
## 
##  G-structure:  ~idh(host):animal
## 
##              post.mean l-95% CI u-95% CI eff.samp
## hostC.animal     18.50    10.61    26.48     1000
## hostM.animal     19.53    12.14    28.40     1000
## 
##  R-structure:  ~idh(host):units
## 
##             post.mean l-95% CI u-95% CI eff.samp
## hostC.units     21.73    14.96    27.55     1158
## hostM.units     18.90    12.37    24.56     1000
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean l-95% CI u-95% CI eff.samp  pMCMC    
## (Intercept)  23.31826 22.16248 24.30078     1000 <0.001 ***
## hostM         3.21399  2.26099  4.28402     1000 <0.001 ***
## WH           -0.25195 -0.55934  0.05042     1000   0.10 .  
## ord.f        -0.28682 -0.66098  0.08294     1000   0.15    
## DATE          0.33234 -0.17813  0.83439     1000   0.21    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 5.771447 mins
Estimating heritability and evolvability

We calculate heritability and evolvability based on the minimal model, i.e. after accounting for the design effects (bean mass, dam mating order, day mated). Additive genetic variance is given by animal.

Additive genetic variance: \(V_{A} = V_{animal}\)

Heritability: \(h^{2} = V_{A}/(V_{A} + V_{M} + V_{residual})\)

Coef. of add. gen. variation: \(CV_{A} = \sqrt{V_{A}}/\overline{y}\)

Evolvability: \(e_{\mu} = V_{A}/\overline{y}^2\), or \(e_{\mu} = CV_{A}^2\)

Parameter estimates in the original host type (Cowpea)

##         Est         CredI
## Vadd 17.024 10.613,26.485
## Vres 23.432 14.958,27.552
## Vtot 40.169 35.551,44.677
## h2    0.421   0.291,0.635
## CVa   0.184   0.142,0.224
## emu   0.032     0.02,0.05

and in the novel (Mung)

##         Est         CredI
## Vadd 18.889 12.141,28.396
## Vres 17.154 12.366,24.563
## Vtot 38.010  34.002,43.29
## h2    0.520   0.339,0.686
## CVa   0.166   0.133,0.203
## emu   0.028   0.018,0.041

The G + M model

Here, we estimate variance for both additive genetic (animal) and maternal effects (dam), but ignore their potential host-specificity and the cross-environmental covariances. We estimate residual variance (units) across host types.

##  [1]   1   6  16  26  31  32  61  76  91  96 116 121
## [1]  1  6 11 16 21 26 31 36 41
## 
##  Iterations = 20001:219801
##  Thinning interval  = 200
##  Sample size  = 1000 
## 
##  DIC: 8956.678 
## 
##  G-structure:  ~animal
## 
##        post.mean l-95% CI u-95% CI eff.samp
## animal     15.97    9.789    22.39     1273
## 
##                ~dam
## 
##     post.mean  l-95% CI u-95% CI eff.samp
## dam    0.4703 6.153e-07    1.708     1281
## 
##  R-structure:  ~units
## 
##       post.mean l-95% CI u-95% CI eff.samp
## units     22.76    18.71    26.57     1171
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean l-95% CI u-95% CI eff.samp  pMCMC    
## (Intercept)  23.47184 22.30478 24.50731    975.1 <0.001 ***
## hostM         3.44497  2.77815  4.00817   1225.2 <0.001 ***
## WH           -0.26825 -0.57313  0.02585   1000.0  0.076 .  
## ord.f        -0.35805 -0.74071  0.05901   1000.0  0.108    
## DATE          0.24215 -0.35333  0.82841   1000.0  0.456    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 4.904186 mins
Estimating heritability, evolvability and maternal effects

We calculate heritability, evolvability and maternal effects proportion based on the minimal model, i.e. after accounting for the design effects (bean mass, dam mating order, day mated). Additive genetic variance is given by animal. Maternal effects variance is ignored.

Additive genetic variance: \(V_{A} = V_{animal}\)

Maternal effects above the additive genetic effects: \(V_M = V_{dam}\)

Maternal effects proportion: \(m^2 = V_{M}/(V_{A} + V_{M} + V_{residual})\)

Heritability: \(h^{2} = V_{A}/(V_{A} + V_{residual})\)

Coef. of add. gen. variation: \(CV_{A} = \sqrt{V_{A}}/\overline{y}\)

Evolvability: \(e_{\mu} = V_{A}/\overline{y}^2\), or \(e_{\mu} = CV_{A}^2\)

Parameter estimates across the two host types

##         Est         CredI
## Vadd 15.178  9.789,22.386
## Vmat  0.009       0,1.708
## Vres 22.409 18.706,26.573
## Vtot 38.545  36.06,42.742
## m2    0.000       0,0.043
## h2    0.387   0.276,0.545
## CVa   0.170   0.138,0.208
## emu   0.029   0.019,0.043

The G model

Here, we specify additive genetic (animal) effects only, ignore maternal effects or host-specificity. We estimate residual variance (units) across host types.

##  [1]   1   6  16  21  26  31  61  76  91  96 101 116 121
## [1]  1  6 11 16
## 
##  Iterations = 20001:219601
##  Thinning interval  = 200
##  Sample size  = 999 
## 
##  DIC: 8947.708 
## 
##  G-structure:  ~animal
## 
##        post.mean l-95% CI u-95% CI eff.samp
## animal     16.68    12.06    22.69      999
## 
##  R-structure:  ~units
## 
##       post.mean l-95% CI u-95% CI eff.samp
## units     22.46    18.82     26.7     1204
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean  l-95% CI  u-95% CI eff.samp  pMCMC   
## (Intercept) 23.486824 22.439501 24.604005      999 <0.001 **
## hostM        3.438695  2.822439  4.029211      999 <0.001 **
## WH          -0.268815 -0.562845  0.002812     1130 0.0601 . 
## ord.f       -0.361410 -0.762466  0.023562      999 0.0761 . 
## DATE         0.246226 -0.418569  0.784665      999 0.4384   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 4.101777 mins
Estimating heritability and evolvability

We calculate heritability and evolvability based on the minimal model, i.e. after accounting for the design effects (bean mass, dam mating order, day mated). Additive genetic variance is given by animal. Maternal effects variance is ignored.

Additive genetic variance: \(V_{A} = V_{animal}\)

Heritability: \(h^{2} = V_{A}/(V_{A} + V_{residual})\)

Coef. of add. gen. variation: \(CV_{A} = \sqrt{V_{A}}/\overline{y}\)

Evolvability: \(e_{\mu} = V_{A}/\overline{y}^2\), or \(e_{\mu} = CV_{A}^2\)

Parameter estimates across both host types

##         Est         CredI
## Vadd 16.782 12.059,22.687
## Vres 22.505 18.824,26.704
## Vtot 39.514 36.183,42.593
## h2    0.429   0.316,0.545
## CVa   0.179   0.151,0.208
## emu   0.032   0.023,0.043

Model comparison

The DIC of the alternative models. We base our inference on the best-selected models (lowest AIC within 2 unit difference).

##                  DIC delta
## Gcov + Mcov 8894.491  17.2
## Gcov + Msep 8893.534  16.3
## Gsep + Msep 8916.510  39.2
## Gcov        8877.276   0.0
## Gsep        8892.886  15.6
## G + M       8956.678  79.4
## G           8947.708  70.4

Session info:

## Time difference of 79.72121 mins
## R version 4.0.0 (2020-04-24)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 18363)
## 
## Matrix products: default
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] QGglmm_0.7.4  MCMCglmm_2.29 ape_5.3       coda_0.19-3   scales_1.1.1 
## [6] MuMIn_1.43.17 lme4_1.1-23   Matrix_1.2-18
## 
## loaded via a namespace (and not attached):
##  [1] Rcpp_1.0.4.6     compiler_4.0.0   nloptr_1.2.2.1   tools_4.0.0     
##  [5] boot_1.3-24      digest_0.6.25    statmod_1.4.34   evaluate_0.14   
##  [9] lifecycle_0.2.0  nlme_3.1-147     lattice_0.20-41  rlang_0.4.6     
## [13] yaml_2.2.1       parallel_4.0.0   xfun_0.14        stringr_1.4.0   
## [17] knitr_1.28       stats4_4.0.0     grid_4.0.0       R6_2.4.1        
## [21] rmarkdown_2.2    tensorA_0.36.1   minqa_1.2.4      corpcor_1.6.9   
## [25] magrittr_1.5     htmltools_0.4.0  MASS_7.3-51.5    splines_4.0.0   
## [29] colorspace_1.4-1 cubature_2.0.4   stringi_1.4.6    munsell_0.5.0

END