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.

Body mass of female offspring (daughters)

## [1] "The number of removed missing and outlier values:"
## [1] 13
##      Cowpea  Mung
## mean  5.826 6.515
## SD    0.707 0.615
## SE    0.031 0.030
## 'data.frame':    1431 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/ 1431 levels "C-101-6","C-101-7",..: 744 745 1 2 3 4 746 5 747 748 ...
##  $ state     : Factor w/ 1 level "emerged": 1 1 1 1 1 1 1 1 1 1 ...
##  $ day.em    : Factor w/ 18 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/ 41 levels "","1.5.18","10.5.18",..: 17 7 9 13 13 31 3 37 15 38 ...
##  $ 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         : num  7.98 7.79 5.99 5.55 7.03 ...
##  $ WH        : num  -0.15 -1.223 0.843 0.438 -1.764 ...
##  $ PREF      : num  -0.402 -0.402 -0.402 -0.402 -0.402 ...
##  $ date      : num  3 3 3 3 3 3 3 3 3 3 ...
##  $ DATE      : num  -0.48 -0.48 -0.48 -0.48 -0.48 ...
Creating pedigree for the animal model approach

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

##   offspring dams sires
## 1      1431  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  31  36  41  46  51  56  61  66  71  76  81  86
##  [19]  91  96 101 106 111 116 121 126 131 136 141 146 151 156 161 166 171 176
##  [37] 181 186 191 196 201 206 211 216 221 226 231 236 241 246 251 256 261 266
##  [55] 271 276 281 286 291 296 301 306 311 316 321 326 331 336 341 346 351 356
##  [73] 361 366 371 376 381 386 391 396 401 406 411 416 421 426 431 436 441 446
##  [91] 451 456 461 466 471 476 481 486 491 496
## 
##  Iterations = 50001:549501
##  Thinning interval  = 500
##  Sample size  = 1000 
## 
##  DIC: 2367.27 
## 
##  G-structure:  ~us(host):animal
## 
##                    post.mean l-95% CI u-95% CI eff.samp
## hostC:hostC.animal    0.1944  0.08467   0.3044   1106.5
## hostM:hostC.animal    0.1695  0.07954   0.2566   1000.0
## hostC:hostM.animal    0.1695  0.07954   0.2566   1000.0
## hostM:hostM.animal    0.2056  0.10097   0.3026    894.3
## 
##                ~us(host):dam
## 
##                 post.mean   l-95% CI u-95% CI eff.samp
## hostC:hostC.dam   0.02218  9.057e-11  0.06484    696.3
## hostM:hostC.dam   0.01117 -8.272e-03  0.04609    856.2
## hostC:hostM.dam   0.01117 -8.272e-03  0.04609    856.2
## hostM:hostM.dam   0.02303  1.839e-08  0.06917   1003.2
## 
##  R-structure:  ~idh(host):units
## 
##             post.mean l-95% CI u-95% CI eff.samp
## hostC.units    0.2856  0.20435   0.3553   1000.0
## hostM.units    0.1497  0.09149   0.2062    906.7
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean  l-95% CI  u-95% CI eff.samp  pMCMC    
## (Intercept)  5.799811  5.673932  5.919226     1000 <0.001 ***
## hostM        0.721695  0.650185  0.799659     1000 <0.001 ***
## WH          -0.053186 -0.086329 -0.021534     1000 <0.001 ***
## ord.f        0.007654 -0.038302  0.051397     1000  0.750    
## DATE         0.043882 -0.020244  0.121085     1000  0.246    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 22.67681 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 0.187 0.085,0.304
## Vmat 0.001     0,0.065
## Vres 0.300 0.204,0.355
## Vtot 0.508 0.449,0.565
## m2   0.001     0,0.127
## h2   0.364 0.166,0.575
## CVa  0.081 0.051,0.095
## emu  0.005 0.002,0.009

and in the novel host type (Mung)

