There are two datasets containing the relevant data:
Plasticity Color Data.csv
contains the color
measurements. We will call it data_col
.F2_Data_122821.csv
contains the metadata of the
experiment. We will call it data_exp
.Because color should not respond to the immediate environment (at least not like we’re measuring it), we will only use the data from the \(pred^-\) treatment.
data_col<-read.csv("../data_raw/Plasticity Color Data.csv")
data_exp<-read.csv("../data_raw/F2_Data_122821.csv") %>%
filter(assay_water == "pred-")
data <- right_join (data_exp, data_col, by = "ID") %>%
mutate(tutor_pop = ifelse(is.na(tutor_pop), "0", tutor_pop))
model_orange <- glmmTMB(Body.Orange.Relative.Area ~
pop + (pred_trt + tutor_pop) +
(1|mom_ID),
family = 'ordbeta', data)
kable(summary(model_orange)$coefficients)
|
plot_ob <- plot_results(model_orange, trait = "Body Orange")
plot_ob
model_xantho <- glmmTMB(Body.Xanthophore.Relative.Area ~
pop + (pred_trt + tutor_pop) +
(1|mom_ID),
family = 'ordbeta', data)
kable(summary(model_xantho)$coefficients)
|
plot_xb <- plot_results(model_xantho, trait = "Body Xanthophore")
plot_xb
model_black <- glmmTMB(Body.Black.Relative.Area ~
pop + (pred_trt + tutor_pop) +
(1|mom_ID),
family = 'ordbeta', data)
kable(summary(model_black)$coefficients)
|
plot_bb <- plot_results(model_black, trait = "Relative Black")
plot_bb
model_mela <- glmmTMB(Body.Melanistic.Relative.Area ~
pop + (pred_trt + tutor_pop) +
(1|mom_ID),
family = 'ordbeta', data)
kable(summary(model_mela)$coefficients)
|
plot_mb <- plot_results(model_mela, trait = "Melanistic Body")
plot_mb
model_otail <- glmmTMB(Tail.Orange.Relative.Area ~
pop + (pred_trt + tutor_pop) +
(1|mom_ID),
family = 'ordbeta', data)
kable(summary(model_otail)$coefficients)
|
plot_ot <- plot_results(model_otail, trait = "Orange Tail")
plot_ot
model_btail <- glmmTMB(Tail.Black.Relative.Area ~
pop + (pred_trt + tutor_pop) +
(1|mom_ID),
family = 'ordbeta', data)
kable(summary(model_btail)$coefficients)
|
plot_bt <- plot_results(model_btail, trait = "Black Tail")
plot_bt
model_onr <- glmmTMB(Body.Orange.Number ~
pop * (pred_trt + tutor_pop) +
(1|mom_ID),
family = 'genpois', data)
## Warning in (function (start, objective, gradient = NULL, hessian = NULL, :
## NA/NaN function evaluation
## Warning in (function (start, objective, gradient = NULL, hessian = NULL, :
## NA/NaN function evaluation
## Warning in (function (start, objective, gradient = NULL, hessian = NULL, :
## NA/NaN function evaluation
## Warning in (function (start, objective, gradient = NULL, hessian = NULL, :
## NA/NaN function evaluation
kable(summary(model_onr)$coefficients)
|
plot_on <- plot_results(model_onr, trait = "Orange Spots")
plot_on
model_bnr <- glmmTMB(Body.Black.Number ~
pop * (pred_trt + tutor_pop) +
(1|mom_ID),
family = 'genpois', data)
kable(summary(model_bnr)$coefficients)
|
plot_bn <- plot_results(model_bnr, trait = "Black Spots")
plot_bn
sjPlot::tab_model(model_orange, model_xantho,
model_black, model_mela,
model_otail, model_btail,
model_onr, model_bnr,
show.se = TRUE,
show.ci = FALSE,
collapse.se = TRUE,
show.icc = FALSE,
show.r2 = FALSE)
Body Orange Relative Area |
Body Xanthophore Relative Area |
Body Black Relative Area |
Body Melanistic Relative Area |
Tail Orange Relative Area | Tail Black Relative Area | Body Orange Number | Body Black Number | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Predictors | Estimates | p | Estimates | p | Estimates | p | Estimates | p | Estimates | p | Estimates | p | Incidence Rate Ratios | p | Incidence Rate Ratios | p |
(Intercept) |
0.05 (0.01) |
<0.001 |
0.06 (0.01) |
<0.001 |
0.24 (0.02) |
<0.001 |
0.29 (0.02) |
<0.001 |
0.24 (0.08) |
<0.001 |
0.16 (0.04) |
<0.001 |
1.25 (0.26) |
0.301 |
4.30 (0.31) |
<0.001 |
pop [AL] |
1.46 (0.28) |
0.042 |
1.36 (0.23) |
0.072 |
0.96 (0.08) |
0.641 |
0.93 (0.06) |
0.271 |
1.32 (0.58) |
0.523 |
1.85 (0.69) |
0.099 |
1.16 (0.34) |
0.624 |
1.02 (0.10) |
0.831 |
pred trt [Y] |
1.02 (0.07) |
0.777 |
0.99 (0.07) |
0.834 |
0.95 (0.05) |
0.301 |
0.96 (0.05) |
0.368 |
1.05 (0.12) |
0.661 |
0.93 (0.08) |
0.421 |
1.07 (0.07) |
0.312 |
0.96 (0.06) |
0.490 |
tutor pop [AH] |
0.78 (0.06) |
0.002 |
0.75 (0.06) |
<0.001 |
0.89 (0.06) |
0.095 |
0.96 (0.06) |
0.478 |
0.93 (0.13) |
0.606 |
0.82 (0.09) |
0.073 |
0.91 (0.08) |
0.290 |
1.07 (0.09) |
0.403 |
tutor pop [AL] |
0.81 (0.06) |
0.008 |
0.80 (0.06) |
0.005 |
0.86 (0.06) |
0.027 |
0.88 (0.05) |
0.036 |
1.06 (0.14) |
0.649 |
0.97 (0.11) |
0.794 |
0.77 (0.07) |
0.003 |
1.06 (0.09) |
0.458 |
pop [AL] × pred trt [Y] |
0.95 (0.09) |
0.579 |
0.98 (0.09) |
0.802 | ||||||||||||
pop [AL] × tutor pop [AH] |
1.03 (0.12) |
0.806 |
0.78 (0.09) |
0.032 | ||||||||||||
pop [AL] × tutor pop [AL] |
1.29 (0.15) |
0.033 |
1.02 (0.11) |
0.862 | ||||||||||||
Random Effects | ||||||||||||||||
σ2 | 3.02 | 2.94 | 1.76 | 1.58 | 1.52 | 1.82 | 0.14 | 0.10 | ||||||||
τ00 | 0.20 mom_ID | 0.16 mom_ID | 0.03 mom_ID | 0.01 mom_ID | 1.18 mom_ID | 0.90 mom_ID | 0.53 mom_ID | 0.01 mom_ID | ||||||||
N | 30 mom_ID | 30 mom_ID | 30 mom_ID | 30 mom_ID | 30 mom_ID | 30 mom_ID | 30 mom_ID | 30 mom_ID | ||||||||
Observations | 194 | 194 | 194 | 194 | 194 | 194 | 194 | 194 |
plot_ob + plot_xb +
plot_bb + plot_mb +
plot_ot + plot_bt +
plot_on + plot_bn +
plot_layout(ncol = 1,
axis_titles = "collect",
guides = "collect") +
plot_annotation(title = " High Predation Low Predation") &
theme(legend.position = 'bottom')