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.

Development duration of female offspring (daughters)

## [1] "The number of removed missing and outlier values:"
## [1] 24
##      Cowpea   Mung
## mean 32.025 30.770
## SD    1.355  1.009
## SE    0.043  0.038
## 'data.frame':    1420 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/ 1420 levels "C-101-6","C-101-7",..: 735 736 1 2 3 4 737 5 738 739 ...
##  $ state     : Factor w/ 1 level "emerged": 1 1 1 1 1 1 1 1 1 1 ...
##  $ day.em    : Factor w/ 12 levels "10.4.18","11.4.18",..: 4 3 7 5 3 4 3 4 3 3 ...
##  $ 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/ 43 levels "","1.5.18","10.5.18",..: 19 7 10 15 15 33 3 39 17 40 ...
##  $ 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  31 30 34 32 30 31 30 31 30 30 ...
##  $ WH        : num  -0.149 -1.224 0.848 0.445 -1.751 ...
##  $ PREF      : num  -0.403 -0.403 -0.403 -0.403 -0.403 ...
##  $ date      : num  3 3 3 3 3 3 3 3 3 3 ...
##  $ DATE      : num  -0.482 -0.482 -0.482 -0.482 -0.482 ...
Creating pedigree for the animal model approach

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

##   offspring dams sires
## 1      1420  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  96 116 121
##   [1]   1   6  11  16  21  26  31  36  41  46  51  56  57  61  62  66  71  76
##  [19]  77  81  82  86  91  96 101 106 107 111 112 116 121 126 127 131 132 136
##  [37] 141 146 151 156 161 166 171 176 181 186 191 196 201 206 211 216 221 226
##  [55] 231 236 241 246 251 256 257 261 262 266 271 276 281 286 291 296 301 306
##  [73] 307 311 312 316 321 326 331 336 341 346 351 356 361 366 371 376 381 386
##  [91] 396 401 406 411 416 421 426 431 441 446 451 456 461 466 471 476 481 486
## [109] 491 496
## 
##  Iterations = 50001:549501
##  Thinning interval  = 500
##  Sample size  = 1000 
## 
##  DIC: 4246.116 
## 
##  G-structure:  ~us(host):animal
## 
##                    post.mean   l-95% CI u-95% CI eff.samp
## hostC:hostC.animal    0.2274  2.069e-06   0.5084   1000.0
## hostM:hostC.animal    0.1361 -3.057e-02   0.3363    596.8
## hostC:hostM.animal    0.1361 -3.057e-02   0.3363    596.8
## hostM:hostM.animal    0.2414  6.120e-11   0.4878   1000.0
## 
##                ~us(host):dam
## 
##                 post.mean   l-95% CI u-95% CI eff.samp
## hostC:hostC.dam   0.11564  1.069e-08   0.2684   1000.0
## hostM:hostC.dam   0.03845 -4.109e-02   0.1432    856.1
## hostC:hostM.dam   0.03845 -4.109e-02   0.1432    856.1
## hostM:hostM.dam   0.09147  5.631e-07   0.2146   1000.0
## 
##  R-structure:  ~idh(host):units
## 
##             post.mean l-95% CI u-95% CI eff.samp
## hostC.units    1.4211   1.1716   1.6579    855.9
## hostM.units    0.6234   0.4574   0.7793   1000.0
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean  l-95% CI  u-95% CI eff.samp  pMCMC    
## (Intercept) 31.903302 31.712664 32.093242     1000 <0.001 ***
## hostM       -1.271594 -1.428602 -1.133245     1034 <0.001 ***
## WH           0.083572  0.026540  0.136681     1000  0.002 ** 
## ord.f        0.064657 -0.004386  0.140582     1000  0.080 .  
## DATE         0.317853  0.238624  0.410327     1000 <0.001 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 22.46152 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.002     0,0.508
## Vmat 0.002     0,0.268
## Vres 1.425 1.172,1.658
## Vtot 1.743 1.585,1.946
## m2   0.001     0,0.151
## h2   0.002     0,0.282
## CVa  0.015 0.001,0.023
## emu  0.000         0,0

