Data Analysis
ggplot(pollen, aes(x=difference, fill = treatment)) +
geom_histogram(position = "identity", binwidth = 0.05,col=I("black")) +
scale_fill_manual(values = c("peachpuff3", "darkseagreen", "lightseagreen", "darkolivegreen3", "darkolivegreen4"),
name = "Pristine Level",
labels = c("Treatment 1 (control)", "Treatment 2",
"Treatment 3", "Treatment 4", "Treatment 5")) +
ggtitle("Pollen Consumption (g)") +
labs(y = "Number of Pollen Balls", x = "Pollen Consumed (g)") +
facet_wrap(vars(treatment)) +
theme(legend.position = "none")

shapiro.test(pollen$difference)
##
## Shapiro-Wilk normality test
##
## data: pollen$difference
## W = 0.84265, p-value < 2.2e-16
pollen$boxp <- bcPower(pollen$difference, -3, gamma=1)
shapiro.test(pollen$boxp)
##
## Shapiro-Wilk normality test
##
## data: pollen$boxp
## W = 0.9588, p-value = 2.044e-15
ggplot(pollen, aes(x=boxp, fill = treatment)) +
geom_histogram(position = "identity", binwidth = 0.009,col=I("black")) +
scale_fill_manual(values = c("peachpuff3", "darkseagreen", "lightseagreen", "darkolivegreen3", "darkolivegreen4"),
name = "Pristine Level",
labels = c("Treatment 1 (control)", "Treatment 2",
"Treatment 3", "Treatment 4", "Treatment 5")) +
ggtitle("Pollen Consumption (g) - BoxCox Transformed") +
labs(y = "Number of Pollen Balls", x = "Pollen Consumed (g), BoxCox power transformation")

