library(ggplot2) # for general plotting
library(car)     # for ANOVA (Type II used, better than Type I when there is an unbalanced design)

Information of data source

Fecundity of TU and TU-A mites on Moneymaker tomato leaflets, 2 and 4 dpi following treatment with water (control) or E-64 (cystein protease inhibitor).

Read in the data and view structure to identify any issues in data formatting

E64.fecundity.data <- read.csv("~/Lab Stuff/Adapted mites/Tomato/E-64 assay/Fecundity R data.csv", header = TRUE) 

# Trial and Day as factors
E64.fecundity.data$Trial <- factor(E64.fecundity.data$Trial)
E64.fecundity.data$dpi <- factor(E64.fecundity.data$dpi)

str(E64.fecundity.data)
## 'data.frame':    136 obs. of  5 variables:
##  $ Trial      : Factor w/ 3 levels "1","2","3": 1 1 1 1 1 1 1 1 1 1 ...
##  $ Mite.Strain: Factor w/ 2 levels "TU","TU-A": 1 1 1 1 1 1 2 2 2 2 ...
##  $ Treatment  : Factor w/ 2 levels "E-64","Water": 2 2 2 2 2 2 2 2 2 2 ...
##  $ Eggs.Mite  : num  5.68 6.21 4.11 6.89 4.37 ...
##  $ dpi        : Factor w/ 2 levels "2","4": 1 1 1 1 1 1 1 1 1 1 ...
# subset mite strains for separate analyses
E64.fecundity.data.TU <- subset(E64.fecundity.data,  Mite.Strain =="TU") 
E64.fecundity.data.TA <- subset(E64.fecundity.data, Mite.Strain =="TU-A")

Formulate hypothesis

H0: There will be no difference in fecundity between water and E-64 treated mites (TU or TU-A).

HA: E-64 treatment will decrease fecundity of TU-A mites.

Conduct data exploration

Outliers in the response variable (Eggs.Mite) within explanatory variables (Trial, dpi, Treatment).

# TU
ggplot(E64.fecundity.data.TU, aes(x = Trial, y = Eggs.Mite)) + geom_boxplot() + theme_classic()

ggplot(E64.fecundity.data.TU, aes(x = dpi, y = Eggs.Mite)) + geom_boxplot() + theme_classic()

ggplot(E64.fecundity.data.TU, aes(x = Treatment, y = Eggs.Mite)) + geom_boxplot() + theme_classic()

# TU-A
ggplot(E64.fecundity.data.TA, aes(x = Trial, y = Eggs.Mite)) + geom_boxplot() + theme_classic()

ggplot(E64.fecundity.data.TA, aes(x = dpi, y = Eggs.Mite)) + geom_boxplot() + theme_classic()

ggplot(E64.fecundity.data.TA, aes(x = Treatment, y = Eggs.Mite)) + geom_boxplot() + theme_classic()

Outlier not removed, probably represents real variability.

Spatial/temporal or other hierarchical aspects of sampling design

No, I am treating Trial as a main effect to check for reproducibility (not a random effect/blocking factor).

Interactions (is the quality of the data good enough to include them?)

Interaction between Trial and Treatment will be performed to test for reproducibility.

Interaction between Trial and dpi will be performed to test for reproducibility.

An interaction between dpi and Treatment will also be included to test for possible feedback loop and for planned comparisons.

Zero inflation in Y

No

Are categorical covariates balanced?

summary(E64.fecundity.data.TU)
##  Trial  Mite.Strain Treatment    Eggs.Mite      dpi   
##  1:23   TU  :67     E-64 :31   Min.   : 1.389   2:34  
##  2:21   TU-A: 0     Water:36   1st Qu.: 5.313   4:33  
##  3:23                          Median : 7.316         
##                                Mean   : 7.080         
##                                3rd Qu.: 9.053         
##                                Max.   :12.629
summary(E64.fecundity.data.TA)
##  Trial  Mite.Strain Treatment    Eggs.Mite      dpi   
##  1:23   TU  : 0     E-64 :33   Min.   : 8.769   2:35  
##  2:23   TU-A:69     Water:36   1st Qu.:12.650   4:34  
##  3:23                          Median :18.600         
##                                Mean   :21.005         
##                                3rd Qu.:30.389         
##                                Max.   :37.333

No, but close.

Apply model

TU