and in the novel host type (Mung)

##        Est       CredI
## Vadd 0.251     0,0.488
## Vmat 0.002     0,0.215
## Vres 0.672 0.457,0.779
## Vtot 0.948 0.851,1.069
## m2   0.001     0,0.222
## h2   0.267     0,0.494
## CVa  0.016 0.003,0.024
## emu  0.000     0,0.001
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.99 -0.315,1
##                                       Est        CredI
## dam-related covariance novel-original   0 -0.041,0.143

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  21  31  41  46  51  56  61  66  71  76  81  86  91  96 101 106
## [20] 111 116 122 126 131 136 146 156 161 166 171 181 191 206 211 216 226 236 241
## [39] 246 251 261 271 286 291 296 306 316
## 
##  Iterations = 60001:359701
##  Thinning interval  = 300
##  Sample size  = 1000 
## 
##  DIC: 4239.748 
## 
##  G-structure:  ~us(host):animal
## 
##                    post.mean   l-95% CI u-95% CI eff.samp
## hostC:hostC.animal    0.2733  1.612e-05   0.5304   1000.0
## hostM:hostC.animal    0.1760 -2.063e-03   0.3495    569.8
## hostC:hostM.animal    0.1760 -2.063e-03   0.3495    569.8
## hostM:hostM.animal    0.2806  6.269e-02   0.5418   1000.0
## 
##                ~idh(host):dam
## 
##           post.mean  l-95% CI u-95% CI eff.samp
## hostC.dam   0.09182 4.230e-06   0.2247     1000
## hostM.dam   0.07293 1.489e-06   0.1842     1000
## 
##  R-structure:  ~idh(host):units
## 
##             post.mean l-95% CI u-95% CI eff.samp
## hostC.units    1.3963    1.156   1.6584     1000
## hostM.units    0.6047    0.451   0.7428     1165
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean  l-95% CI  u-95% CI eff.samp  pMCMC    
## (Intercept) 31.898934 31.718699 32.110322     1000 <0.001 ***
## hostM       -1.263861 -1.403436 -1.116246     1000 <0.001 ***
## WH           0.081006  0.025212  0.133477     1000  0.006 ** 
## ord.f        0.065112 -0.002199  0.137288     1116  0.066 .  
## DATE         0.321488  0.234017  0.403636     1248 <0.001 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 14.48759 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.239      0,0.53
## Vmat 0.001     0,0.225
## Vres 1.424 1.156,1.658
## Vtot 1.778 1.576,1.931
## m2   0.001     0,0.126
## h2   0.099     0,0.297
## CVa  0.018 0.004,0.024
## emu  0.000     0,0.001

and in the novel (Mung)

##        Est       CredI
## Vadd 0.265 0.063,0.542
## Vmat 0.001     0,0.184
## Vres 0.605 0.451,0.743
## Vtot 0.966 0.863,1.083
## m2   0.001      0,0.19
## h2   0.226 0.058,0.533
## CVa  0.020 0.009,0.025
## emu  0.000     0,0.001
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.741 0.25,0.996

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  26  31  61  76  91 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: 4258.497 
## 
##  G-structure:  ~idh(host):animal
## 
##              post.mean  l-95% CI u-95% CI eff.samp
## hostC.animal    0.1962 7.341e-07   0.5167     1000
## hostM.animal    0.2292 6.484e-06   0.4818     1000
## 
##                ~idh(host):dam
## 
##           post.mean  l-95% CI u-95% CI eff.samp
## hostC.dam   0.12792 5.481e-06   0.2934     1000
## hostM.dam   0.09448 7.009e-06   0.2157     1000
## 
##  R-structure:  ~idh(host):units
## 
##             post.mean l-95% CI u-95% CI eff.samp
## hostC.units    1.4407   1.1879   1.7000      627
## hostM.units    0.6267   0.4524   0.7769     1000
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean l-95% CI u-95% CI eff.samp  pMCMC    
## (Intercept)  31.91107 31.73451 32.09660    944.5 <0.001 ***
## hostM        -1.27112 -1.42710 -1.12781    813.7 <0.001 ***
## WH            0.08147  0.02577  0.13459   1000.0  0.014 *  
## ord.f         0.06267 -0.01194  0.12508    964.5  0.080 .  
## DATE          0.31662  0.23501  0.40072   1000.0 <0.001 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 11.79666 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.003     0,0.517
## Vmat 0.002     0,0.293
## Vres 1.486   1.188,1.7
## Vtot 1.744 1.595,1.966
## m2   0.001     0,0.166
## h2   0.002     0,0.288
## CVa  0.014     0,0.022
## emu  0.000     0,0.001