##        Est       CredI
## Vadd 0.218 0.101,0.303
## Vmat 0.001     0,0.069
## Vres 0.156 0.091,0.206
## Vtot 0.383 0.338,0.426
## m2   0.001     0,0.183
## h2   0.563 0.286,0.758
## CVa  0.071 0.049,0.085
## emu  0.005 0.002,0.007
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.909 0.668,0.999
##                                       Est        CredI
## dam-related covariance novel-original   0 -0.008,0.046

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  68  76  91 121
##  [1]   1   6  11  16  21  31  41  46  51  56  61  66  71  76  77  81  86  91  96
## [20] 101 106 111 116 117 121 126 131 136 146 156 161 166 171 181 191 206 211 216
## [39] 226 236 241 246 251 261 271 286 291 296 306 316
## 
##  Iterations = 60001:359701
##  Thinning interval  = 300
##  Sample size  = 1000 
## 
##  DIC: 2345.261 
## 
##  G-structure:  ~us(host):animal
## 
##                    post.mean l-95% CI u-95% CI eff.samp
## hostC:hostC.animal    0.2114   0.1123   0.2991     1000
## hostM:hostC.animal    0.1900   0.1288   0.2578     1000
## hostC:hostM.animal    0.1900   0.1288   0.2578     1000
## hostM:hostM.animal    0.2244   0.1473   0.3197     1000
## 
##                ~idh(host):dam
## 
##           post.mean  l-95% CI u-95% CI eff.samp
## hostC.dam   0.01390 1.931e-09  0.04248     1000
## hostM.dam   0.01454 1.950e-07  0.04537     1000
## 
##  R-structure:  ~idh(host):units
## 
##             post.mean l-95% CI u-95% CI eff.samp
## hostC.units    0.2765  0.20849   0.3431     1000
## hostM.units    0.1409  0.08387   0.1864     1000
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean  l-95% CI  u-95% CI eff.samp  pMCMC    
## (Intercept)  5.799042  5.676729  5.910622     1000 <0.001 ***
## hostM        0.722743  0.648817  0.795778     1000 <0.001 ***
## WH          -0.052684 -0.081759 -0.022051     1000  0.002 ** 
## ord.f        0.007579 -0.040290  0.047969     1000  0.720    
## DATE         0.044323 -0.023643  0.112856     1000  0.194    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 16.38587 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 0.206 0.112,0.299
## Vmat 0.000     0,0.042
## Vres 0.288 0.208,0.343
## Vtot 0.510 0.451,0.555
## m2   0.001     0,0.086
## h2   0.435   0.26,0.58
## CVa  0.078 0.059,0.095
## emu  0.006 0.003,0.009

and in the novel (Mung)

##        Est       CredI
## Vadd 0.217  0.147,0.32
## Vmat 0.000     0,0.045
## Vres 0.135 0.084,0.186
## Vtot 0.370 0.332,0.425
## m2   0.001     0,0.117
## h2   0.605 0.398,0.763
## CVa  0.072 0.059,0.087
## emu  0.005 0.003,0.008
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.976 0.706,1

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  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: 2411.449 
## 
##  G-structure:  ~idh(host):animal
## 
##              post.mean l-95% CI u-95% CI eff.samp
## hostC.animal    0.1692  0.05143   0.2939   1000.0
## hostM.animal    0.1919  0.06834   0.2938    910.7
## 
##                ~idh(host):dam
## 
##           post.mean  l-95% CI u-95% CI eff.samp
## hostC.dam   0.02690 4.451e-15  0.08030     1000
## hostM.dam   0.03683 1.395e-07  0.09281     1000
## 
##  R-structure:  ~idh(host):units
## 
##             post.mean l-95% CI u-95% CI eff.samp
## hostC.units    0.3048  0.22633   0.3794    857.6
## hostM.units    0.1547  0.09552   0.2185   1072.1
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##              post.mean   l-95% CI   u-95% CI eff.samp  pMCMC    
## (Intercept)  5.8027260  5.6905698  5.9117718   1000.0 <0.001 ***
## hostM        0.7045693  0.6098177  0.8197041    869.3 <0.001 ***
## WH          -0.0523235 -0.0821966 -0.0234061   1000.0 <0.001 ***
## ord.f        0.0098910 -0.0331403  0.0498538   1000.0  0.614    
## DATE         0.0499203 -0.0003471  0.1094014    894.7  0.076 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 13.58653 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 0.193 0.051,0.294
## Vmat 0.000      0,0.08
## Vres 0.289 0.226,0.379
## Vtot 0.491 0.443,0.558
## m2   0.001     0,0.156
## h2   0.358 0.113,0.565
## CVa  0.075 0.039,0.093
## emu  0.006 0.002,0.009