# fit linear model and display model fit information and ANOVA table
# full model including 3 way interaction term - to verify it is not significant, if it is, interpretation of hypothesis testing will be problematic
m.TU.0 <- lm(Eggs.Mite ~ dpi +Treatment + Trial + dpi:Treatment + Treatment:Trial + dpi:Trial + dpi:Trial:Treatment, data = E64.fecundity.data.TU)
summary(m.TU.0)
## 
## Call:
## lm(formula = Eggs.Mite ~ dpi + Treatment + Trial + dpi:Treatment + 
##     Treatment:Trial + dpi:Trial + dpi:Trial:Treatment, data = E64.fecundity.data.TU)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.7937 -1.1606  0.1336  1.0253  6.9349 
## 
## Coefficients:
##                            Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                  4.5590     1.0225   4.459 4.11e-05 ***
## dpi4                         1.1346     1.3845   0.820 0.416015    
## TreatmentWater               0.9727     1.3845   0.703 0.485294    
## Trial2                       5.4045     1.4460   3.738 0.000444 ***
## Trial3                       4.0310     1.3845   2.912 0.005185 ** 
## dpi4:TreatmentWater         -1.5162     1.9129  -0.793 0.431412    
## TreatmentWater:Trial2       -1.6198     1.9579  -0.827 0.411643    
## TreatmentWater:Trial3       -2.5160     1.9129  -1.315 0.193878    
## dpi4:Trial2                 -3.4452     2.0662  -1.667 0.101112    
## dpi4:Trial3                 -3.2755     1.9579  -1.673 0.100012    
## dpi4:TreatmentWater:Trial2   3.6086     2.7846   1.296 0.200411    
## dpi4:TreatmentWater:Trial3   2.6604     2.7052   0.983 0.329710    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.286 on 55 degrees of freedom
## Multiple R-squared:  0.4095, Adjusted R-squared:  0.2915 
## F-statistic: 3.468 on 11 and 55 DF,  p-value: 0.001023
Anova(m.TU.0)
## Anova Table (Type II tests)
## 
## Response: Eggs.Mite
##                      Sum Sq Df F value    Pr(>F)    
## dpi                   9.623  1  1.8409    0.1804    
## Treatment             0.540  1  0.1033    0.7491    
## Trial               157.103  2 15.0269 6.214e-06 ***
## dpi:Treatment         1.108  1  0.2119    0.6471    
## Treatment:Trial       5.840  2  0.5586    0.5752    
## dpi:Trial            11.164  2  1.0678    0.3508    
## dpi:Treatment:Trial   9.636  2  0.9217    0.4039    
## Residuals           287.506 55                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# linear model without non-significant 3-way interaction (want to reduce comparisons made in Tukey-Kramer post-hoc test)
m.TU <- lm(Eggs.Mite ~ dpi +Treatment + Trial + dpi:Treatment + Treatment:Trial + dpi:Trial, data = E64.fecundity.data.TU)
summary(m.TU)
## 
## Call:
## lm(formula = Eggs.Mite ~ dpi + Treatment + Trial + dpi:Treatment + 
##     Treatment:Trial + dpi:Trial, data = E64.fecundity.data.TU)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.2455 -1.1424 -0.1015  0.9780  7.4192 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)            5.14014    0.92069   5.583 6.86e-07 ***
## dpi4                   0.06928    1.12081   0.062 0.950930    
## TreatmentWater        -0.09268    1.12081  -0.083 0.934388    
## Trial2                 4.42134    1.23381   3.583 0.000703 ***
## Trial3                 3.30069    1.18724   2.780 0.007349 ** 
## dpi4:TreatmentWater    0.51765    1.12298   0.461 0.646581    
## TreatmentWater:Trial2  0.18271    1.38955   0.131 0.895852    
## TreatmentWater:Trial3 -1.15227    1.35029  -0.853 0.397035    
## dpi4:Trial2           -1.47518    1.38264  -1.067 0.290501    
## dpi4:Trial3           -1.88200    1.34923  -1.395 0.168467    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.283 on 57 degrees of freedom
## Multiple R-squared:  0.3898, Adjusted R-squared:  0.2934 
## F-statistic: 4.045 on 9 and 57 DF,  p-value: 0.0004774
Anova(m.TU)
## Anova Table (Type II tests)
## 
## Response: Eggs.Mite
##                  Sum Sq Df F value    Pr(>F)    
## dpi               9.623  1  1.8460    0.1796    
## Treatment         0.540  1  0.1036    0.7487    
## Trial           157.103  2 15.0684 5.581e-06 ***
## dpi:Treatment     1.108  1  0.2125    0.6466    
## Treatment:Trial   5.840  2  0.5602    0.5742    
## dpi:Trial        11.164  2  1.0708    0.3495    
## Residuals       297.142 57                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Calculate effect size and display
result.anova<-Anova(m.TU)
ss<-result.anova$"Sum Sq"  ##ss = sum of squares
pes<-ss/(ss+ss[length(ss)])  ##pes = partial e squared
pes[length(pes)]<-""
result.anova$"Part E Sq"<-pes
result.anova
## Anova Table (Type II tests)
## 
## Response: Eggs.Mite
##                  Sum Sq Df F value  Pr(>F) Part E Sq
## dpi               9.623  1  1.8460 0.17960   0.03137
## Treatment         0.540  1  0.1036 0.74875   0.00181
## Trial           157.103  2 15.0684 0.00001   0.34586
## dpi:Treatment     1.108  1  0.2125 0.64658   0.00371
## Treatment:Trial   5.840  2  0.5602 0.57422   0.01928
## dpi:Trial        11.164  2  1.0708 0.34953   0.03621
## Residuals       297.142 57
# perform post-hoc Tukey-Kramer test of contrasts
TukeyHSD(aov(Eggs.Mite ~ dpi +Treatment + Trial + dpi:Treatment + Treatment:Trial + dpi:Trial, data = E64.fecundity.data.TU))
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = Eggs.Mite ~ dpi + Treatment + Trial + dpi:Treatment + Treatment:Trial + dpi:Trial, data = E64.fecundity.data.TU)
## 
## $dpi
##           diff       lwr       upr     p adj
## 4-2 -0.8847478 -2.001998 0.2325021 0.1183292
## 
## $Treatment
##                   diff       lwr      upr     p adj
## Water-E-64 -0.08810766 -1.208357 1.032142 0.8754121
## 
## $Trial
##          diff        lwr        upr     p adj
## 2-1  3.792529  2.1342096  5.4508485 0.0000027
## 3-1  1.758005  0.1378128  3.3781969 0.0304819
## 3-2 -2.034524 -3.6928437 -0.3762048 0.0125198
## 
## $`dpi:Treatment`
##                       diff       lwr      upr     p adj
## 4:E-64-2:E-64   -1.1583926 -3.330029 1.013244 0.4974082
## 2:Water-2:E-64  -0.3395281 -2.415661 1.736605 0.9725838
## 4:Water-2:E-64  -0.9862525 -3.062385 1.089880 0.5935746
## 2:Water-4:E-64   0.8188645 -1.293588 2.931317 0.7350599
## 4:Water-4:E-64   0.1721400 -1.940313 2.284593 0.9964167
## 4:Water-2:Water -0.6467245 -2.660869 1.367420 0.8303783
## 
## $`Treatment:Trial`
##                       diff        lwr        upr     p adj
## Water:1-E-64:1   0.1054814 -2.7049588 2.91592169 0.9999975
## E-64:2-E-64:1    3.6542640  0.6280837 6.68044436 0.0093618
## Water:2-E-64:1   3.9847608  1.1743205 6.79520101 0.0013575
## E-64:3-E-64:1    2.3454130 -0.5254737 5.21629978 0.1704526
## Water:3-E-64:1   1.3249109 -1.4855293 4.13535117 0.7326535
## E-64:2-Water:1   3.5487826  0.5798853 6.51767987 0.0104061
## Water:2-Water:1  3.8792793  1.1306145 6.62794410 0.0014453
## E-64:3-Water:1   2.2399316 -0.5705086 5.05037184 0.1915742
## Water:3-Water:1  1.2194295 -1.5292353 3.96809426 0.7793073
## Water:2-E-64:2   0.3304967 -2.6384006 3.29939402 0.9994665
## E-64:3-E-64:2   -1.3088510 -4.3350313 1.71732934 0.7969884
## Water:3-E-64:2  -2.3293531 -5.2982504 0.63954418 0.2056395
## E-64:3-Water:2  -1.6393477 -4.4497880 1.17109252 0.5245956
## Water:3-Water:2 -2.6598498 -5.4085146 0.08881494 0.0632741
## Water:3-E-64:3  -1.0205021 -3.8309424 1.78993812 0.8908890
## 
## $`dpi:Trial`
##               diff         lwr        upr     p adj
## 4:1-2:1  0.3412575 -2.46918273  3.1516978 0.9991862
## 2:2-2:1  4.5547277  1.68384093  7.4256144 0.0002542
## 4:2-2:1  3.4126382  0.47085468  6.3544217 0.0140519
## 2:3-2:1  2.7150812 -0.09535908  5.5255214 0.0640119
## 4:3-2:1  1.1666341 -1.70425263  4.0375208 0.8358415
## 2:2-4:1  4.2134702  1.40302991  7.0239104 0.0006123
## 4:2-4:1  3.0713807  0.18855673  5.9542046 0.0303600
## 2:3-4:1  2.3738236 -0.37484113  5.1224884 0.1279519
## 4:3-4:1  0.8253766 -1.98506365  3.6358168 0.9530146
## 4:2-2:2 -1.1420895 -4.08387298  1.7996940 0.8603965
## 2:3-2:2 -1.8396465 -4.65008675  0.9707937 0.3949044
## 4:3-2:2 -3.3880936 -6.25898030 -0.5172068 0.0118509
## 2:3-4:2 -0.6975570 -3.58038097  2.1852669 0.9795430
## 4:3-4:2 -2.2460041 -5.18778759  0.6957794 0.2311878
## 4:3-2:3 -1.5484471 -4.35888730  1.2619932 0.5860190
# plot interactions
interaction.plot(E64.fecundity.data.TU$Treatment, E64.fecundity.data.TU$Trial,E64.fecundity.data.TU$Eggs.Mite, type="b", col=c(1:3), leg.bty="o", leg.bg="grey95", lwd=2, ylab="Eggs.Mite", xlab="Treatment", main="Treatment:Trial")