and in the novel (Mung)

##        Est       CredI
## Vadd 0.187     0,0.482
## Vmat 0.002     0,0.216
## Vres 0.613 0.452,0.777
## Vtot 0.949 0.842,1.055
## m2   0.001     0,0.222
## h2   0.137     0,0.476
## CVa  0.017 0.003,0.024
## emu  0.000     0,0.001

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  37  41  42  46  51  56  61  66  67  71  72  76
## [20]  81  86  91  96 101 106 116 121 126 131 141 156 161 166 176
## 
##  Iterations = 60001:359701
##  Thinning interval  = 300
##  Sample size  = 1000 
## 
##  DIC: 4216 
## 
##  G-structure:  ~us(host):animal
## 
##                    post.mean l-95% CI u-95% CI eff.samp
## hostC:hostC.animal    0.4006  0.10527   0.6785   1000.0
## hostM:hostC.animal    0.2444  0.06815   0.4244    723.7
## hostC:hostM.animal    0.2444  0.06815   0.4244    723.7
## hostM:hostM.animal    0.4102  0.21345   0.6217   1000.0
## 
##  R-structure:  ~idh(host):units
## 
##             post.mean l-95% CI u-95% CI eff.samp
## hostC.units    1.3631   1.0872   1.6263     1000
## hostM.units    0.5504   0.3883   0.7061     1000
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean  l-95% CI  u-95% CI eff.samp  pMCMC    
## (Intercept) 31.892883 31.677250 32.071015     1000 <0.001 ***
## hostM       -1.259718 -1.402130 -1.119797     1000 <0.001 ***
## WH           0.081114  0.021384  0.134785     1000  0.002 ** 
## ord.f        0.065998 -0.001734  0.136490     1000  0.070 .  
## DATE         0.319121  0.228076  0.420056     1000 <0.001 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 12.66418 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.430 0.105,0.678
## Vres 1.467 1.087,1.626
## Vtot 1.768 1.578,1.948
## h2   0.229 0.084,0.387
## CVa  0.020 0.012,0.027
## emu  0.000     0,0.001

and in the novel (Mung)

##        Est       CredI
## Vadd 0.349 0.213,0.622
## Vres 0.599 0.388,0.706
## Vtot 0.956 0.853,1.083
## h2   0.365 0.241,0.606
## CVa  0.020 0.016,0.026
## emu  0.000     0,0.001
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.706 0.277,0.981

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  96 116 121
## [1]  1 11 26 36 41 51 66 76
## 
##  Iterations = 20001:219801
##  Thinning interval  = 200
##  Sample size  = 1000 
## 
##  DIC: 4226.449 
## 
##  G-structure:  ~idh(host):animal
## 
##              post.mean l-95% CI u-95% CI eff.samp
## hostC.animal    0.3917   0.1293   0.7011     1000
## hostM.animal    0.3913   0.2116   0.5925     1113
## 
##  R-structure:  ~idh(host):units
## 
##             post.mean l-95% CI u-95% CI eff.samp
## hostC.units    1.3690   1.1029   1.6827     1000
## hostM.units    0.5611   0.3874   0.6941     1011
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##              post.mean   l-95% CI   u-95% CI eff.samp  pMCMC    
## (Intercept) 31.9094048 31.7269174 32.0888203     1000 <0.001 ***
## hostM       -1.2629744 -1.4296661 -1.0981124     1000 <0.001 ***
## WH           0.0797128  0.0220312  0.1362517      963  0.012 *  
## ord.f        0.0613216  0.0009565  0.1254774     1000  0.060 .  
## DATE         0.3163742  0.2333964  0.4069813     1000 <0.001 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 5.802438 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.437 0.129,0.701
## Vres 1.331 1.103,1.683
## Vtot 1.739 1.585,1.947
## h2   0.235 0.053,0.366
## CVa  0.021 0.011,0.026
## emu  0.000     0,0.001

