> KBD <- read.table("clipboard", header=TRUE, stringsAsFactors=TRUE, sep="\t", na.strings="NA", dec=",", + strip.white=TRUE) > library(lme4) > library(lmerTest) > library(ggplot2) > library(performance) > library(bestNormalize) > library(emmeans) > glmm4 <- glmer(KBD ~ breed + perch_height + (1|farm), family = binomial, data=KBD) > summary(glmm4) Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod'] Family: binomial ( logit ) Formula: KBD ~ breed + perch_height + (1 | farm) Data: KBD AIC BIC logLik deviance df.resid 351.7 403.0 -161.8 323.7 275 Scaled residuals: Min 1Q Median 3Q Max -2.3022 -0.7746 0.0000 0.8228 3.1847 Random effects: Groups Name Variance Std.Dev. farm (Intercept) 1.328e-10 0.00001152 Number of obs: 289, groups: farm, 6 Fixed effects: Estimate Std. Error z value Pr(>|z|) (Intercept) -3.74657 1.52819 -2.452 0.01422 * breed[T.Australorps] 0.22314 1.05661 0.211 0.83275 breed[T.Bielefelder] -20.88652 724.07779 -0.029 0.97699 breed[T.Brabanter] -1.56862 1.28762 -1.218 0.22314 breed[T.Dresdner] 0.42003 0.94891 0.443 0.65802 breed[T.Lohmann_Brown] 1.31000 0.91116 1.438 0.15051 breed[T.Marans] 0.33744 0.79659 0.424 0.67185 breed[T.Malines] -0.72733 0.83323 -0.873 0.38272 breed[T.Eastfrisian_Gull] 0.90100 0.77457 1.163 0.24474 breed[T.German Cuckoo] 2.71782 0.83787 3.244 0.00118 ** breed[T.Sulmtaler] -0.58266 0.98556 -0.591 0.55439 breed[T.Sundheimer_Bantam] 1.58941 1.31656 1.207 0.22734 perch_height 0.05393 0.02238 2.410 0.01595 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 optimizer (Nelder_Mead) convergence code: 0 (OK) boundary (singular) fit: see help('isSingular') > glmm5 <- glmer(KBD ~ breed + (1|farm), family = binomial, data=KBD) > summary(glmm5) Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod'] Family: binomial ( logit ) Formula: KBD ~ breed + (1 | farm) Data: KBD AIC BIC logLik deviance df.resid 353.7 401.4 -163.9 327.7 276 Scaled residuals: Min 1Q Median 3Q Max -2.31371 -0.75998 -0.00038 0.83242 2.84586 Random effects: Groups Name Variance Std.Dev. farm (Intercept) 0.1561 0.3951 Number of obs: 289, groups: farm, 6 Fixed effects: Estimate Std. Error z value Pr(>|z|) (Intercept) -1.06802 0.84618 -1.262 0.20689 breed[T.Australorps] 0.22483 1.06083 0.212 0.83215 breed[T.Bielefelder] -14.35943 724.07780 -0.020 0.98418 breed[T.Brabanter] -0.91039 1.38997 -0.655 0.51249 breed[T.Dresdner] 0.33880 0.96046 0.353 0.72427 breed[T.Lohmann_Brown] 1.26821 0.91684 1.383 0.16659 breed[T.Marans] 0.63241 0.85314 0.741 0.45853 breed[T.Malines] -0.25645 0.97332 -0.263 0.79218 breed[T.Eastfrisian_Gull] 0.88298 0.77869 1.134 0.25683 breed[T.German_Cuckoo] 2.75882 0.99932 2.761 0.00577 ** breed[T.Sulmtaler] -0.04156 1.10832 -0.037 0.97009 breed[T.Sundheimer_Bantam] 1.06805 1.38090 0.773 0.43926 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Correlation of Fixed Effects: (Intr) R[T.A] R[T.B] R[T.B_ R[T.D] R[T.L_ Rss[T.Mr] Rss[T.Mc] R[T.O_ Rss[T.Sp] Rss[T.Sl] brd[T.Astr] -0.599 brd[T.Blfl] -0.001 0.000 brd[T.Brbn] -0.603 0.365 0.001 brd[T.Drsd] -0.757 0.528 0.001 0.465 brd[T.Lh_B] -0.757 0.553 0.001 0.464 0.652 brd[T.Mrn] -0.892 0.594 0.001 0.583 0.727 0.735 brd[T.Mlns] -0.867 0.521 0.001 0.588 0.665 0.664 0.825 brd[T.Es_G] -0.852 0.651 0.001 0.520 0.742 0.769 0.836 0.744 brd[T.Gr_C] -0.851 0.507 0.001 0.513 0.643 0.643 0.758 0.738 0.722 brd[T.Slmt] -0.762 0.457 0.001 0.516 0.585 0.583 0.725 0.734 0.653 0.649 brd[T.S_Bn] -0.613 0.367 0.001 0.370 0.464 0.464 0.546 0.531 0.522 0.521 0.467 optimizer (Nelder_Mead) convergence code: 0 (OK) Model is nearly unidentifiable: large eigenvalue ratio - Rescale variables? > anova(glmm4, glmm5) Data: KBD Models: glmm5: KBD ~ breed + (1 | farm) glmm4: KBD ~ breed + perch_height + (1 | farm) npar AIC BIC logLik deviance Chisq Df Pr(>Chisq) glmm5 13 353.73 401.39 -163.86 327.73 glmm4 14 351.68 403.01 -161.84 323.68 4.0465 1 0.04426 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > glmm6 <- glmer(KBD ~ perch_height + (1|farm), family = binomial, data=KBD) > summary(glmm6) Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod'] Family: binomial ( logit ) Formula: KBD ~ perch_height + (1 | farm) Data: KBD AIC BIC logLik deviance df.resid 350.3 361.3 -172.2 344.3 286 Scaled residuals: Min 1Q Median 3Q Max -2.1178 -0.5568 -0.5246 0.8426 1.9061 Random effects: Groups Name Variance Std.Dev. farm (Intercept) 1.23 1.109 Number of obs: 289, groups: Betrieb_Nr, 6 Fixed effects: Estimate Std. Error z value Pr(>|z|) (Intercept) -1.04515 2.79044 -0.375 0.708 perch_height 0.01436 0.05498 0.261 0.794 Correlation of Fixed Effects: (Intr) prch_hght -0.984 > anova(glmm4, glmm6) Data: KBD Models: glmm6: KBD ~ perch_height + (1 | farm) glmm4: KBD ~ breed + perch_height + (1 | farm) npar AIC BIC logLik deviance Chisq Df Pr(>Chisq) glmm6 3 350.34 361.34 -172.17 344.34 glmm4 14 351.68 403.01 -161.84 323.68 20.659 11 0.03708 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 > glmm4.emm <- emmeans(glmm4, ~ breed) > pairs(glmm4.emm) contrast estimate SE df z.ratio p.value Augsburger - Australorps -0.2231 1.057 Inf -0.211 1.0000 Augsburger - Bielefelder 20.8865 724.078 Inf 0.029 1.0000 Augsburger - Brabanter 1.5686 1.288 Inf 1.218 0.9877 Augsburger - Dresdner -0.4200 0.949 Inf -0.443 1.0000 Augsburger - Lohmann_Brown -1.3100 0.911 Inf -1.438 0.9562 Augsburger - Marans -0.3374 0.797 Inf -0.424 1.0000 Augsburger - Malines 0.7273 0.833 Inf 0.873 0.9994 Augsburger - Eastfrisian_Gull -0.9010 0.775 Inf -1.163 0.9916 Augsburger - German_Cuckoo -2.7178 0.838 Inf -3.244 0.0539 Augsburger - Sulmtaler 0.5827 0.986 Inf 0.591 1.0000 Augsburger - (Sundheimer_Bantam) -1.5894 1.317 Inf -1.207 0.9885 Australorps - Bielefelder 21.1097 724.079 Inf 0.029 1.0000 Australorps - Brabanter 1.7918 1.307 Inf 1.371 0.9690 Australorps - Dresdner -0.1969 0.975 Inf -0.202 1.0000 Australorps - Lohmann_Brown -1.0869 0.938 Inf -1.158 0.9919 Australorps - Marans -0.1143 0.828 Inf -0.138 1.0000 Australorps - Malines 0.9505 0.863 Inf 1.102 0.9947 Australorps - Eastfrisian_Gull -0.6779 0.806 Inf -0.841 0.9995 Australorps - German_Cuckoo -2.4947 0.867 Inf -2.876 0.1493 Australorps - Sulmtaler 0.8058 1.011 Inf 0.797 0.9997 Australorps - (Sundheimer_Bantam) -1.3663 1.335 Inf -1.023 0.9972 Bielefelder - Brabanter -19.3179 724.080 Inf -0.027 1.0000 Bielefelder - Dresdner -21.3066 724.079 Inf -0.029 1.0000 Bielefelder - Lohmann_Brown -22.1965 724.079 Inf -0.031 1.0000 Bielefelder - Marans -21.2240 724.079 Inf -0.029 1.0000 Bielefelder - Malines -20.1592 724.079 Inf -0.028 1.0000 Bielefelder - Eastfrisian_Gull -21.7875 724.079 Inf -0.030 1.0000 Bielefelder - German_Cuckoo -23.6043 724.079 Inf -0.033 1.0000 Bielefelder - Sulmtaler -20.3039 724.079 Inf -0.028 1.0000 Bielefelder - (Sundheimer_Bantam) -22.4759 724.080 Inf -0.031 1.0000 Brabanter - Dresdner -1.9886 1.222 Inf -1.628 0.8991 Brabanter - Lohmann_Brown -2.8786 1.192 Inf -2.414 0.3963 Brabanter - Marans -1.9061 1.107 Inf -1.721 0.8589 Brabanter - Malines -0.8413 1.134 Inf -0.742 0.9999 Brabanter - Eastfrisian_Gull -2.4696 1.092 Inf -2.262 0.5039 Brabanter - German_Cuckoo -4.2864 1.137 Inf -3.768 0.0090 Brabanter - Sulmtaler -0.9860 1.250 Inf -0.789 0.9998 Brabanter - (Sundheimer_Bantam) -3.1580 1.525 Inf -2.071 0.6437 Dresdner - Lohmann_Brown -0.8900 0.786 Inf -1.132 0.9933 Dresdner - Marans 0.0826 0.670 Inf 0.123 1.0000 Dresdner - Malines 1.1474 0.713 Inf 1.608 0.9065 Dresdner - Eastfrisian_Gull -0.4810 0.642 Inf -0.749 0.9999 Dresdner - German_Cuckoo -2.2978 0.672 Inf -3.417 0.0311 Dresdner - Sulmtaler 1.0027 0.889 Inf 1.128 0.9935 Dresdner - (Sundheimer_Bantam) -1.1694 1.183 Inf -0.989 0.9980 Lohmann_Brown - Marans 0.9726 0.621 Inf 1.567 0.9211 Lohmann_Brown - Malines 2.0373 0.667 Inf 3.053 0.0939 Lohmann_Brown - Eastfrisian_Gull 0.4090 0.592 Inf 0.691 0.9999 Lohmann_Brown - German_Cuckoo -1.4078 0.641 Inf -2.197 0.5519 Lohmann_Brown - Sulmtaler 1.8927 0.852 Inf 2.222 0.5333 Lohmann_Brown - (Sundheimer_Bantam) -0.2794 1.178 Inf -0.237 1.0000 Maran - Malines 1.0648 0.507 Inf 2.100 0.6227 Maran - Eastfrisian_Gull -0.5636 0.403 Inf -1.399 0.9640 Maran - German_Cuckoo -2.3804 0.496 Inf -4.795 0.0001 Maran - Sulmtaler 0.9201 0.732 Inf 1.257 0.9841 Maran - (Sundheimer_Bantam) -1.2520 1.120 Inf -1.118 0.9940 Malines - Eastfrisian_Gull -1.6283 0.471 Inf -3.455 0.0274 Malines - German_Cuckoo -3.4451 0.554 Inf -6.220 <.0001 Malines - Sulmtaler -0.1447 0.771 Inf -0.188 1.0000 Malines - (Sundheimer_Bantam) -2.3167 1.147 Inf -2.020 0.6795 Eastfrisian_Gull - German_Cuckoo -1.8168 0.459 Inf -3.962 0.0043 Eastfrisian_Gull - Sulmtaler 1.4837 0.708 Inf 2.097 0.6249 Eastfrisian_Gull - (Sundheimer_Bantam) -0.6884 1.103 Inf -0.624 1.0000 German_Cuckoo - Sulmtaler 3.3005 0.768 Inf 4.300 0.0010 German_Cuckoo - (Sundheimer_Bantam) 1.1284 1.081 Inf 1.044 0.9967 Sulmtaler - (Sundheimer_Bantam) -2.1721 1.266 Inf -1.716 0.8614 Results are given on the log odds ratio (not the response) scale. P value adjustment: tukey method for comparing a family of 12 estimates