pbox <- lmer(boxp ~ treatment*count + bees_alive + qro + start_date + (1|colony), data = pollen)
summary(pbox)
## Linear mixed model fit by REML ['lmerMod']
## Formula: boxp ~ treatment * count + bees_alive + qro + start_date + (1 |
## colony)
## Data: pollen
##
## REML criterion at convergence: -2509.2
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.5630 -0.5737 0.0368 0.6202 3.9231
##
## Random effects:
## Groups Name Variance Std.Dev.
## colony (Intercept) 0.000509 0.02256
## Residual 0.001552 0.03940
## Number of obs: 920, groups: colony, 45
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 86.5331642 19.5487027 4.427
## treatment2 -0.0180558 0.0214217 -0.843
## treatment3 -0.0192845 0.0214074 -0.901
## treatment4 -0.0033824 0.0214026 -0.158
## treatment5 -0.0172195 0.0214038 -0.805
## count3 -0.0103931 0.0186840 -0.556
## count4 -0.0042830 0.0190132 -0.225
## count5 -0.0387872 0.0195496 -1.984
## count6 -0.0165258 0.0202766 -0.815
## count7 0.0338456 0.0211748 1.598
## count8 0.0535410 0.0222103 2.411
## count9 0.0749028 0.0233871 3.203
## count10 0.1045661 0.0246643 4.240
## count11 0.1419380 0.0260382 5.451
## count12 0.1562468 0.0274997 5.682
## count13 0.1633240 0.0290302 5.626
## count14 0.1709688 0.0306193 5.584
## count15 0.1771787 0.0322584 5.492
## count16 0.1967305 0.0339403 5.796
## count17 0.2138176 0.0359909 5.941
## count18 0.2117700 0.0373792 5.665
## count19 0.2255124 0.0391491 5.760
## count20 0.2157045 0.0409437 5.268
## count21 0.1949026 0.0446791 4.362
## count22 0.1965224 0.0464550 4.230
## count23 0.2017282 0.0482349 4.182
## count24 0.2272445 0.0545237 4.168
## count25 0.2366922 0.0562031 4.211
## count26 0.2515664 0.0579053 4.344
## count27 0.2495314 0.0596282 4.185
## count28 0.2793146 0.0674219 4.143
## count29 0.2565208 0.0693698 3.698
## bees_alive 0.0160070 0.0031809 5.032
## qroB3 -0.0064409 0.0128056 -0.503
## qroB4 0.0226992 0.0127494 1.780
## qroB5 -0.0129803 0.0099619 -1.303
## start_date -0.0044974 0.0010169 -4.423
## treatment2:count3 0.0284732 0.0262662 1.084
## treatment3:count3 0.0245135 0.0262662 0.933
## treatment4:count3 0.0324498 0.0262686 1.235
## treatment5:count3 0.0275828 0.0262662 1.050
## treatment2:count4 0.0355395 0.0262662 1.353
## treatment3:count4 0.0175317 0.0262662 0.667
## treatment4:count4 0.0206685 0.0267265 0.773
## treatment5:count4 -0.0079657 0.0266922 -0.298
## treatment2:count5 0.0691795 0.0262662 2.634
## treatment3:count5 0.0826735 0.0272286 3.036
## treatment4:count5 0.0466502 0.0267265 1.745
## treatment5:count5 0.0440283 0.0262672 1.676
## treatment2:count6 0.0846647 0.0262662 3.223
## treatment3:count6 0.0609160 0.0262662 2.319
## treatment4:count6 0.0418735 0.0272662 1.536
## treatment5:count6 0.0067789 0.0266920 0.254
## treatment2:count7 0.0489226 0.0262662 1.863
## treatment3:count7 0.0323227 0.0262662 1.231
## treatment4:count7 0.0043374 0.0263042 0.165
## treatment5:count7 -0.0212626 0.0262672 -0.809
## treatment2:count8 0.0473865 0.0262686 1.804
## treatment3:count8 0.0342191 0.0262686 1.303
## treatment4:count8 0.0137990 0.0262876 0.525
## treatment5:count8 0.0156954 0.0262693 0.597
## treatment2:count9 0.0441203 0.0262686 1.680
## treatment3:count9 0.0397612 0.0262686 1.514
## treatment4:count9 0.0328302 0.0262876 1.249
## treatment5:count9 0.0264910 0.0262693 1.008
## treatment2:count10 0.0518504 0.0262757 1.973
## treatment3:count10 0.0353707 0.0262757 1.346
## treatment4:count10 0.0336417 0.0262757 1.280
## treatment5:count10 0.0176678 0.0262772 0.672
## treatment2:count11 0.0429482 0.0262876 1.634
## treatment3:count11 0.0327437 0.0262893 1.246
## treatment4:count11 0.0342425 0.0262686 1.304
## treatment5:count11 0.0121041 0.0267262 0.453
## treatment2:count12 0.0588385 0.0262876 2.238
## treatment3:count12 0.0486916 0.0262893 1.852
## treatment4:count12 0.0331558 0.0262686 1.262
## treatment5:count12 0.0423302 0.0272633 1.553
## treatment2:count13 0.0509896 0.0262757 1.941
## treatment3:count13 0.0478751 0.0262698 1.822
## treatment4:count13 0.0249028 0.0262686 0.948
## treatment5:count13 0.0390906 0.0267262 1.463
## treatment2:count14 0.0451479 0.0262686 1.719
## treatment3:count14 0.0437573 0.0262698 1.666
## treatment4:count14 0.0226688 0.0266955 0.849
## treatment5:count14 0.0318472 0.0267262 1.192
## treatment2:count15 0.0348557 0.0262662 1.327
## treatment3:count15 0.0355391 0.0262698 1.353
## treatment4:count15 0.0089681 0.0262686 0.341
## treatment5:count15 0.0162470 0.0267262 0.608
## treatment2:count16 0.0113472 0.0266923 0.425
## treatment3:count16 0.0314799 0.0262698 1.198
## treatment4:count16 -0.0204105 0.0262686 -0.777
## treatment5:count16 0.0019678 0.0272515 0.072
## treatment2:count17 0.0089828 0.0266914 0.337
## treatment3:count17 0.0297449 0.0266927 1.114
## treatment4:count17 -0.0201039 0.0266914 -0.753
## treatment5:count17 0.0147797 0.0271318 0.545
## treatment2:count18 0.0055031 0.0262686 0.209
## treatment3:count18 0.0377654 0.0263062 1.436
## treatment4:count18 0.0047245 0.0262757 0.180
## treatment5:count18 0.0162292 0.0267577 0.607
## treatment2:count19 -0.0008599 0.0267543 -0.032
## treatment3:count19 0.0344056 0.0263278 1.307
## treatment4:count19 -0.0098333 0.0262757 -0.374
## treatment5:count19 0.0060246 0.0267812 0.225
## treatment2:count20 0.0001901 0.0267803 0.007
## treatment3:count20 0.0449391 0.0267480 1.680
## treatment4:count20 0.0238545 0.0267110 0.893
## treatment5:count20 0.0440210 0.0273427 1.610
## treatment2:count21 0.0286000 0.0297903 0.960
## treatment3:count21 0.0608540 0.0304185 2.001
## treatment4:count21 0.0307142 0.0325910 0.942
## treatment5:count21 0.0167351 0.0298138 0.561
## treatment2:count22 0.0530423 0.0345949 1.533
## treatment3:count22 0.0449991 0.0312919 1.438
## treatment4:count22 0.0357949 0.0383072 0.934
## treatment5:count22 0.0173960 0.0313235 0.555
## treatment2:count23 0.0805306 0.0476865 1.689
## treatment3:count23 0.0425356 0.0326223 1.304
## treatment4:count23 0.0409215 0.0383031 1.068
## treatment5:count23 0.0189413 0.0346081 0.547
## treatment2:count24 0.0562808 0.0525744 1.070
## treatment3:count24 0.0608178 0.0409778 1.484
## treatment4:count24 0.0076144 0.0525627 0.145
## treatment5:count24 -0.0027764 0.0525272 -0.053
## treatment3:count25 0.0159209 0.0524813 0.303
## treatment4:count25 0.0189102 0.0525627 0.360
## treatment5:count25 -0.0133602 0.0525272 -0.254
## treatment3:count26 0.0082840 0.0524813 0.158
## treatment4:count26 0.0136409 0.0525627 0.260
## treatment5:count26 -0.0077115 0.0525272 -0.147
## treatment3:count27 0.0079056 0.0524813 0.151
## treatment4:count27 0.0328278 0.0525627 0.625
## treatment5:count27 0.0123843 0.0525272 0.236
## treatment3:count28 -0.0785247 0.0600614 -1.307
## treatment4:count28 0.0065020 0.0598577 0.109
## treatment5:count28 -0.0125590 0.0601060 -0.209
## treatment5:count29 0.0130857 0.0596826 0.219
## fit warnings:
## fixed-effect model matrix is rank deficient so dropping 7 columns / coefficients
freq <- table(pollen$colony)
freq
##
## 1.11R2 1.12R2 1.1R2 1.2R2 1.3R2 1.4R2 1.5R2 1.7R2 1.9R2 2.11R2 2.12R2
## 22 22 19 27 22 19 19 19 26 20 21
## 2.1R2 2.2R2 2.3R2 2.4R2 2.5R2 2.7R2 2.9R2 3.11R2 3.12R2 3.1R2 3.2R2
## 19 23 19 17 20 20 21 21 27 23 20
## 3.3R2 3.4R2 3.5R2 3.7R2 3.9R2 4.11R2 4.12R2 4.1R2 4.2R2 4.3R2 4.4R2
## 18 21 19 22 19 18 19 20 20 19 19
## 4.5R2 4.7R2 4.9R2 5.11R2 5.12R2 5.1R2 5.2R2 5.3R2 5.4R2 5.5R2 5.7R2
## 27 18 18 20 27 21 22 9 20 19 18
## 5.9R2
## 21
drop1(pbox, test = "Chisq")
## Single term deletions
##
## Model:
## boxp ~ treatment * count + bees_alive + qro + start_date + (1 |
## colony)
## npar AIC LRT Pr(Chi)
## <none> -3117.9
## bees_alive 1 -3091.4 28.470 9.514e-08 ***
## qro 3 -3115.5 8.432 0.03787 *
## start_date 1 -3099.5 20.408 6.258e-06 ***
## treatment:count 101 -3218.2 101.698 0.46181
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(pbox)