interaction.plot(E64.fecundity.data.TU$dpi, E64.fecundity.data.TU$Trial, E64.fecundity.data.TU$Eggs.Mite, type="b", col=c(1:3), leg.bty="o", leg.bg="grey95", lwd=2, ylab="Eggs.Mite", xlab="dpi", main="dpi:Trial")

interaction.plot(E64.fecundity.data.TU$dpi, E64.fecundity.data.TU$Treatment, E64.fecundity.data.TU$Eggs.Mite, type="b", col=c(1:3), leg.bty="o", leg.bg="grey95", lwd=2, ylab="Eggs.Mite", xlab="dpi", main="dpi:Treatment")

TU-A

# fit linear model and display model fit information and ANOVA table
# full model including 3 way interaction term - to verify it is not significant, if it is, interpretation of hypothesis testing will be problematic
m.TA.0 <- lm(Eggs.Mite ~ dpi +Treatment + Trial + dpi:Treatment + Treatment:Trial + dpi:Trial + dpi:Trial:Treatment, data = E64.fecundity.data.TA)
summary(m.TA.0)
## 
## Call:
## lm(formula = Eggs.Mite ~ dpi + Treatment + Trial + dpi:Treatment + 
##     Treatment:Trial + dpi:Trial + dpi:Trial:Treatment, data = E64.fecundity.data.TA)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -6.635 -1.053  0.131  1.059  7.330 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                 9.9978086  0.9533076  10.487 6.38e-15 ***
## dpi4                       15.2397122  1.4139836  10.778 2.25e-15 ***
## TreatmentWater             -0.0006748  1.3481805  -0.001   0.9996    
## Trial2                      3.4808979  1.3481805   2.582   0.0124 *  
## Trial3                      2.1106709  1.4139836   1.493   0.1410    
## dpi4:TreatmentWater         0.0646302  1.9536992   0.033   0.9737    
## TreatmentWater:Trial2       0.3605647  1.9066151   0.189   0.8507    
## TreatmentWater:Trial3       3.9384407  1.9536992   2.016   0.0485 *  
## dpi4:Trial2                 4.8013878  1.9996748   2.401   0.0196 *  
## dpi4:Trial3                 2.9839963  1.9996748   1.492   0.1412    
## dpi4:TreatmentWater:Trial2  0.2900052  2.7629478   0.105   0.9168    
## dpi4:TreatmentWater:Trial3 -5.0602418  2.7629478  -1.831   0.0723 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.335 on 57 degrees of freedom
## Multiple R-squared:  0.9475, Adjusted R-squared:  0.9374 
## F-statistic: 93.55 on 11 and 57 DF,  p-value: < 2.2e-16
Anova(m.TA.0)
## Anova Table (Type II tests)
## 
## Response: Eggs.Mite
##                     Sum Sq Df  F value    Pr(>F)    
## dpi                 4986.5  1 914.4851 < 2.2e-16 ***
## Treatment              6.7  1   1.2373 0.2706639    
## Trial                444.4  2  40.7465 1.027e-11 ***
## dpi:Treatment         10.0  1   1.8289 0.1815932    
## Treatment:Trial        5.4  2   0.4991 0.6097143    
## dpi:Trial             87.8  2   8.0508 0.0008327 ***
## dpi:Treatment:Trial   25.9  2   2.3717 0.1024737    
## Residuals            310.8 57                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# linear model without non-significant 3-way interaction (want to reduce comparisons made in Tukey-Kramer post-hoc test)
m.TA <- lm(Eggs.Mite ~ dpi +Treatment + Trial + dpi:Treatment + Treatment:Trial + dpi:Trial, data = E64.fecundity.data.TA)
summary(m.TA)
## 
## Call:
## lm(formula = Eggs.Mite ~ dpi + Treatment + Trial + dpi:Treatment + 
##     Treatment:Trial + dpi:Trial, data = E64.fecundity.data.TA)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -6.256 -1.218 -0.220  1.049  7.709 
## 
## Coefficients:
##                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)             9.6192     0.8945  10.754 1.57e-15 ***
## dpi4                   16.0726     1.1669  13.774  < 2e-16 ***
## TreatmentWater          0.7565     1.1394   0.664 0.509313    
## Trial2                  3.4118     1.2038   2.834 0.006281 ** 
## Trial3                  3.4807     1.2421   2.802 0.006854 ** 
## dpi4:TreatmentWater    -1.5254     1.1539  -1.322 0.191271    
## TreatmentWater:Trial2   0.4987     1.4116   0.353 0.725157    
## TreatmentWater:Trial3   1.3636     1.4127   0.965 0.338375    
## dpi4:Trial2             4.9533     1.4116   3.509 0.000868 ***
## dpi4:Trial3             0.3334     1.4116   0.236 0.814113    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 2.389 on 59 degrees of freedom
## Multiple R-squared:  0.9431, Adjusted R-squared:  0.9345 
## F-statistic: 108.8 on 9 and 59 DF,  p-value: < 2.2e-16
Anova(m.TA)
## Anova Table (Type II tests)
## 
## Response: Eggs.Mite
##                 Sum Sq Df  F value    Pr(>F)    
## dpi             4986.5  1 873.8531 < 2.2e-16 ***
## Treatment          6.7  1   1.1823  0.281308    
## Trial            444.4  2  38.9361 1.655e-11 ***
## dpi:Treatment     10.0  1   1.7477  0.191271    
## Treatment:Trial    5.4  2   0.4769  0.623071    
## dpi:Trial         87.8  2   7.6931  0.001074 ** 
## Residuals        336.7 59                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Calculate effect size and display
result.anova<-Anova(m.TA)
ss<-result.anova$"Sum Sq"  ##ss = sum of squares
pes<-ss/(ss+ss[length(ss)])  ##pes = partial e squared
pes[length(pes)]<-""
result.anova$"Part E Sq"<-pes
result.anova
## Anova Table (Type II tests)
## 
## Response: Eggs.Mite
##                 Sum Sq Df  F value  Pr(>F) Part E Sq
## dpi             4986.5  1 873.8531 0.00000   0.93675
## Treatment          6.7  1   1.1823 0.28131   0.01965
## Trial            444.4  2  38.9361 0.00000   0.56894
## dpi:Treatment     10.0  1   1.7477 0.19127   0.02877
## Treatment:Trial    5.4  2   0.4769 0.62307   0.01591
## dpi:Trial         87.8  2   7.6931 0.00107   0.20684
## Residuals        336.7 59
# perform post-hoc Tukey-Kramer test of contrasts
TukeyHSD(aov(Eggs.Mite ~ dpi +Treatment + Trial + dpi:Treatment + Treatment:Trial + dpi:Trial, data = E64.fecundity.data.TA))
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = Eggs.Mite ~ dpi + Treatment + Trial + dpi:Treatment + Treatment:Trial + dpi:Trial, data = E64.fecundity.data.TA)
## 
## $dpi
##         diff      lwr      upr p adj
## 4-2 17.07466 15.92366 18.22566     0
## 
## $Treatment
##                 diff        lwr      upr     p adj
## Water-E-64 0.6693366 -0.4826307 1.821304 0.2496511
## 
## $Trial
##          diff       lwr         upr     p adj
## 2-1  6.040988  4.347400  7.73457652 0.0000000
## 3-1  4.322974  2.629385  6.01656229 0.0000002
## 3-2 -1.718014 -3.411603 -0.02442578 0.0460686
## 
## $`dpi:Treatment`
##                         diff         lwr        upr     p adj
## 4:E-64-2:E-64    17.83400820  15.6342358  20.033781 0.0000000
## 2:Water-2:E-64    1.39491758  -0.7409707   3.530806 0.3193021
## 4:Water-2:E-64   17.75475344  15.6188652  19.890642 0.0000000
## 2:Water-4:E-64  -16.43909062 -18.6090342 -14.269147 0.0000000
## 4:Water-4:E-64   -0.07925476  -2.2491983   2.090689 0.9996737
## 4:Water-2:Water  16.35983586  14.2546814  18.464990 0.0000000
## 
## $`Treatment:Trial`
##                        diff        lwr       upr     p adj
## Water:1-E-64:1  -0.07516615 -3.0121582 2.8618259 0.9999996
## E-64:2-E-64:1    5.66334693  2.6631866 8.6635073 0.0000099
## Water:2-E-64:1   6.31199298  3.3750010 9.2489850 0.0000005
## E-64:3-E-64:1    3.53486601  0.5347057 6.5350264 0.0119863
## Water:3-E-64:1   4.96939600  2.0324040 7.9063880 0.0000821
## E-64:2-Water:1   5.73851308  2.8015211 8.6755051 0.0000048
## Water:2-Water:1  6.38715913  3.5147243 9.2595940 0.0000002
## E-64:3-Water:1   3.61003216  0.6730402 6.5470242 0.0076961
## Water:3-Water:1  5.04456215  2.1721273 7.9169970 0.0000414
## Water:2-E-64:2   0.64864605 -2.2883460 3.5856381 0.9864810
## E-64:3-E-64:2   -2.12848092 -5.1286413 0.8716794 0.3067863
## Water:3-E-64:2  -0.69395093 -3.6309429 2.2430411 0.9817096
## E-64:3-Water:2  -2.77712697 -5.7141190 0.1598650 0.0740836
## Water:3-Water:2 -1.34259698 -4.2150318 1.5298379 0.7405560
## Water:3-E-64:3   1.43452999 -1.5024620 4.3715220 0.7035833
## 
## $`dpi:Trial`
##                diff         lwr        upr     p adj
## 4:1-2:1  15.2656654  12.3286734  18.202657 0.0000000
## 2:2-2:1   3.6769153   0.8044805   6.549350 0.0048758
## 4:2-2:1  23.8856420  20.9486500  26.822634 0.0000000
## 2:3-2:1   4.2280772   1.2910852   7.165069 0.0010796
## 4:3-2:1  19.8263778  16.9539429  22.698813 0.0000000
## 2:2-4:1 -11.5887501 -14.5257421  -8.651758 0.0000000
## 4:2-4:1   8.6199765   5.6198162  11.620137 0.0000000
## 2:3-4:1 -11.0375883 -14.0377486  -8.037428 0.0000000
## 4:3-4:1   4.5607123   1.6237203   7.497704 0.0003484
## 4:2-2:2  20.2087267  17.2717347  23.145719 0.0000000
## 2:3-2:2   0.5511619  -2.3858301   3.488154 0.9935875
## 4:3-2:2  16.1494624  13.2770276  19.021897 0.0000000
## 2:3-4:2 -19.6575648 -22.6577251 -16.657404 0.0000000
## 4:3-4:2  -4.0592642  -6.9962562  -1.122272 0.0018821
## 4:3-2:3  15.5983006  12.6613086  18.535293 0.0000000
# plot interactions
interaction.plot(E64.fecundity.data.TA$Treatment, E64.fecundity.data.TA$Trial,E64.fecundity.data.TA$Eggs.Mite, type="b", col=c(1:3), leg.bty="o", leg.bg="grey95", lwd=2, ylab="Eggs.Mite", xlab="Treatment", main="Treatment:Trial")

interaction.plot(E64.fecundity.data.TA$dpi, E64.fecundity.data.TA$Trial, E64.fecundity.data.TA$Eggs.Mite, type="b", col=c(1:3), leg.bty="o", leg.bg="grey95", lwd=2, ylab="Eggs.Mite", xlab="dpi", main="dpi:Trial")