I have the following model in r that compares the differences between dives where whales fed and dives where whales didn't fed (distribution is binomial: presence of feeding (foraging) = 1, abscence = 0). Whale (18 individuals) is used as random factor.
I included several metrics in the model: dive duration, maximum depth, descent/ascent rate, etc... and used scale on all numerical metrics (scale())
g_model <- glmer(foraging~max_depths*diel_2+duration+pd_times+d_rate+a_rate+bottom_prop+(1|whale),
data=data, control=glmerControl(optimizer="bobyqa",optCtrl=list(maxfun=2e5)),
family="binomial", na.action = na.fail)
summary(g_model)
Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod']
Family: binomial ( logit )
Formula: foraging ~ max_depths * diel_2 + duration + pd_times + d_rate +
a_rate + bottom_prop + (1 | whale)
Data: data
Control: glmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 2e+05))
AIC BIC logLik deviance df.resid
1244.6 1301.4 -612.3 1224.6 2164
Scaled residuals:
Min 1Q Median 3Q Max
-99.364 -0.195 0.083 0.285 4.311
Random effects:
Groups Name Variance Std.Dev.
whale (Intercept) 0.2201 0.4692
Number of obs: 2174, groups: whale, 18
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.5621 0.1600 3.514 0.000441 ***
max_depths 1.9123 0.1863 10.266 < 2e-16 ***
diel_2Night 1.5491 0.2577 6.012 1.83e-09 ***
duration -0.3535 0.1516 -2.331 0.019739 *
pd_times -0.6118 0.1531 -3.996 6.45e-05 ***
d_rate 0.6536 0.1099 5.949 2.70e-09 ***
a_rate -0.3688 0.1248 -2.955 0.003122 **
bottom_prop 2.8876 0.1343 21.502 < 2e-16 ***
max_depths:diel_2Night 1.9049 0.3184 5.984 2.18e-09 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) mx_dpt dl_2Ng duratn pd_tms d_rate a_rate bttm_p
max_depths -0.083
diel_2Night -0.313 0.206
duration -0.115 -0.678 0.066
pd_times 0.034 -0.037 -0.020 -0.098
d_rate 0.079 -0.131 -0.042 0.409 -0.015
a_rate 0.095 -0.659 -0.139 0.423 0.093 -0.134
bottom_prop 0.086 0.628 0.158 -0.449 -0.083 0.078 -0.248
mx_dpth:_2N 0.065 0.034 0.600 -0.165 0.066 -0.138 -0.081 0.168
Two of the values do not make sense at all: duration and pd_times (post-dive duration).
Feeding dives are usually longer and since they have a high energetic cost whales usually rest for a while after at surface. Nevertheless, estimates are negative for both metrics. I know that just because that's common knowledge it doesn't mean my data will follow those assumptions but when I make boxplots of the data, duration is quite higher in feeding dives, contrary to what the model says (graph below). The post-dive duration graph is just weird (I suppose it is because of the outliers) and I can't really figure out anything out of it (also if you know what I should do to correct this boxplot it would be awesome! Graph below as well).
It was suggested that I should mean-center the variables, how can I do it? Or did I already did that by scaling? I already looked for correlation between variables and found nothing. Looked at differences between individuals (only one individual in 18 performed longer non-feeding dives than feeding dives, and thats because it only had 2 long non-feeding dives). I can't really figure it out.
F = feeding dives/ NF = non-feeding dives
Thank you!
duration
variable globally, which will not help. You also need to include the means for each whale in the model. $\endgroup$