and in the novel (Mung)

##        Est       CredI
## Vadd 0.191 0.068,0.294
## Vmat 0.000     0,0.093
## Vres 0.136 0.096,0.218
## Vtot 0.383  0.338,0.43
## m2   0.001     0,0.236
## h2   0.647  0.196,0.74
## CVa  0.073 0.045,0.086
## emu  0.004 0.002,0.007

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  26  31  36  41  46  51  56  61  66  71  76  81  86  91
## [20]  96 101 106 111 116 121 126 131 136 141 151 156 161 166 176
## 
##  Iterations = 60001:359701
##  Thinning interval  = 300
##  Sample size  = 1000 
## 
##  DIC: 2313.943 
## 
##  G-structure:  ~us(host):animal
## 
##                    post.mean l-95% CI u-95% CI eff.samp
## hostC:hostC.animal    0.2320   0.1467   0.3170   1000.0
## hostM:hostC.animal    0.1993   0.1314   0.2591    849.9
## hostC:hostM.animal    0.1993   0.1314   0.2591    849.9
## hostM:hostM.animal    0.2443   0.1764   0.3192   1000.0
## 
##  R-structure:  ~idh(host):units
## 
##             post.mean l-95% CI u-95% CI eff.samp
## hostC.units    0.2700  0.20063   0.3359     1000
## hostM.units    0.1347  0.07988   0.1840     1000
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean  l-95% CI  u-95% CI eff.samp  pMCMC    
## (Intercept)  5.797251  5.670608  5.921223     1000 <0.001 ***
## hostM        0.722759  0.652262  0.797482     1000 <0.001 ***
## WH          -0.054207 -0.083117 -0.020647     1000  0.002 ** 
## ord.f        0.008582 -0.035316  0.051548     1000  0.734    
## DATE         0.044150 -0.024802  0.121567     1168  0.224    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 12.78856 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 0.215 0.147,0.317
## Vres 0.255 0.201,0.336
## Vtot 0.501 0.446,0.555
## h2   0.447 0.327,0.615
## CVa  0.084 0.066,0.097
## emu  0.006 0.004,0.009

and in the novel (Mung)

##        Est       CredI
## Vadd 0.250 0.176,0.319
## Vres 0.134  0.08,0.184
## Vtot 0.374  0.34,0.426
## h2   0.649 0.501,0.786
## CVa  0.077 0.065,0.087
## emu  0.006 0.004,0.008
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.901 0.67,0.995

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   8  16  26  31  61  76  83  91 121
## [1]  1 11 26 36 41 51 66 76
## 
##  Iterations = 20001:219801
##  Thinning interval  = 200
##  Sample size  = 1000 
## 
##  DIC: 2332.051 
## 
##  G-structure:  ~idh(host):animal
## 
##              post.mean l-95% CI u-95% CI eff.samp
## hostC.animal    0.2171   0.1316   0.3156     1094
## hostM.animal    0.2522   0.1759   0.3286     1000
## 
##  R-structure:  ~idh(host):units
## 
##             post.mean l-95% CI u-95% CI eff.samp
## hostC.units    0.2827  0.20897   0.3512     1000
## hostM.units    0.1288  0.07784   0.1779     1000
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean  l-95% CI  u-95% CI eff.samp  pMCMC    
## (Intercept)  5.801042  5.685652  5.915364    750.9 <0.001 ***
## hostM        0.703642  0.591959  0.819169   1000.0 <0.001 ***
## WH          -0.051131 -0.082260 -0.021017   1000.0 <0.001 ***
## ord.f        0.009375 -0.031008  0.050397   1000.0  0.648    
## DATE         0.050695 -0.007474  0.104201    900.9  0.074 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 5.906396 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 0.198 0.132,0.316
## Vres 0.296 0.209,0.351
## Vtot 0.493 0.449,0.558
## h2   0.468   0.288,0.6
## CVa  0.083 0.062,0.096
## emu  0.006 0.004,0.009

