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
Rows: 2008 Columns: 18
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (5): microcolony, date, date_withyr, observer_initials, notes
dbl (11): replicate, temp, moving, feeding, stationary, incubating, fanning...
lgl (1): drop
time (1): time
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# Original model is best- should I be skeptical of the performance score of 100%?
run best model (model 4) with proportion data
#1242 49 85fanningprop = (behaviorprop$fanning/behaviorprop$total_alive)behaviorprop<-cbind(behaviorprop,fanningprop)behaviorprop <- behaviorprop %>%filter(fanningprop<=1)m4.01<-glmer(formula = fanningprop~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')
m4.01
Generalized linear mixed model fit by maximum likelihood (Laplace
Approximation) [glmerMod]
Family: binomial ( logit )
Formula: fanningprop ~ temp + day_of_experiment + infected + total_alive +
(1 | parent)
Data: behaviorprop
AIC BIC logLik deviance df.resid
508.2661 539.1797 -248.1331 496.2661 1271
Random effects:
Groups Name Std.Dev.
parent (Intercept) 0
Number of obs: 1277, groups: parent, 6
Fixed Effects:
(Intercept) temp day_of_experiment infected
-7.48191 0.20163 -0.05126 -0.91080
total_alive
-0.15886
optimizer (Nelder_Mead) convergence code: 0 (OK) ; 0 optimizer warnings; 1 lme4 warnings
plot(allEffects(m4.01))
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!
behaviorprop$notfanning <- behaviorprop$total_alive-behaviorprop$fanningm4.5<-glmer(formula =cbind(fanning,notfanning)~temp+day_of_experiment+infected+total_alive+(1|parent), family ="binomial", data = behaviorprop)summary(m4.5)
Generalized linear mixed model fit by maximum likelihood (Laplace
Approximation) [glmerMod]
Family: binomial ( logit )
Formula: cbind(fanning, notfanning) ~ temp + day_of_experiment + infected +
total_alive + (1 | parent)
Data: behaviorprop
AIC BIC logLik deviance df.resid
3250.5 3281.4 -1619.3 3238.5 1271
Scaled residuals:
Min 1Q Median 3Q Max
-2.7866 -0.7722 -0.2869 0.3127 30.5462
Random effects:
Groups Name Variance Std.Dev.
parent (Intercept) 0.4394 0.6629
Number of obs: 1277, groups: parent, 6
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -12.475342 0.546920 -22.810 < 2e-16 ***
temp 0.305227 0.009483 32.187 < 2e-16 ***
day_of_experiment -0.043913 0.004581 -9.586 < 2e-16 ***
infected -0.178422 0.066461 -2.685 0.00726 **
total_alive 0.043141 0.028476 1.515 0.12977
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Correlation of Fixed Effects:
(Intr) temp dy_f_x infctd
temp -0.701
dy_f_xprmnt -0.216 0.016
infected -0.094 0.042 0.141
total_alive -0.585 0.122 0.285 0.003