qqnorm(resid(pbox));qqline(resid(pbox))

boxemm <- emmeans(pbox, pairwise ~ treatment | count)
pairs(boxemm)
## count = 2:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 0.018056 0.0214 335 0.843 0.9170
## treatment1 - treatment3 0.019285 0.0214 337 0.901 0.8965
## treatment1 - treatment4 0.003382 0.0214 337 0.158 0.9999
## treatment1 - treatment5 0.017219 0.0214 337 0.805 0.9291
## treatment2 - treatment3 0.001229 0.0214 337 0.057 1.0000
## treatment2 - treatment4 -0.014673 0.0214 335 -0.685 0.9596
## treatment2 - treatment5 -0.000836 0.0214 336 -0.039 1.0000
## treatment3 - treatment4 -0.015902 0.0214 337 -0.743 0.9462
## treatment3 - treatment5 -0.002065 0.0214 337 -0.096 1.0000
## treatment4 - treatment5 0.013837 0.0214 337 0.646 0.9672
##
## count = 3:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.010417 0.0214 335 -0.486 0.9886
## treatment1 - treatment3 -0.005229 0.0214 337 -0.244 0.9992
## treatment1 - treatment4 -0.029067 0.0214 337 -1.358 0.6550
## treatment1 - treatment5 -0.010363 0.0214 337 -0.484 0.9888
## treatment2 - treatment3 0.005188 0.0214 337 0.242 0.9992
## treatment2 - treatment4 -0.018650 0.0214 335 -0.870 0.9076
## treatment2 - treatment5 0.000054 0.0214 336 0.003 1.0000
## treatment3 - treatment4 -0.023838 0.0214 337 -1.113 0.7995
## treatment3 - treatment5 -0.005134 0.0214 337 -0.240 0.9993
## treatment4 - treatment5 0.018704 0.0214 337 0.874 0.9064
##
## count = 4:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.017484 0.0214 335 -0.816 0.9256
## treatment1 - treatment3 0.001753 0.0214 337 0.082 1.0000
## treatment1 - treatment4 -0.017286 0.0220 359 -0.787 0.9343
## treatment1 - treatment5 0.025185 0.0219 359 1.149 0.7803
## treatment2 - treatment3 0.019236 0.0214 337 0.899 0.8973
## treatment2 - treatment4 0.000198 0.0220 358 0.009 1.0000
## treatment2 - treatment5 0.042669 0.0219 357 1.945 0.2956
## treatment3 - treatment4 -0.019039 0.0220 359 -0.866 0.9090
## treatment3 - treatment5 0.023432 0.0219 358 1.069 0.8225
## treatment4 - treatment5 0.042471 0.0225 380 1.890 0.3247
##
## count = 5:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.051124 0.0214 335 -2.387 0.1215
## treatment1 - treatment3 -0.063389 0.0226 385 -2.808 0.0416
## treatment1 - treatment4 -0.043268 0.0220 359 -1.970 0.2830
## treatment1 - treatment5 -0.026809 0.0214 337 -1.253 0.7204
## treatment2 - treatment3 -0.012265 0.0226 385 -0.543 0.9827
## treatment2 - treatment4 0.007856 0.0220 358 0.357 0.9965
## treatment2 - treatment5 0.024315 0.0214 335 1.135 0.7878
## treatment3 - treatment4 0.020121 0.0231 406 0.870 0.9077
## treatment3 - treatment5 0.036580 0.0226 385 1.620 0.4853
## treatment4 - treatment5 0.016459 0.0220 359 0.749 0.9446
##
## count = 6:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.066609 0.0214 335 -3.109 0.0173
## treatment1 - treatment3 -0.041631 0.0214 337 -1.945 0.2958
## treatment1 - treatment4 -0.038491 0.0226 386 -1.702 0.4341
## treatment1 - treatment5 0.010441 0.0219 359 0.476 0.9895
## treatment2 - treatment3 0.024977 0.0214 337 1.167 0.7703
## treatment2 - treatment4 0.028118 0.0227 385 1.241 0.7271
## treatment2 - treatment5 0.077050 0.0219 357 3.512 0.0045
## treatment3 - treatment4 0.003140 0.0226 386 0.139 0.9999
## treatment3 - treatment5 0.052072 0.0219 358 2.375 0.1246
## treatment4 - treatment5 0.048932 0.0231 406 2.117 0.2148
##
## count = 7:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.030867 0.0214 335 -1.441 0.6016
## treatment1 - treatment3 -0.013038 0.0214 337 -0.609 0.9736
## treatment1 - treatment4 -0.000955 0.0214 338 -0.045 1.0000
## treatment1 - treatment5 0.038482 0.0214 337 1.798 0.3764
## treatment2 - treatment3 0.017829 0.0214 337 0.833 0.9203
## treatment2 - treatment4 0.029912 0.0215 336 1.393 0.6326
## treatment2 - treatment5 0.069349 0.0214 335 3.237 0.0115
## treatment3 - treatment4 0.012083 0.0215 338 0.563 0.9802
## treatment3 - treatment5 0.051520 0.0214 337 2.407 0.1160
## treatment4 - treatment5 0.039437 0.0214 338 1.839 0.3531
##
## count = 8:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.029331 0.0214 335 -1.369 0.6480
## treatment1 - treatment3 -0.014935 0.0214 337 -0.698 0.9569
## treatment1 - treatment4 -0.010417 0.0214 338 -0.486 0.9886
## treatment1 - treatment5 0.001524 0.0214 337 0.071 1.0000
## treatment2 - treatment3 0.014396 0.0214 337 0.672 0.9622
## treatment2 - treatment4 0.018914 0.0215 336 0.881 0.9039
## treatment2 - treatment5 0.030855 0.0214 335 1.440 0.6020
## treatment3 - treatment4 0.004518 0.0215 338 0.211 0.9996
## treatment3 - treatment5 0.016459 0.0214 337 0.769 0.9394
## treatment4 - treatment5 0.011941 0.0214 338 0.557 0.9811
##
## count = 9:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.026064 0.0214 335 -1.216 0.7418
## treatment1 - treatment3 -0.020477 0.0214 337 -0.956 0.8743
## treatment1 - treatment4 -0.029448 0.0214 338 -1.374 0.6447
## treatment1 - treatment5 -0.009272 0.0214 337 -0.433 0.9927
## treatment2 - treatment3 0.005588 0.0214 337 0.261 0.9990
## treatment2 - treatment4 -0.003383 0.0215 336 -0.158 0.9999
## treatment2 - treatment5 0.016793 0.0214 335 0.784 0.9352
## treatment3 - treatment4 -0.008971 0.0215 338 -0.418 0.9936
## treatment3 - treatment5 0.011205 0.0214 337 0.523 0.9849
## treatment4 - treatment5 0.020176 0.0214 338 0.941 0.8808
##
## count = 10:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.033795 0.0214 335 -1.577 0.5135
## treatment1 - treatment3 -0.016086 0.0214 337 -0.751 0.9441
## treatment1 - treatment4 -0.030259 0.0214 337 -1.413 0.6197
## treatment1 - treatment5 -0.000448 0.0214 337 -0.021 1.0000
## treatment2 - treatment3 0.017708 0.0214 337 0.827 0.9221
## treatment2 - treatment4 0.003535 0.0215 336 0.165 0.9998
## treatment2 - treatment5 0.033346 0.0215 336 1.553 0.5288
## treatment3 - treatment4 -0.014173 0.0215 338 -0.661 0.9646
## treatment3 - treatment5 0.015638 0.0215 338 0.729 0.9497
## treatment4 - treatment5 0.029811 0.0214 337 1.393 0.6327
##
## count = 11:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.024892 0.0215 336 -1.160 0.7739
## treatment1 - treatment3 -0.013459 0.0214 337 -0.628 0.9705
## treatment1 - treatment4 -0.030860 0.0214 337 -1.442 0.6011
## treatment1 - treatment5 0.005115 0.0220 359 0.233 0.9993
## treatment2 - treatment3 0.011433 0.0214 337 0.534 0.9838
## treatment2 - treatment4 -0.005968 0.0215 336 -0.278 0.9987
## treatment2 - treatment5 0.030008 0.0220 356 1.366 0.6496
## treatment3 - treatment4 -0.017401 0.0215 337 -0.811 0.9273
## treatment3 - treatment5 0.018575 0.0220 357 0.846 0.9160
## treatment4 - treatment5 0.035975 0.0220 360 1.636 0.4751
##
## count = 12:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.040783 0.0215 336 -1.901 0.3187
## treatment1 - treatment3 -0.029407 0.0214 337 -1.371 0.6464
## treatment1 - treatment4 -0.029773 0.0214 337 -1.391 0.6339
## treatment1 - treatment5 -0.025111 0.0226 386 -1.110 0.8011
## treatment2 - treatment3 0.011376 0.0214 337 0.531 0.9841
## treatment2 - treatment4 0.011009 0.0215 336 0.513 0.9861
## treatment2 - treatment5 0.015672 0.0226 383 0.693 0.9579
## treatment3 - treatment4 -0.000366 0.0215 337 -0.017 1.0000
## treatment3 - treatment5 0.004296 0.0226 384 0.190 0.9997
## treatment4 - treatment5 0.004663 0.0226 387 0.206 0.9996
##
## count = 13:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.032934 0.0214 335 -1.536 0.5395
## treatment1 - treatment3 -0.028591 0.0214 336 -1.335 0.6696
## treatment1 - treatment4 -0.021520 0.0214 337 -1.005 0.8528
## treatment1 - treatment5 -0.021871 0.0220 359 -0.996 0.8572
## treatment2 - treatment3 0.004343 0.0214 337 0.203 0.9996
## treatment2 - treatment4 0.011413 0.0215 336 0.532 0.9840
## treatment2 - treatment5 0.011063 0.0220 356 0.504 0.9870
## treatment3 - treatment4 0.007070 0.0214 336 0.330 0.9974
## treatment3 - treatment5 0.006719 0.0220 358 0.306 0.9981
## treatment4 - treatment5 -0.000351 0.0220 360 -0.016 1.0000
##
## count = 14:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.027092 0.0214 335 -1.264 0.7132
## treatment1 - treatment3 -0.024473 0.0214 336 -1.143 0.7837
## treatment1 - treatment4 -0.019286 0.0219 359 -0.880 0.9043
## treatment1 - treatment5 -0.014628 0.0220 359 -0.666 0.9635
## treatment2 - treatment3 0.002619 0.0214 337 0.122 0.9999
## treatment2 - treatment4 0.007806 0.0220 357 0.356 0.9966
## treatment2 - treatment5 0.012464 0.0220 357 0.567 0.9797
## treatment3 - treatment4 0.005186 0.0219 358 0.236 0.9993
## treatment3 - treatment5 0.009845 0.0220 358 0.448 0.9916
## treatment4 - treatment5 0.004659 0.0225 381 0.207 0.9996
##
## count = 15:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.016800 0.0214 335 -0.784 0.9351
## treatment1 - treatment3 -0.016255 0.0214 336 -0.759 0.9420
## treatment1 - treatment4 -0.005586 0.0214 337 -0.261 0.9990
## treatment1 - treatment5 0.000972 0.0220 359 0.044 1.0000
## treatment2 - treatment3 0.000545 0.0214 337 0.025 1.0000
## treatment2 - treatment4 0.011214 0.0214 335 0.523 0.9850
## treatment2 - treatment5 0.017772 0.0220 357 0.809 0.9279
## treatment3 - treatment4 0.010669 0.0214 336 0.498 0.9875
## treatment3 - treatment5 0.017227 0.0220 358 0.784 0.9350
## treatment4 - treatment5 0.006558 0.0220 360 0.298 0.9983
##
## count = 16:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 0.006709 0.0219 357 0.306 0.9981
## treatment1 - treatment3 -0.012195 0.0214 336 -0.569 0.9794
## treatment1 - treatment4 0.023793 0.0214 337 1.112 0.8004
## treatment1 - treatment5 0.015252 0.0226 386 0.675 0.9618
## treatment2 - treatment3 -0.018904 0.0219 359 -0.862 0.9105
## treatment2 - treatment4 0.017084 0.0220 357 0.778 0.9368
## treatment2 - treatment5 0.008543 0.0231 404 0.370 0.9960
## treatment3 - treatment4 0.035988 0.0214 336 1.680 0.4480
## treatment3 - treatment5 0.027447 0.0226 384 1.214 0.7431
## treatment4 - treatment5 -0.008541 0.0226 386 -0.378 0.9957
##
## count = 17:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 0.009073 0.0219 357 0.414 0.9938
## treatment1 - treatment3 -0.010460 0.0219 358 -0.477 0.9894
## treatment1 - treatment4 0.023486 0.0219 359 1.071 0.8212
## treatment1 - treatment5 0.002440 0.0225 380 0.109 1.0000
## treatment2 - treatment3 -0.019533 0.0214 337 -0.912 0.8921
## treatment2 - treatment4 0.014413 0.0214 335 0.673 0.9621
## treatment2 - treatment5 -0.006633 0.0220 357 -0.302 0.9982
## treatment3 - treatment4 0.033947 0.0214 336 1.584 0.5085
## treatment3 - treatment5 0.012900 0.0220 357 0.588 0.9769
## treatment4 - treatment5 -0.021047 0.0220 359 -0.958 0.8735
##
## count = 18:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 0.012553 0.0214 335 0.586 0.9771
## treatment1 - treatment3 -0.018481 0.0215 337 -0.861 0.9109
## treatment1 - treatment4 -0.001342 0.0214 337 -0.063 1.0000
## treatment1 - treatment5 0.000990 0.0220 360 0.045 1.0000
## treatment2 - treatment3 -0.031034 0.0214 337 -1.448 0.5969
## treatment2 - treatment4 -0.013895 0.0214 335 -0.649 0.9668
## treatment2 - treatment5 -0.011562 0.0220 357 -0.526 0.9847
## treatment3 - treatment4 0.017139 0.0214 336 0.800 0.9305
## treatment3 - treatment5 0.019471 0.0220 357 0.887 0.9017
## treatment4 - treatment5 0.002332 0.0220 359 0.106 1.0000
##
## count = 19:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 0.018916 0.0220 359 0.859 0.9116
## treatment1 - treatment3 -0.015121 0.0215 338 -0.704 0.9556
## treatment1 - treatment4 0.013216 0.0214 337 0.617 0.9723
## treatment1 - treatment5 0.011195 0.0220 361 0.508 0.9865
## treatment2 - treatment3 -0.034037 0.0219 359 -1.552 0.5292
## treatment2 - treatment4 -0.005700 0.0220 358 -0.259 0.9990
## treatment2 - treatment5 -0.007721 0.0225 377 -0.344 0.9970
## treatment3 - treatment4 0.028337 0.0214 337 1.322 0.6780
## treatment3 - treatment5 0.026316 0.0220 357 1.199 0.7522
## treatment4 - treatment5 -0.002021 0.0220 360 -0.092 1.0000
##
## count = 20:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 0.017866 0.0221 360 0.810 0.9275
## treatment1 - treatment3 -0.025655 0.0220 359 -1.166 0.7708
## treatment1 - treatment4 -0.020472 0.0219 359 -0.933 0.8840
## treatment1 - treatment5 -0.026802 0.0227 388 -1.180 0.7629
## treatment2 - treatment3 -0.043520 0.0224 380 -1.939 0.2984
## treatment2 - treatment4 -0.038338 0.0225 379 -1.705 0.4321
## treatment2 - treatment5 -0.044667 0.0231 403 -1.933 0.3016
## treatment3 - treatment4 0.005183 0.0225 379 0.231 0.9994
## treatment3 - treatment5 -0.001147 0.0231 404 -0.050 1.0000
## treatment4 - treatment5 -0.006329 0.0231 407 -0.274 0.9988
##
## count = 21:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.010544 0.0256 500 -0.412 0.9940
## treatment1 - treatment3 -0.041570 0.0263 525 -1.578 0.5122
## treatment1 - treatment4 -0.027332 0.0288 601 -0.948 0.8777
## treatment1 - treatment5 0.000484 0.0256 502 0.019 1.0000
## treatment2 - treatment3 -0.031025 0.0245 462 -1.267 0.7119
## treatment2 - treatment4 -0.016788 0.0273 554 -0.616 0.9726
## treatment2 - treatment5 0.011029 0.0237 428 0.465 0.9904
## treatment3 - treatment4 0.014238 0.0279 574 0.510 0.9864
## treatment3 - treatment5 0.042054 0.0245 460 1.715 0.4258
## treatment4 - treatment5 0.027816 0.0273 556 1.020 0.8463
##
## count = 22:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.034986 0.0311 650 -1.125 0.7931
## treatment1 - treatment3 -0.025715 0.0273 558 -0.940 0.8810
## treatment1 - treatment4 -0.032412 0.0352 715 -0.922 0.8885
## treatment1 - treatment5 -0.000177 0.0274 559 -0.006 1.0000
## treatment2 - treatment3 0.009272 0.0310 652 0.299 0.9983
## treatment2 - treatment4 0.002574 0.0382 743 0.067 1.0000
## treatment2 - treatment5 0.034810 0.0311 649 1.120 0.7958
## treatment3 - treatment4 -0.006698 0.0352 716 -0.190 0.9997
## treatment3 - treatment5 0.025538 0.0274 557 0.934 0.8837
## treatment4 - treatment5 0.032236 0.0352 717 0.915 0.8910
##
## count = 23:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.062475 0.0452 773 -1.382 0.6395
## treatment1 - treatment3 -0.023251 0.0289 599 -0.806 0.9289
## treatment1 - treatment4 -0.037539 0.0352 714 -1.068 0.8230
## treatment1 - treatment5 -0.001722 0.0311 651 -0.055 1.0000
## treatment2 - treatment3 0.039224 0.0462 774 0.849 0.9150
## treatment2 - treatment4 0.024936 0.0503 780 0.496 0.9878
## treatment2 - treatment5 0.060753 0.0476 776 1.276 0.7059
## treatment3 - treatment4 -0.014288 0.0363 729 -0.393 0.9950
## treatment3 - treatment5 0.021529 0.0323 674 0.666 0.9636
## treatment4 - treatment5 0.035817 0.0381 743 0.939 0.8816
##
## count = 24:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.038225 0.0503 780 -0.759 0.9421
## treatment1 - treatment3 -0.041533 0.0381 741 -1.091 0.8110
## treatment1 - treatment4 -0.004232 0.0503 781 -0.084 1.0000
## treatment1 - treatment5 nonEst NA NA NA NA
## treatment2 - treatment3 -0.003308 0.0476 777 -0.069 1.0000
## treatment2 - treatment4 0.033993 0.0578 782 0.588 0.9768
## treatment2 - treatment5 nonEst NA NA NA NA
## treatment3 - treatment4 0.037301 0.0476 778 0.784 0.9353
## treatment3 - treatment5 nonEst NA NA NA NA
## treatment4 - treatment5 nonEst NA NA NA NA
##
## count = 25:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 nonEst NA NA NA NA
## treatment1 - treatment3 nonEst NA NA NA NA
## treatment1 - treatment4 -0.015528 0.0503 781 -0.309 0.9980
## treatment1 - treatment5 nonEst NA NA NA NA
## treatment2 - treatment3 nonEst NA NA NA NA
## treatment2 - treatment4 nonEst NA NA NA NA
## treatment2 - treatment5 nonEst NA NA NA NA
## treatment3 - treatment4 nonEst NA NA NA NA
## treatment3 - treatment5 0.027216 0.0577 782 0.471 0.9899
## treatment4 - treatment5 nonEst NA NA NA NA
##
## count = 26:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 nonEst NA NA NA NA
## treatment1 - treatment3 nonEst NA NA NA NA
## treatment1 - treatment4 -0.010258 0.0503 781 -0.204 0.9996
## treatment1 - treatment5 nonEst NA NA NA NA
## treatment2 - treatment3 nonEst NA NA NA NA
## treatment2 - treatment4 nonEst NA NA NA NA
## treatment2 - treatment5 nonEst NA NA NA NA
## treatment3 - treatment4 nonEst NA NA NA NA
## treatment3 - treatment5 0.013930 0.0577 782 0.241 0.9993
## treatment4 - treatment5 nonEst NA NA NA NA
##
## count = 27:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 nonEst NA NA NA NA
## treatment1 - treatment3 nonEst NA NA NA NA
## treatment1 - treatment4 -0.029445 0.0503 781 -0.585 0.9773
## treatment1 - treatment5 nonEst NA NA NA NA
## treatment2 - treatment3 nonEst NA NA NA NA
## treatment2 - treatment4 nonEst NA NA NA NA
## treatment2 - treatment5 nonEst NA NA NA NA
## treatment3 - treatment4 nonEst NA NA NA NA
## treatment3 - treatment5 -0.006544 0.0577 782 -0.113 1.0000
## treatment4 - treatment5 nonEst NA NA NA NA
##
## count = 28:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 nonEst NA NA NA NA
## treatment1 - treatment3 nonEst NA NA NA NA
## treatment1 - treatment4 nonEst NA NA NA NA
## treatment1 - treatment5 nonEst NA NA NA NA
## treatment2 - treatment3 nonEst NA NA NA NA
## treatment2 - treatment4 nonEst NA NA NA NA
## treatment2 - treatment5 nonEst NA NA NA NA
## treatment3 - treatment4 nonEst NA NA NA NA
## treatment3 - treatment5 -0.068031 0.0577 782 -1.178 0.7639
## treatment4 - treatment5 nonEst NA NA NA NA
##
## count = 29:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 nonEst NA NA NA NA
## treatment1 - treatment3 nonEst NA NA NA NA
## treatment1 - treatment4 nonEst NA NA NA NA
## treatment1 - treatment5 nonEst NA NA NA NA
## treatment2 - treatment3 nonEst NA NA NA NA
## treatment2 - treatment4 nonEst NA NA NA NA
## treatment2 - treatment5 nonEst NA NA NA NA
## treatment3 - treatment4 nonEst NA NA NA NA
## treatment3 - treatment5 nonEst NA NA NA NA
## treatment4 - treatment5 nonEst NA NA NA NA
##
## Results are averaged over the levels of: qro
## Degrees-of-freedom method: kenward-roger
## P value adjustment: tukey method for comparing a family of 5 estimates
pollen.23 <- pollen
pollen.23$count <- as.numeric(pollen.23$count)
pollen.23$count[pollen.23$count > 23] <- NA
pollen.23 <- na.omit(pollen.23)
pbox23 <- lmer(boxp ~ treatment*count + bees_alive + qro + (1|colony), data = pollen.23)
summary(pbox23)
## Linear mixed model fit by REML ['lmerMod']
## Formula: boxp ~ treatment * count + bees_alive + qro + (1 | colony)
## Data: pollen.23
##
## REML criterion at convergence: -2700.6
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.6386 -0.5948 0.0053 0.6661 3.0182
##
## Random effects:
## Groups Name Variance Std.Dev.
## colony (Intercept) 0.0008879 0.02980
## Residual 0.0022881 0.04783
## Number of obs: 899, groups: colony, 45
##
## Fixed effects:
## Estimate Std. Error t value
## (Intercept) 0.0481502 0.0236665 2.035
## treatment2 0.0252273 0.0174011 1.450
## treatment3 0.0113131 0.0173691 0.651
## treatment4 0.0230963 0.0175609 1.315
## treatment5 -0.0064841 0.0174243 -0.372
## count 0.0049266 0.0005937 8.298
## bees_alive 0.0177971 0.0037613 4.732
## qroB3 0.0118085 0.0157069 0.752
## qroB4 0.0432846 0.0157050 2.756
## qroB5 0.0061097 0.0118627 0.515
## treatment2:count -0.0009100 0.0008383 -1.086
## treatment3:count 0.0005135 0.0008169 0.629
## treatment4:count -0.0004722 0.0008547 -0.552
## treatment5:count 0.0004174 0.0008456 0.494
Anova(pbox23)
## Analysis of Deviance Table (Type II Wald chisquare tests)
##
## Response: boxp
## Chisq Df Pr(>Chisq)
## treatment 3.5245 4 0.47417
## count 298.8416 1 < 2.2e-16 ***
## bees_alive 22.3884 1 2.227e-06 ***
## qro 7.7190 3 0.05219 .
## treatment:count 3.9870 4 0.40777
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(pbox23, test = "Chisq")
## Single term deletions
##
## Model:
## boxp ~ treatment * count + bees_alive + qro + (1 | colony)
## npar AIC LRT Pr(Chi)
## <none> -2800.3
## bees_alive 1 -2779.1 23.1751 1.479e-06 ***
## qro 3 -2797.7 8.5911 0.03525 *
## treatment:count 4 -2804.3 3.9753 0.40936
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
qqnorm(resid(pbox23));qqline(resid(pbox23))