and in the novel (Mung)

##        Est       CredI
## Vadd 0.257 0.176,0.329
## Vres 0.121 0.078,0.178
## Vtot 0.385 0.332,0.422
## h2   0.661 0.514,0.805
## CVa  0.078 0.066,0.089
## emu  0.006 0.004,0.008

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  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: 2450.216 
## 
##  G-structure:  ~animal
## 
##        post.mean l-95% CI u-95% CI eff.samp
## animal    0.1966  0.09837   0.2929     1000
## 
##                ~dam
## 
##     post.mean  l-95% CI u-95% CI eff.samp
## dam   0.01932 1.784e-09  0.05541     1000
## 
##  R-structure:  ~units
## 
##       post.mean l-95% CI u-95% CI eff.samp
## units     0.227    0.169   0.2826     1000
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean  l-95% CI  u-95% CI eff.samp  pMCMC    
## (Intercept)  5.801509  5.694583  5.944549     1000 <0.001 ***
## hostM        0.723228  0.652827  0.785273     1000 <0.001 ***
## WH          -0.057895 -0.088795 -0.025914     1000 <0.001 ***
## ord.f        0.005896 -0.036765  0.053883     1000  0.800    
## DATE         0.041755 -0.036570  0.100364     1000  0.242    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 5.03205 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 0.213 0.098,0.293
## Vmat 0.000     0,0.055
## Vres 0.225 0.169,0.283
## Vtot 0.440 0.404,0.483
## m2   0.001     0,0.125
## h2   0.478 0.242,0.631
## CVa  0.079 0.057,0.095
## emu  0.006 0.003,0.009

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  26  31  61  76  91 121
## [1]  1  6 11 16
## 
##  Iterations = 20001:219601
##  Thinning interval  = 200
##  Sample size  = 999 
## 
##  DIC: 2395.971 
## 
##  G-structure:  ~animal
## 
##        post.mean l-95% CI u-95% CI eff.samp
## animal    0.2399   0.1689   0.3092     1182
## 
##  R-structure:  ~units
## 
##       post.mean l-95% CI u-95% CI eff.samp
## units    0.2053   0.1597   0.2522      999
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean  l-95% CI  u-95% CI eff.samp  pMCMC   
## (Intercept)  5.802593  5.692102  5.943290    999.0 <0.001 **
## hostM        0.723308  0.661809  0.790222    808.9 <0.001 **
## WH          -0.056115 -0.086096 -0.025178    999.0  0.004 **
## ord.f        0.005906 -0.040904  0.049041    999.0  0.785   
## DATE         0.043964 -0.027033  0.117458    999.0  0.214   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 4.126062 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 0.237 0.169,0.309
## Vres 0.201  0.16,0.252
## Vtot 0.445 0.406,0.488
## h2   0.534 0.408,0.658
## CVa  0.084 0.071,0.095
## emu  0.007 0.005,0.009

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 2367.270  53.3
## Gcov + Msep 2345.261  31.3
## Gsep + Msep 2411.449  97.5
## Gcov        2313.943   0.0
## Gsep        2332.051  18.1
## G + M       2450.216 136.3
## G           2395.971  82.0

Session info:

## Time difference of 80.50227 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