and in the novel (Mung)

##        Est       CredI
## Vadd 0.370 0.212,0.592
## Vres 0.574 0.387,0.694
## Vtot 0.941 0.843,1.056
## h2   0.390 0.229,0.579
## CVa  0.020 0.015,0.025
## emu  0.000     0,0.001

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 121
## [1]  1  6 11 16 21 26 31 36 41
## 
##  Iterations = 20001:219801
##  Thinning interval  = 200
##  Sample size  = 1000 
## 
##  DIC: 4367.753 
## 
##  G-structure:  ~animal
## 
##        post.mean  l-95% CI u-95% CI eff.samp
## animal    0.1766 7.396e-07   0.3765     1001
## 
##                ~dam
## 
##     post.mean l-95% CI u-95% CI eff.samp
## dam   0.08837  4.2e-08   0.1898     1000
## 
##  R-structure:  ~units
## 
##       post.mean l-95% CI u-95% CI eff.samp
## units     1.103   0.9553    1.251     1000
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean l-95% CI u-95% CI eff.samp  pMCMC    
## (Intercept)  31.90738 31.70164 32.08002     1109 <0.001 ***
## hostM        -1.28010 -1.38954 -1.15084     1000 <0.001 ***
## WH            0.09366  0.03452  0.15342     1163  0.002 ** 
## ord.f         0.06322 -0.01313  0.14045     1116  0.106    
## DATE          0.31673  0.22835  0.40373     1000 <0.001 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 5.0086 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.002     0,0.377
## Vmat 0.001      0,0.19
## Vres 1.091 0.955,1.251
## Vtot 1.358 1.255,1.479
## m2   0.001      0,0.14
## h2   0.002      0,0.27
## CVa  0.016  0.002,0.02
## emu  0.000         0,0

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: 4353.634 
## 
##  G-structure:  ~animal
## 
##        post.mean l-95% CI u-95% CI eff.samp
## animal    0.3408   0.1725   0.4893      999
## 
##  R-structure:  ~units
## 
##       post.mean l-95% CI u-95% CI eff.samp
## units     1.027   0.8914    1.174      999
## 
##  Location effects: y ~ host + WH + ord.f + DATE 
## 
##             post.mean l-95% CI u-95% CI eff.samp  pMCMC   
## (Intercept)  31.89352 31.71678 32.08539      999 <0.001 **
## hostM        -1.26720 -1.38553 -1.14875      999 <0.001 **
## WH            0.09341  0.03695  0.15322      999 0.0020 **
## ord.f         0.06463 -0.01402  0.12997      999 0.0921 . 
## DATE          0.32040  0.22774  0.41964      999 <0.001 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## Time difference of 4.091943 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.351 0.172,0.489
## Vres 1.056 0.891,1.174
## Vtot 1.361 1.265,1.474
## h2   0.259 0.147,0.361
## CVa  0.018 0.014,0.022
## emu  0.000         0,0

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 4246.116  30.1
## Gcov + Msep 4239.748  23.7
## Gsep + Msep 4258.497  42.5
## Gcov        4216.000   0.0
## Gsep        4226.449  10.4
## G + M       4367.753 151.8
## G           4353.634 137.6

Session info:

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