boxemm23 <- emmeans(pbox23, pairwise ~ treatment | count)
pairs(boxemm23)
## count = 10.8:
## contrast estimate SE df t.ratio p.value
## treatment1 - treatment2 -0.01539 0.0149 36.6 -1.031 0.8394
## treatment1 - treatment3 -0.01687 0.0149 36.5 -1.131 0.7893
## treatment1 - treatment4 -0.01799 0.0149 36.7 -1.204 0.7489
## treatment1 - treatment5 0.00197 0.0150 37.1 0.132 0.9999
## treatment2 - treatment3 -0.00148 0.0149 36.5 -0.099 1.0000
## treatment2 - treatment4 -0.00260 0.0150 37.2 -0.174 0.9998
## treatment2 - treatment5 0.01736 0.0150 37.1 1.159 0.7742
## treatment3 - treatment4 -0.00112 0.0150 37.1 -0.075 1.0000
## treatment3 - treatment5 0.01884 0.0150 36.9 1.259 0.7173
## treatment4 - treatment5 0.01996 0.0150 37.7 1.326 0.6769
##
## Results are averaged over the levels of: qro
## Degrees-of-freedom method: kenward-roger
## P value adjustment: tukey method for comparing a family of 5 estimates
plot(pollen.23$treatment, pollen.23$difference)

