Loading required package: Matrix
Attaching package: 'Matrix'
The following objects are masked from 'package:tidyr':
expand, pack, unpack
library(glmmTMB)
Warning in checkDepPackageVersion(dep_pkg = "TMB"): Package version inconsistency detected.
glmmTMB was built with TMB version 1.9.1
Current TMB version is 1.9.2
Please re-install glmmTMB from source or restore original 'TMB' package (see '?reinstalling' for more information)
library(effects)
Loading required package: carData
lattice theme set by effectsTheme()
See ?effectsTheme for details.
library(car)
Attaching package: 'car'
The following object is masked from 'package:dplyr':
recode
The following object is masked from 'package:purrr':
some
library(bbmle)
Loading required package: stats4
Attaching package: 'bbmle'
The following object is masked from 'package:dplyr':
slice
m5 <-glmer(formula = moving~temp+day_of_experiment+infected+total_alive+(1|parent), family ="poisson", data = behavior)
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model is nearly unidentifiable: very large eigenvalue
- Rescale variables?
# Warning: Model is nearly unidentifiable: very large eigenvalueplot(allEffects(m5))
m5.2<-glmer(formula = moving~temp+day_of_experiment+infected+(1|parent), family ="poisson", data = behavior)
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model is nearly unidentifiable: very large eigenvalue
- Rescale variables?
# Warning: Model is nearly unidentifiable: very large eigenvalueplot(allEffects(m5.2))
Model 5.3: everything except infected
m5.3<-glmer(formula = moving~temp+day_of_experiment+total_alive+(1|parent), family ="poisson", data = behavior)
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model is nearly unidentifiable: very large eigenvalue
- Rescale variables?
# Warning: Model is nearly unidentifiable: very large eigenvalueplot(allEffects(m5.3))
Model 5.4; everything except day_of_experiment
m5.4<-glmer(formula = moving~temp+infected+total_alive+(1|parent), family ="poisson", data = behavior)
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
Model failed to converge with max|grad| = 0.0026707 (tol = 0.002, component 1)
Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model is nearly unidentifiable: very large eigenvalue
- Rescale variables?
# Warning: Model is nearly unidentifiable: very large eigenvalueplot(allEffects(m5.4))
movingprop = (behaviorprop$moving/behaviorprop$total_alive)behaviorprop<-cbind(behaviorprop,movingprop)m5.0<-glmer(formula = movingprop~temp+day_of_experiment+infected+total_alive+(1|parent), family ="binomial", data = behaviorprop)
Warning in eval(family$initialize, rho): non-integer #successes in a binomial
glm!
boundary (singular) fit: see help('isSingular')
m5.0
Generalized linear mixed model fit by maximum likelihood (Laplace
Approximation) [glmerMod]
Family: binomial ( logit )
Formula: movingprop ~ temp + day_of_experiment + infected + total_alive +
(1 | parent)
Data: behaviorprop
AIC BIC logLik deviance df.resid
1239.060 1269.988 -613.530 1227.060 1274
Random effects:
Groups Name Std.Dev.
parent (Intercept) 0
Number of obs: 1280, groups: parent, 6
Fixed Effects:
(Intercept) temp day_of_experiment infected
-6.54224 0.14029 0.01907 0.55502
total_alive
0.01670
optimizer (Nelder_Mead) convergence code: 0 (OK) ; 0 optimizer warnings; 1 lme4 warnings
plot(allEffects(m5.0))
Warning in eval(family$initialize): non-integer #successes in a binomial glm!
Warning in eval(family$initialize): non-integer #successes in a binomial glm!
Warning in eval(family$initialize): non-integer #successes in a binomial glm!
Warning in eval(family$initialize): non-integer #successes in a binomial glm!
m5.32<-glmer(formula = movingprop~temp+day_of_experiment+total_alive+(1|parent), family ="binomial", data = behavior)
Warning in eval(family$initialize, rho): non-integer #successes in a binomial
glm!
boundary (singular) fit: see help('isSingular')
summary(m5.32)
Generalized linear mixed model fit by maximum likelihood (Laplace
Approximation) [glmerMod]
Family: binomial ( logit )
Formula: movingprop ~ temp + day_of_experiment + total_alive + (1 | parent)
Data: behavior
AIC BIC logLik deviance df.resid
1250.5 1276.3 -620.3 1240.5 1275
Scaled residuals:
Min 1Q Median 3Q Max
-0.8558 -0.1767 0.1865 0.6776 3.0977
Random effects:
Groups Name Variance Std.Dev.
parent (Intercept) 0 0
Number of obs: 1280, groups: parent, 6
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -6.308141 0.789518 -7.990 1.35e-15 ***
temp 0.143824 0.014468 9.941 < 2e-16 ***
day_of_experiment 0.012046 0.005648 2.133 0.033 *
total_alive 0.016368 0.051934 0.315 0.753
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Correlation of Fixed Effects:
(Intr) temp dy_f_x
temp -0.784
dy_f_xprmnt -0.417 0.259
total_alive -0.763 0.214 0.290
optimizer (Nelder_Mead) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
plot(allEffects(m5.32))
Warning in eval(family$initialize): non-integer #successes in a binomial glm!
Warning in eval(family$initialize): non-integer #successes in a binomial glm!
Warning in eval(family$initialize): non-integer #successes in a binomial glm!
behaviorprop$notmoving <- behaviorprop$total_alive-behaviorprop$movingm5.5<-glmer(formula =cbind(moving,notmoving)~temp+day_of_experiment+infected+total_alive+(1|parent), family ="binomial", data = behaviorprop)summary(m5.5)
Generalized linear mixed model fit by maximum likelihood (Laplace
Approximation) [glmerMod]
Family: binomial ( logit )
Formula: cbind(moving, notmoving) ~ temp + day_of_experiment + infected +
total_alive + (1 | parent)
Data: behaviorprop
AIC BIC logLik deviance df.resid
5754.6 5785.6 -2871.3 5742.6 1274
Scaled residuals:
Min 1Q Median 3Q Max
-3.3967 -1.1616 -0.1752 1.0143 4.7198
Random effects:
Groups Name Variance Std.Dev.
parent (Intercept) 0.03356 0.1832
Number of obs: 1280, groups: parent, 6
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -4.107939 0.276666 -14.848 < 2e-16 ***
temp 0.082134 0.003778 21.739 < 2e-16 ***
day_of_experiment 0.012191 0.002035 5.991 2.08e-09 ***
infected 0.103004 0.046465 2.217 0.02664 *
total_alive 0.066495 0.021555 3.085 0.00204 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Correlation of Fixed Effects:
(Intr) temp dy_f_x infctd
temp -0.588
dy_f_xprmnt -0.403 0.112
infected -0.140 0.066 0.205
total_alive -0.838 0.167 0.369 0.019