pbox23
## Linear mixed model fit by REML ['lmerMod']
## Formula: boxp ~ treatment * count + bees_alive + qro + (1 | colony)
## Data: pollen.23
## REML criterion at convergence: -2700.594
## Random effects:
## Groups Name Std.Dev.
## colony (Intercept) 0.02980
## Residual 0.04783
## Number of obs: 899, groups: colony, 45
## Fixed Effects:
## (Intercept) treatment2 treatment3 treatment4
## 0.0481502 0.0252273 0.0113131 0.0230963
## treatment5 count bees_alive qroB3
## -0.0064841 0.0049266 0.0177971 0.0118085
## qroB4 qroB5 treatment2:count treatment3:count
## 0.0432846 0.0061097 -0.0009100 0.0005135
## treatment4:count treatment5:count
## -0.0004722 0.0004174
Anova(pbox23)
## Analysis of Deviance Table (Type II Wald chisquare tests)
##
## Response: boxp
## Chisq Df Pr(>Chisq)
## treatment 3.5245 4 0.47417
## count 298.8416 1 < 2.2e-16 ***
## bees_alive 22.3884 1 2.227e-06 ***
## qro 7.7190 3 0.05219 .
## treatment:count 3.9870 4 0.40777
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
AP <- as.data.frame(Anova(pbox23))
AP <- setDT(AP)
AP
## Chisq Df Pr(>Chisq)
## 1: 3.524457 4 4.741694e-01
## 2: 298.841575 1 5.890535e-67
## 3: 22.388414 1 2.227135e-06
## 4: 7.719021 3 5.219004e-02
## 5: 3.986981 4 4.077706e-01
boxemm23 <- emmeans(pbox23, pairwise ~ treatment | count)
contrasts <- as.data.frame(boxemm23$contrasts)
contrasts <- setDT(contrasts)
contrasts
## contrast count estimate SE df
## 1: treatment1 - treatment2 10.81424 -0.015386314 0.01492451 36.58570
## 2: treatment1 - treatment3 10.81424 -0.016866250 0.01491680 36.49837
## 3: treatment1 - treatment4 10.81424 -0.017990014 0.01493835 36.72634
## 4: treatment1 - treatment5 10.81424 0.001970676 0.01498076 37.07984
## 5: treatment2 - treatment3 10.81424 -0.001479936 0.01491770 36.52727
## 6: treatment2 - treatment4 10.81424 -0.002603700 0.01498600 37.16638
## 7: treatment2 - treatment5 10.81424 0.017356991 0.01497868 37.07001
## 8: treatment3 - treatment4 10.81424 -0.001123764 0.01498373 37.12251
## 9: treatment3 - treatment5 10.81424 0.018836927 0.01496315 36.91658
## 10: treatment4 - treatment5 10.81424 0.019960690 0.01504995 37.73923
## t.ratio p.value
## 1: -1.03094267 0.8393966
## 2: -1.13068849 0.7893457
## 3: -1.20428366 0.7488980
## 4: 0.13154716 0.9999291
## 5: -0.09920673 0.9999770
## 6: -0.17374219 0.9997858
## 7: 1.15878010 0.7742313
## 8: -0.07499891 0.9999925
## 9: 1.25888811 0.7173207
## 10: 1.32629648 0.6768786
means <- as.data.table(boxemm23$emmeans)
means <- setDT(means)
means
## treatment count emmean SE df lower.CL upper.CL
## 1: 1 10.81424 0.2018139 0.01109395 36.64247 0.1793281 0.2242998
## 2: 2 10.81424 0.2172003 0.01110005 36.75772 0.1947044 0.2396961
## 3: 3 10.81424 0.2186802 0.01108772 36.59944 0.1962060 0.2411543
## 4: 4 10.81424 0.2198040 0.01117219 37.62447 0.1971796 0.2424283
## 5: 5 10.81424 0.1998433 0.01120031 37.94587 0.1771684 0.2225182
range(pollen$dose_consumed)
## [1] -6634.948 150000.000
pollen.dose <- pollen
pollen.dose$dose_consumed[pollen.dose$dose_consumed < 0] <- NA
pollen.dose <- na.omit(pollen.dose)
range(pollen.dose$dose_consumed)
## [1] 0 150000
ggplot(pollen.dose, aes(x=dose_consumed, fill = treatment)) +
geom_histogram(position = "identity", binwidth =5000, col=I("black")) +
scale_fill_manual(values = c("peachpuff3", "darkseagreen", "lightseagreen", "darkolivegreen3", "darkolivegreen4"),
name = "Pristine Level",
labels = c("Treatment 1 (control)", "Treatment 2",
"Treatment 3", "Treatment 4", "Treatment 5"))

dose.sum <- pollen.dose %>%
group_by(treatment) %>%
summarise(m = mean(dose_consumed),
sd = sd(dose_consumed),
n = length(dose_consumed)) %>%
mutate(se = sd/sqrt(n))
dose.sum
## # A tibble: 5 × 5
## treatment m sd n se
## <fct> <dbl> <dbl> <int> <dbl>
## 1 1 0 0 195 0
## 2 2 46.3 39.3 176 2.96
## 3 3 513. 439. 187 32.1
## 4 4 5468. 4707. 178 353.
## 5 5 47366. 41410. 170 3176.
LS0tDQp0aXRsZTogIkVmZmVjdCBvZiBQcmlzdGluZSBvbiBCdW1ibGUgQmVlIE1pY3JvY29sb25pZXMgLSBQb2xsZW4gQ29uc3VtcHRpb24iDQphdXRob3I6ICJFbWlseSBSdW5uaW9uIg0KZGF0ZTogIkRhdGEgQ29sbGVjdGVkIDIwMjIiDQpvdXRwdXQ6DQogIGh0bWxfZG9jdW1lbnQ6DQogICAgdG9jOiB0cnVlDQogICAgdG9jX2RlcHRoOiA0DQogICAgbnVtYmVyX3NlY3Rpb25zOiBmYWxzZQ0KICAgIHRvY19mbG9hdDogdHJ1ZQ0KICAgIHRoZW1lOiBqb3VybmFsDQogICAgY29kZV9kb3dubG9hZDogdHJ1ZQ0KLS0tDQoNCmBgYHtyIHNldHVwLCBpbmNsdWRlPUZBTFNFfQ0Ka25pdHI6Om9wdHNfY2h1bmskc2V0KG1lc3NhZ2UgPSBGQUxTRSkNCmBgYA0KDQpgYGB7ciBsb2FkIGxpYnJhcmllcywgaW5jbHVkZT1GQUxTRX0NCmxpYnJhcnkocmVhZHIpDQpsaWJyYXJ5KGthYmxlRXh0cmEpDQpsaWJyYXJ5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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIyIiwgIjMiLCAiNCIsICI1IikpLCByZXBsaWNhdGUgPSBjb2xfZmFjdG9yKGxldmVscyA9IGMoIjEiLCANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiMiIsICIzIiwgIjQiLCAiNSIsICI2IiwgIjciLCAiOSIsICIxMSIsIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIxMiIpKSwgc3RhcnRfZGF0ZSA9IGNvbF9kYXRlKGZvcm1hdCA9ICIlbS8lZC8lWSIpLCANCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0X3RpbWUgPSBjb2xfY2hhcmFjdGVyKCksIGVuZF9kYXRlID0gY29sX2RhdGUoZm9ybWF0ID0gIiVtLyVkLyVZIiksIA0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5kX3RpbWUgPSBjb2xfY2hhcmFjdGVyKCkpKQ0KDQoNCnBvbGxlbiRjb2xvbnkgPC0gYXMuZmFjdG9yKHBvbGxlbiRjb2xvbnkpDQpwb2xsZW4kcGlkIDwtIGFzLmZhY3Rvcihwb2xsZW4kcGlkKQ0KcG9sbGVuJGNvdW50IDwtIGFzLmZhY3Rvcihwb2xsZW4kY291bnQpDQ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