Spreadsheet notes

The file “data_allfruits.xlsx” contains all raw values for L. monocytogenes counts and TVC. The file “data_allfruits.gp.xlsx” contains the growth potential values for L. monocytogenes at each time point. LM represents the CFU counts for Listeria monocytogenes, PC represents the total viable count on plate count agar.

library(lmerTest)
## Loading required package: lme4
## Loading required package: Matrix
## 
## Attaching package: 'lmerTest'
## The following object is masked from 'package:lme4':
## 
##     lmer
## The following object is masked from 'package:stats':
## 
##     step
library(readxl)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(lsmeans)
## The 'lsmeans' package is being deprecated.
## Users are encouraged to switch to 'emmeans'.
## See help('transition') for more information, including how
## to convert 'lsmeans' objects and scripts to work with 'emmeans'.
library(tidyr)
## 
## Attaching package: 'tidyr'
## The following object is masked from 'package:Matrix':
## 
##     expand
library(reshape2)
## 
## Attaching package: 'reshape2'
## The following object is masked from 'package:tidyr':
## 
##     smiths
library(car)
## Loading required package: carData
## 
## Attaching package: 'car'
## The following object is masked from 'package:dplyr':
## 
##     recode
library(effects)
## lattice theme set by effectsTheme()
## See ?effectsTheme for details.
library(MASS)
## 
## Attaching package: 'MASS'
## The following object is masked from 'package:dplyr':
## 
##     select
library(ggplot2)
library(knitr)
library(kableExtra)

#GET AND ORGANIZE DATA
data.1 <- read_excel("./data/data_allfruits.gp.xlsx")
data.2 <- read_excel("./data/data_allfruits.xlsx")
#add log of CFU
data.2$logLM <- log10(data.2$LM)
data.2$logPC <- log10(data.2$PC)
#exclude negative control values. They are contamination controls. They
#can not provide any meaningful data to the response variable "logLM" because they
#have no logLM. 
data.2 = data.2[!data.2$strain == "negative control",]
#Join salad and rep to make a factor unique for each salad/rep combo
data.2$salad_rep <- paste(data.2$product,data.2$replicate,data.2$temp)

#Print the data
data.1 %>%
  kable("html") %>%
  kable_styling(bootstrap_options=c("striped",
                                    "hover",
                                    "condensed",
                                    "responsive"))
fruit temp. t pH gp rep
Fruit mix 2 4 C - 8 C 0 4.2 0.0000000 1-3
Fruit mix 2 4 C - 8 C 3 4.2 0.1361109 1-3
Fruit mix 2 4 C - 8 C 4 4.2 0.3979400 1-3
Fruit mix 2 4 C - 8 C 5 4.2 0.5199344 1-3
Fruit mix 2 4 C - 8 C 6 4.2 0.9156791 1-3
Fruit mix 2 4 C - 12 C 0 4.2 0.0000000 1-3
Fruit mix 2 4 C - 12 C 3 4.2 0.1463301 1-3
Fruit mix 2 4 C - 12 C 4 4.2 0.9503122 1-3
Fruit mix 2 4 C - 12 C 5 4.2 1.0274094 1-3
Fruit mix 2 4 C - 12 C 6 4.2 1.0659853 1-3
Fruit mix 1 4 C - 8 C 0 3.4 0.0000000 1-3
Fruit mix 1 4 C - 8 C 3 3.4 0.0579919 1-3
Fruit mix 1 4 C - 8 C 4 3.4 0.1103567 1-3
Fruit mix 1 4 C - 8 C 5 3.4 0.1390114 1-3
Fruit mix 1 4 C - 8 C 6 3.4 0.1017989 1-3
Fruit mix 1 4 C - 12 C 0 3.4 0.0000000 1-3
Fruit mix 1 4 C - 12 C 3 3.4 0.1017989 1-3
Fruit mix 1 4 C - 12 C 4 3.4 0.0941700 1-3
Fruit mix 1 4 C - 12 C 5 3.4 0.0403983 1-3
Fruit mix 1 4 C - 12 C 6 3.4 0.1788141 1-3
Cantaloupe 4 C - 8 C 0 5.6 0.0000000 1-3
Cantaloupe 4 C - 8 C 3 5.6 1.2317420 1-3
Cantaloupe 4 C - 8 C 4 5.6 2.0373714 1-3
Cantaloupe 4 C - 8 C 5 5.6 2.6455012 1-3
Cantaloupe 4 C - 8 C 6 5.6 2.5555032 1-3
Cantaloupe 4 C - 12 C 0 5.6 0.0000000 1-3
Cantaloupe 4 C - 12 C 3 5.6 1.2936480 1-3
Cantaloupe 4 C - 12 C 4 5.6 2.7296855 1-3
Cantaloupe 4 C - 12 C 5 5.6 2.7936154 1-3
Cantaloupe 4 C - 12 C 6 5.6 2.6041086 1-3
Fruit mix 3 4 C - 8 C 0 3.9 0.0000000 1-3
Fruit mix 3 4 C - 8 C 3 3.9 0.1930224 1-3
Fruit mix 3 4 C - 8 C 4 3.9 0.1482101 1-3
Fruit mix 3 4 C - 8 C 5 3.9 0.1537105 1-3
Fruit mix 3 4 C - 8 C 6 3.9 0.1575501 1-3
Fruit mix 3 4 C - 12 C 0 3.9 0.0000000 1-3
Fruit mix 3 4 C - 12 C 3 3.9 0.1189484 1-3
Fruit mix 3 4 C - 12 C 4 3.9 0.2085591 1-3
Fruit mix 3 4 C - 12 C 5 3.9 0.4585801 1-3
Fruit mix 3 4 C - 12 C 6 3.9 0.4154307 1-3
Coconut 4 C - 8 C 0 6.4 0.0000000 1-3
Coconut 4 C - 8 C 3 6.4 1.2552725 1-3
Coconut 4 C - 8 C 4 6.4 3.0010763 1-3
Coconut 4 C - 8 C 5 6.4 3.0381476 1-3
Coconut 4 C - 8 C 6 6.4 3.6251439 1-3
Coconut 4 C - 12 C 0 6.4 0.0000000 1-3
Coconut 4 C - 12 C 3 6.4 1.3881802 1-3
Coconut 4 C - 12 C 4 6.4 2.6892102 1-3
Coconut 4 C - 12 C 5 6.4 4.1926546 1-3
Coconut 4 C - 12 C 6 6.4 4.7978155 1-3
Mango 4 C - 8 C 0 3.6 0.0000000 1-3
Mango 4 C - 8 C 3 3.6 0.1432423 1-3
Mango 4 C - 8 C 4 3.6 0.1114920 1-3
Mango 4 C - 8 C 5 3.6 0.0000000 1-3
Mango 4 C - 8 C 6 3.6 0.1327769 1-3
Mango 4 C - 12 C 0 3.6 0.0000000 1-3
Mango 4 C - 12 C 3 3.6 0.0775003 1-3
Mango 4 C - 12 C 4 3.6 0.0947863 1-3
Mango 4 C - 12 C 5 3.6 0.0113548 1-3
Mango 4 C - 12 C 6 3.6 0.0251430 1-3
data.2 %>%
  kable("html") %>%
  kable_styling(bootstrap_options=c("striped",
                                    "hover",
                                    "condensed",
                                    "responsive"))
product temp t pH.average LM replicate strain PC logLM logPC salad_rep
Fruit mix 1 4C + 8C 0 3.4 7350 1 pool 10750 3.866287 4.031409 Fruit mix 1 1 4C + 8C
Fruit mix 1 4C + 12C 0 3.4 7350 1 pool 10750 3.866287 4.031409 Fruit mix 1 1 4C + 12C
Fruit mix 1 4C + 8C 0 3.4 7950 2 pool 15250 3.900367 4.183270 Fruit mix 1 2 4C + 8C
Fruit mix 1 4C + 12C 0 3.4 7950 2 pool 15250 3.900367 4.183270 Fruit mix 1 2 4C + 12C
Fruit mix 1 4C + 8C 0 3.4 8350 3 pool 13000 3.921686 4.113943 Fruit mix 1 3 4C + 8C
Fruit mix 1 4C + 12C 0 3.4 8350 3 pool 13000 3.921686 4.113943 Fruit mix 1 3 4C + 12C
Fruit mix 1 4C + 8C 3 3.4 8400 1 pool 10250 3.924279 4.010724 Fruit mix 1 1 4C + 8C
Fruit mix 1 4C + 12C 3 3.4 7175 1 pool 11250 3.855822 4.051152 Fruit mix 1 1 4C + 12C
Fruit mix 1 4C + 8C 3 3.4 8775 2 pool 11750 3.943247 4.070038 Fruit mix 1 2 4C + 8C
Fruit mix 1 4C + 12C 3 3.4 10050 2 pool 11000 4.002166 4.041393 Fruit mix 1 2 4C + 12C
Fruit mix 1 4C + 8C 3 3.4 7050 3 pool 17000 3.848189 4.230449 Fruit mix 1 3 4C + 8C
Fruit mix 1 4C + 12C 3 3.4 8825 3 pool 14000 3.945715 4.146128 Fruit mix 1 3 4C + 12C
Fruit mix 1 4C + 8C 4 3.4 7600 1 pool 10750 3.880814 4.031409 Fruit mix 1 1 4C + 8C
Fruit mix 1 4C + 12C 4 3.4 7775 1 pool 25000 3.890700 4.397940 Fruit mix 1 1 4C + 12C
Fruit mix 1 4C + 8C 4 3.4 10250 2 pool 42750 4.010724 4.630936 Fruit mix 1 2 4C + 8C
Fruit mix 1 4C + 12C 4 3.4 9875 2 pool 44750 3.994537 4.650793 Fruit mix 1 2 4C + 12C
Fruit mix 1 4C + 8C 4 3.4 8825 3 pool 75750 3.945715 4.879383 Fruit mix 1 3 4C + 8C
Fruit mix 1 4C + 12C 4 3.4 9600 3 pool 352500 3.982271 5.547159 Fruit mix 1 3 4C + 12C
Fruit mix 1 4C + 8C 5 3.4 7025 1 pool 13250 3.846646 4.122216 Fruit mix 1 1 4C + 8C
Fruit mix 1 4C + 12C 5 3.4 7025 1 pool 60500 3.846646 4.781755 Fruit mix 1 1 4C + 12C
Fruit mix 1 4C + 8C 5 3.4 8025 2 pool 542500 3.904445 5.734400 Fruit mix 1 2 4C + 8C
Fruit mix 1 4C + 12C 5 3.4 8725 2 pool 1057500 3.940765 6.024280 Fruit mix 1 2 4C + 12C
Fruit mix 1 4C + 8C 5 3.4 11500 3 pool 422500 4.060698 5.625827 Fruit mix 1 3 4C + 8C
Fruit mix 1 4C + 12C 5 3.4 8000 3 pool 9825000 3.903090 6.992333 Fruit mix 1 3 4C + 12C
Fruit mix 1 4C + 8C 6 3.4 7775 1 pool 52500 3.890700 4.720159 Fruit mix 1 1 4C + 8C
Fruit mix 1 4C + 12C 6 3.4 8375 1 pool 622500 3.922985 5.794139 Fruit mix 1 1 4C + 12C
Fruit mix 1 4C + 8C 6 3.4 10050 2 pool 645000 4.002166 5.809560 Fruit mix 1 2 4C + 8C
Fruit mix 1 4C + 12C 6 3.4 12000 2 pool 7275000 4.079181 6.861833 Fruit mix 1 2 4C + 12C
Fruit mix 1 4C + 8C 6 3.4 6650 3 pool 2075000 3.822822 6.317018 Fruit mix 1 3 4C + 8C
Fruit mix 1 4C + 12C 6 3.4 7500 3 pool 15750000 3.875061 7.197281 Fruit mix 1 3 4C + 12C
Fruit mix 3 4C + 8C 0 3.9 9125 1 pool 19500 3.960233 4.290035 Fruit mix 3 1 4C + 8C
Fruit mix 3 4C + 12C 0 3.9 9125 1 pool 19500 3.960233 4.290035 Fruit mix 3 1 4C + 12C
Fruit mix 3 4C + 8C 0 3.8 8325 2 pool 10250 3.920384 4.010724 Fruit mix 3 2 4C + 8C
Fruit mix 3 4C + 12C 0 3.8 8325 2 pool 10250 3.920384 4.010724 Fruit mix 3 2 4C + 12C
Fruit mix 3 4C + 8C 0 4.1 8175 3 pool 17000 3.912488 4.230449 Fruit mix 3 3 4C + 8C
Fruit mix 3 4C + 12C 0 4.1 8175 3 pool 17000 3.912488 4.230449 Fruit mix 3 3 4C + 12C
Fruit mix 3 4C + 8C 3 3.9 11000 1 pool 34500 4.041393 4.537819 Fruit mix 3 1 4C + 8C
Fruit mix 3 4C + 12C 3 3.9 12000 1 pool 24250 4.079181 4.384712 Fruit mix 3 1 4C + 12C
Fruit mix 3 4C + 8C 3 3.8 7500 2 pool 11750 3.875061 4.070038 Fruit mix 3 2 4C + 8C
Fruit mix 3 4C + 12C 3 3.8 9475 2 pool 13750 3.976579 4.138303 Fruit mix 3 2 4C + 12C
Fruit mix 3 4C + 8C 3 4.1 12750 3 pool 15500 4.105510 4.190332 Fruit mix 3 3 4C + 8C
Fruit mix 3 4C + 12C 3 4.1 9075 3 pool 15000 3.957847 4.176091 Fruit mix 3 3 4C + 12C
Fruit mix 3 4C + 8C 4 3.9 12500 1 pool 52750 4.096910 4.722222 Fruit mix 3 1 4C + 8C
Fruit mix 3 4C + 12C 4 3.9 14750 1 pool 545000 4.168792 5.736396 Fruit mix 3 1 4C + 12C
Fruit mix 3 4C + 8C 4 3.8 6875 2 pool 14000 3.837273 4.146128 Fruit mix 3 2 4C + 8C
Fruit mix 3 4C + 12C 4 3.8 7150 2 pool 18750 3.854306 4.273001 Fruit mix 3 2 4C + 12C
Fruit mix 3 4C + 8C 4 4.1 11500 3 pool 27000 4.060698 4.431364 Fruit mix 3 3 4C + 8C
Fruit mix 3 4C + 12C 4 4.1 10000 3 pool 352500 4.000000 5.547159 Fruit mix 3 3 4C + 12C
Fruit mix 3 4C + 8C 5 3.9 13000 1 pool 102500 4.113943 5.010724 Fruit mix 3 1 4C + 8C
Fruit mix 3 4C + 12C 5 3.9 10750 1 pool 2300000 4.031409 6.361728 Fruit mix 3 1 4C + 12C
Fruit mix 3 4C + 8C 5 3.8 6800 2 pool 15750 3.832509 4.197281 Fruit mix 3 2 4C + 8C
Fruit mix 3 4C + 12C 5 3.8 7200 2 pool 74500 3.857333 4.872156 Fruit mix 3 2 4C + 12C
Fruit mix 3 4C + 8C 5 4.1 10250 3 pool 120000 4.010724 5.079181 Fruit mix 3 3 4C + 8C
Fruit mix 3 4C + 12C 5 4.1 23500 3 pool 1250000 4.371068 6.096910 Fruit mix 3 3 4C + 12C
Fruit mix 3 4C + 8C 6 3.9 10250 1 pool 155000 4.010724 5.190332 Fruit mix 3 1 4C + 8C
Fruit mix 3 4C + 12C 6 3.9 23750 1 pool 22000000 4.375664 7.342423 Fruit mix 3 1 4C + 12C
Fruit mix 3 4C + 8C 6 3.8 8275 2 pool 19250 3.917768 4.284431 Fruit mix 3 2 4C + 8C
Fruit mix 3 4C + 12C 6 3.8 2500 2 pool 590000 3.397940 5.770852 Fruit mix 3 2 4C + 12C
Fruit mix 3 4C + 8C 6 4.1 11750 3 pool 377500 4.070038 5.576917 Fruit mix 3 3 4C + 8C
Fruit mix 3 4C + 12C 6 4.1 14500 3 pool 5800000 4.161368 6.763428 Fruit mix 3 3 4C + 12C
Coconut 4C + 8C 0 6.4 9525 1 pool 12250 3.978865 4.088136 Coconut 1 4C + 8C
Coconut 4C + 12C 0 6.4 9525 1 pool 12250 3.978865 4.088136 Coconut 1 4C + 12C
Coconut 4C + 8C 0 6.4 10075 2 pool 12500 4.003245 4.096910 Coconut 2 4C + 8C
Coconut 4C + 12C 0 6.4 10075 2 pool 12500 4.003245 4.096910 Coconut 2 4C + 12C
Coconut 4C + 8C 0 6.4 11250 3 pool 17250 4.051152 4.236789 Coconut 3 4C + 8C
Coconut 4C + 12C 0 6.4 11250 3 pool 17250 4.051152 4.236789 Coconut 3 4C + 12C
Coconut 4C + 8C 3 6.4 91250 1 pool 455000 4.960233 5.658011 Coconut 1 4C + 8C
Coconut 4C + 12C 3 6.4 122500 1 pool 877500 5.088136 5.943247 Coconut 1 4C + 12C
Coconut 4C + 8C 3 6.4 70250 2 pool 52250 4.846646 4.718086 Coconut 2 4C + 8C
Coconut 4C + 12C 3 6.4 93750 2 pool 80500 4.971971 4.905796 Coconut 2 4C + 12C
Coconut 4C + 8C 3 6.4 202500 3 pool 330000 5.306425 5.518514 Coconut 3 4C + 8C
Coconut 4C + 12C 3 6.4 275000 3 pool 500000 5.439333 5.698970 Coconut 3 4C + 12C
Coconut 4C + 8C 4 6.4 945000 1 pool 19500000 5.975432 7.290035 Coconut 1 4C + 8C
Coconut 4C + 12C 4 6.4 4275000 1 pool 94250000 6.630936 7.974281 Coconut 1 4C + 12C
Coconut 4C + 8C 4 6.4 10100000 2 pool 3600000 7.004321 6.556303 Coconut 2 4C + 8C
Coconut 4C + 12C 4 6.4 882500 2 pool 24700000 5.945715 7.392697 Coconut 2 4C + 12C
Coconut 4C + 8C 4 6.4 1150000 3 pool 53000000 6.060698 7.724276 Coconut 3 4C + 8C
Coconut 4C + 12C 4 6.4 5500000 3 pool 111500000 6.740363 8.047275 Coconut 3 4C + 12C
Coconut 4C + 8C 5 6.4 2800000 1 pool 227500000 6.447158 8.356981 Coconut 1 4C + 8C
Coconut 4C + 12C 5 6.4 2175000 1 pool 127500000 6.337459 8.105510 Coconut 1 4C + 12C
Coconut 4C + 8C 5 6.4 11000000 2 pool 470000000 7.041393 8.672098 Coconut 2 4C + 8C
Coconut 4C + 12C 5 6.4 157000000 2 pool 570000000 8.195900 8.755875 Coconut 2 4C + 12C
Coconut 4C + 8C 5 6.4 6325000 3 pool 255000000 6.801061 8.406540 Coconut 3 4C + 8C
Coconut 4C + 12C 5 6.4 58500000 3 pool 1007500000 7.767156 9.003245 Coconut 3 4C + 12C
Coconut 4C + 8C 6 6.4 9075000 1 pool 170000000 6.957847 8.230449 Coconut 1 4C + 8C
Coconut 4C + 12C 6 6.4 63500000 1 pool 185000000 7.802774 8.267172 Coconut 1 4C + 12C
Coconut 4C + 8C 6 6.4 42500000 2 pool 762500000 7.628389 8.882240 Coconut 2 4C + 8C
Coconut 4C + 12C 6 6.4 632500000 2 pool 1775000000 8.801061 9.249198 Coconut 2 4C + 12C
Coconut 4C + 8C 6 6.4 23500000 3 pool 535000000 7.371068 8.728354 Coconut 3 4C + 8C
Coconut 4C + 12C 6 6.4 220000000 3 pool 687500000 8.342423 8.837273 Coconut 3 4C + 12C
Fruit mix 2 4C + 8C 0 4.2 8075 1 pool 11500 3.907142 4.060698 Fruit mix 2 1 4C + 8C
Fruit mix 2 4C + 12C 0 4.2 8075 1 pool 11500 3.907142 4.060698 Fruit mix 2 1 4C + 12C
Fruit mix 2 4C + 8C 0 3.9 7400 2 pool 11250 3.869232 4.051152 Fruit mix 2 2 4C + 8C
Fruit mix 2 4C + 12C 0 3.9 7400 2 pool 11250 3.869232 4.051152 Fruit mix 2 2 4C + 12C
Fruit mix 2 4C + 8C 0 3.8 7675 3 pool 9350 3.885078 3.970812 Fruit mix 2 3 4C + 8C
Fruit mix 2 4C + 12C 0 3.8 7675 3 pool 9350 3.885078 3.970812 Fruit mix 2 3 4C + 12C
Fruit mix 2 4C + 8C 3 4.2 5325 1 pool 8000 3.726320 3.903090 Fruit mix 2 1 4C + 8C
Fruit mix 2 4C + 12C 3 4.2 5425 1 pool 12000 3.734400 4.079181 Fruit mix 2 1 4C + 12C
Fruit mix 2 4C + 8C 3 3.9 8025 2 pool 17250 3.904445 4.236789 Fruit mix 2 2 4C + 8C
Fruit mix 2 4C + 12C 3 3.9 8900 2 pool 172500 3.949390 5.236789 Fruit mix 2 2 4C + 12C
Fruit mix 2 4C + 8C 3 3.8 10500 3 pool 11250 4.021189 4.051152 Fruit mix 2 3 4C + 8C
Fruit mix 2 4C + 12C 3 3.8 10750 3 pool 21500 4.031409 4.332439 Fruit mix 2 3 4C + 12C
Fruit mix 2 4C + 8C 4 4.2 8825 1 pool 25250 3.945715 4.402261 Fruit mix 2 1 4C + 8C
Fruit mix 2 4C + 12C 4 4.2 26250 1 pool 91500 4.419129 4.961421 Fruit mix 2 1 4C + 12C
Fruit mix 2 4C + 8C 4 3.9 18500 2 pool 810000 4.267172 5.908485 Fruit mix 2 2 4C + 8C
Fruit mix 2 4C + 12C 4 3.9 66000 2 pool 4330000 4.819544 6.636488 Fruit mix 2 2 4C + 12C
Fruit mix 2 4C + 8C 4 3.8 14750 3 pool 270000 4.168792 5.431364 Fruit mix 2 3 4C + 8C
Fruit mix 2 4C + 12C 4 3.8 14500 3 pool 525000 4.161368 5.720159 Fruit mix 2 3 4C + 12C
Fruit mix 2 4C + 8C 5 4.2 6325 1 pool 26250 3.801061 4.419129 Fruit mix 2 1 4C + 8C
Fruit mix 2 4C + 12C 5 4.2 52000 1 pool 200000 4.716003 5.301030 Fruit mix 2 1 4C + 12C
Fruit mix 2 4C + 8C 5 3.9 24500 2 pool 1350000 4.389166 6.130334 Fruit mix 2 2 4C + 8C
Fruit mix 2 4C + 12C 5 3.9 76750 2 pool 3975000 4.885078 6.599337 Fruit mix 2 2 4C + 12C
Fruit mix 2 4C + 8C 5 3.8 15750 3 pool 4125000 4.197281 6.615424 Fruit mix 2 3 4C + 8C
Fruit mix 2 4C + 12C 5 3.8 81750 3 pool 4525000 4.912488 6.655619 Fruit mix 2 3 4C + 12C
Fruit mix 2 4C + 8C 6 4.2 66500 1 pool 792500 4.822822 5.898999 Fruit mix 2 1 4C + 8C
Fruit mix 2 4C + 12C 6 4.2 94000 1 pool 4425000 4.973128 6.645913 Fruit mix 2 1 4C + 12C
Fruit mix 2 4C + 8C 6 3.9 11750 2 pool 1075000 4.070038 6.031409 Fruit mix 2 2 4C + 8C
Fruit mix 2 4C + 12C 6 3.9 43500 2 pool 2300000 4.638489 6.361728 Fruit mix 2 2 4C + 12C
Fruit mix 2 4C + 8C 6 3.8 14750 3 pool 2950000 4.168792 6.469822 Fruit mix 2 3 4C + 8C
Fruit mix 2 4C + 12C 6 3.8 34250 3 pool 2575000 4.534661 6.410777 Fruit mix 2 3 4C + 12C
Mango 4C + 8C 0 3.6 7550 1 pool 8200 3.877947 3.913814 Mango 1 4C + 8C
Mango 4C + 12C 0 3.6 7550 1 pool 8200 3.877947 3.913814 Mango 1 4C + 12C
Mango 4C + 8C 0 3.8 8625 2 pool 10500 3.935759 4.021189 Mango 2 4C + 8C
Mango 4C + 12C 0 3.8 8625 2 pool 10500 3.935759 4.021189 Mango 2 4C + 12C
Mango 4C + 8C 0 4.3 10250 3 pool 11500 4.010724 4.060698 Mango 3 4C + 8C
Mango 4C + 12C 0 4.3 10250 3 pool 11500 4.010724 4.060698 Mango 3 4C + 12C
Mango 4C + 8C 3 3.6 10500 1 pool 16500 4.021189 4.217484 Mango 1 4C + 8C
Mango 4C + 12C 3 3.6 9025 1 pool 11000 3.955447 4.041393 Mango 1 4C + 12C
Mango 4C + 8C 3 3.8 7575 2 pool 12250 3.879383 4.088136 Mango 2 4C + 8C
Mango 4C + 12C 3 3.8 8950 2 pool 14250 3.951823 4.153815 Mango 2 4C + 12C
Mango 4C + 8C 3 4.3 12250 3 pool 11500 4.088136 4.060698 Mango 3 4C + 8C
Mango 4C + 12C 3 4.3 11500 3 pool 13000 4.060698 4.113943 Mango 3 4C + 12C
Mango 4C + 8C 4 3.6 9250 1 pool 14250 3.966142 4.153815 Mango 1 4C + 8C
Mango 4C + 12C 4 3.6 9350 1 pool 945000 3.970812 5.975432 Mango 1 4C + 12C
Mango 4C + 8C 4 3.8 10250 2 pool 15750 4.010724 4.197281 Mango 2 4C + 8C
Mango 4C + 12C 4 3.8 8100 2 pool 192500 3.908485 5.284431 Mango 2 4C + 12C
Mango 4C + 8C 4 4.3 13250 3 pool 17000 4.122216 4.230449 Mango 3 4C + 8C
Mango 4C + 12C 4 4.3 12750 3 pool 260000 4.105510 5.414973 Mango 3 4C + 12C
Mango 4C + 8C 5 3.6 7200 1 pool 127500 3.857333 5.105510 Mango 1 4C + 8C
Mango 4C + 12C 5 3.6 7750 1 pool 43300000 3.889302 7.636488 Mango 1 4C + 12C
Mango 4C + 8C 5 3.8 6725 2 pool 960000 3.827692 5.982271 Mango 2 4C + 8C
Mango 4C + 12C 5 3.8 7425 2 pool 222500 3.870697 5.347330 Mango 2 4C + 12C
Mango 4C + 8C 5 4.3 10250 3 pool 102500 4.010724 5.010724 Mango 3 4C + 8C
Mango 4C + 12C 5 4.3 8750 3 pool 2325000 3.942008 6.366423 Mango 3 4C + 12C
Mango 4C + 8C 6 3.6 10250 1 pool 450000 4.010724 5.653213 Mango 1 4C + 8C
Mango 4C + 12C 6 3.6 8000 1 pool 98750000 3.903090 7.994537 Mango 1 4C + 12C
Mango 4C + 8C 6 3.8 7000 2 pool 1050000 3.845098 6.021189 Mango 2 4C + 8C
Mango 4C + 12C 6 3.8 7625 2 pool 2675000 3.882240 6.427324 Mango 2 4C + 12C
Mango 4C + 8C 6 4.3 11250 3 pool 300000 4.051152 5.477121 Mango 3 4C + 8C
Mango 4C + 12C 6 4.3 9000 3 pool 2175000 3.954242 6.337459 Mango 3 4C + 12C
Cantaloupe 4C + 8C 0 5.6 10850 1 pool 17750 4.035430 4.249198 Cantaloupe 1 4C + 8C
Cantaloupe 4C + 12C 0 5.6 10850 1 pool 17750 4.035430 4.249198 Cantaloupe 1 4C + 12C
Cantaloupe 4C + 8C 0 5.7 8900 2 pool 11500 3.949390 4.060698 Cantaloupe 2 4C + 8C
Cantaloupe 4C + 12C 0 5.7 8900 2 pool 11500 3.949390 4.060698 Cantaloupe 2 4C + 12C
Cantaloupe 4C + 8C 0 6.4 10575 3 pool 24500 4.024280 4.389166 Cantaloupe 3 4C + 8C
Cantaloupe 4C + 12C 0 6.4 10575 3 pool 24500 4.024280 4.389166 Cantaloupe 3 4C + 12C
Cantaloupe 4C + 8C 3 5.6 185000 1 pool 350000 5.267172 5.544068 Cantaloupe 1 4C + 8C
Cantaloupe 4C + 12C 3 5.6 172500 1 pool 775000 5.236789 5.889302 Cantaloupe 1 4C + 12C
Cantaloupe 4C + 8C 3 5.7 102500 2 pool 122500 5.010724 5.088136 Cantaloupe 2 4C + 8C
Cantaloupe 4C + 12C 3 5.7 175000 2 pool 660000 5.243038 5.819544 Cantaloupe 2 4C + 12C
Cantaloupe 4C + 8C 3 6.4 150000 3 pool 475000 5.176091 5.676694 Cantaloupe 3 4C + 8C
Cantaloupe 4C + 12C 3 6.4 190000 3 pool 477500 5.278754 5.678973 Cantaloupe 3 4C + 12C
Cantaloupe 4C + 8C 4 5.6 1182500 1 pool 3775000 6.072801 6.576917 Cantaloupe 1 4C + 8C
Cantaloupe 4C + 12C 4 5.6 4102500 1 pool 74000000 6.613049 7.869232 Cantaloupe 1 4C + 12C
Cantaloupe 4C + 8C 4 5.7 665000 2 pool 2350000 5.822822 6.371068 Cantaloupe 2 4C + 8C
Cantaloupe 4C + 12C 4 5.7 375000 2 pool 2625000 5.574031 6.419129 Cantaloupe 2 4C + 12C
Cantaloupe 4C + 8C 4 6.4 967500 3 pool 5800000 5.985651 6.763428 Cantaloupe 3 4C + 8C
Cantaloupe 4C + 12C 4 6.4 5675000 3 pool 156750000 6.753966 8.195208 Cantaloupe 3 4C + 12C
Cantaloupe 4C + 8C 5 5.6 2875000 1 pool 20250000 6.458638 7.306425 Cantaloupe 1 4C + 8C
Cantaloupe 4C + 12C 5 5.6 2650000 1 pool 180000000 6.423246 8.255273 Cantaloupe 1 4C + 12C
Cantaloupe 4C + 8C 5 5.7 1025000 2 pool 2100000 6.010724 6.322219 Cantaloupe 2 4C + 8C
Cantaloupe 4C + 12C 5 5.7 1625000 2 pool 31000000 6.210853 7.491362 Cantaloupe 2 4C + 12C
Cantaloupe 4C + 8C 5 6.4 4675000 3 pool 36500000 6.669782 7.562293 Cantaloupe 3 4C + 8C
Cantaloupe 4C + 12C 5 6.4 6575000 3 pool 750000000 6.817896 8.875061 Cantaloupe 3 4C + 12C
Cantaloupe 4C + 8C 6 5.6 1525000 1 pool 28500000 6.183270 7.454845 Cantaloupe 1 4C + 8C
Cantaloupe 4C + 12C 6 5.6 2275000 1 pool 635000000 6.356981 8.802774 Cantaloupe 1 4C + 12C
Cantaloupe 4C + 8C 6 5.7 270000 2 pool 420000 5.431364 5.623249 Cantaloupe 2 4C + 8C
Cantaloupe 4C + 12C 6 5.7 1300000 2 pool 950000 6.113943 5.977724 Cantaloupe 2 4C + 12C
Cantaloupe 4C + 8C 6 6.4 3800000 3 pool 157500000 6.579784 8.197281 Cantaloupe 3 4C + 8C
Cantaloupe 4C + 12C 6 6.4 4250000 3 pool 765000000 6.628389 8.883661 Cantaloupe 3 4C + 12C

Modelling

Make a Listeria model

model the effect of salad, temperature and pH on the change in logLM over time

#make a model
m_gp <- lm(gp ~ pH + fruit+temp.+ t,data=data.1)

#MODEL CHECKS
# Check normality of the residuals
hist(resid(m_gp))

qqnorm(resid(m_gp))
qqline(resid(m_gp))

# Check constant variance of the residuals
plot(m_gp)

# Model summary with effect estimates
summary(m_gp)
## 
## Call:
## lm(formula = gp ~ pH + fruit + temp. + t, data = data.1)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.59749 -0.35618 -0.02739  0.32525  1.73445 
## 
## Coefficients: (1 not defined because of singularities)
##                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)      -3.85471    0.71356  -5.402 1.66e-06 ***
## pH                0.86474    0.14716   5.876 3.02e-07 ***
## fruitCoconut     -0.08216    0.36760  -0.224    0.824    
## fruitFruit mix 1  0.19575    0.31008   0.631    0.531    
## fruitFruit mix 2 -0.06251    0.26159  -0.239    0.812    
## fruitFruit mix 3 -0.13365    0.27491  -0.486    0.629    
## fruitMango             NA         NA      NA       NA    
## temp.4 C - 8 C   -0.15653    0.16992  -0.921    0.361    
## t                 0.24431    0.04126   5.921 2.56e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.6581 on 52 degrees of freedom
## Multiple R-squared:  0.7456, Adjusted R-squared:  0.7114 
## F-statistic: 21.78 on 7 and 52 DF,  p-value: 2.103e-13
anova(m_gp)
## Analysis of Variance Table
## 
## Response: gp
##           Df Sum Sq Mean Sq  F value    Pr(>F)    
## pH         1 49.913  49.913 115.2435 8.476e-15 ***
## fruit      4  0.556   0.139   0.3210    0.8626    
## temp.      1  0.368   0.368   0.8486    0.3612    
## t          1 15.185  15.185  35.0603 2.564e-07 ***
## Residuals 52 22.522   0.433                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

This looks reasonable, and fits the data better than linear mixed effects models that we tried.

model the total viable counts

m_PC <- lmer(logPC ~ factor(t)+pH.average+product+temp+
            (1|salad_rep), data=data.2)

m_PC <- lm(logPC ~ factor(t)+pH.average+product+temp, data=data.2)
#MODEL CHECKS
# Check normality of the residuals
hist(resid(m_PC))

qqnorm(resid(m_PC))
qqline(resid(m_PC))

# Check constant variance of the residuals
plot(m_PC)

# Model summary with effect estimates
summary(m_PC)
## 
## Call:
## lm(formula = logPC ~ factor(t) + pH.average + product + temp, 
##     data = data.2)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.88708 -0.40608  0.06774  0.47427  1.50460 
## 
## Coefficients:
##                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)          4.2627     1.5547   2.742  0.00677 ** 
## factor(t)3           0.5162     0.1716   3.009  0.00303 ** 
## factor(t)4           1.6214     0.1716   9.451  < 2e-16 ***
## factor(t)5           2.3629     0.1716  13.772  < 2e-16 ***
## factor(t)6           2.6771     0.1716  15.604  < 2e-16 ***
## pH.average           0.1623     0.2617   0.620  0.53609    
## productCoconut       0.3763     0.2290   1.643  0.10221    
## productFruit mix 1  -1.0848     0.6808  -1.593  0.11294    
## productFruit mix 2  -0.8675     0.5398  -1.607  0.10993    
## productFruit mix 3  -1.2168     0.5480  -2.220  0.02772 *  
## productMango        -1.0341     0.5562  -1.859  0.06476 .  
## temp4C + 8C         -0.5086     0.1085  -4.688 5.69e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.7279 on 168 degrees of freedom
## Multiple R-squared:  0.7795, Adjusted R-squared:  0.765 
## F-statistic: 53.98 on 11 and 168 DF,  p-value: < 2.2e-16
anova(m_PC)
## Analysis of Variance Table
## 
## Response: logPC
##             Df  Sum Sq Mean Sq  F value    Pr(>F)    
## factor(t)    4 192.305  48.076  90.7415 < 2.2e-16 ***
## pH.average   1 105.524 105.524 199.1702 < 2.2e-16 ***
## product      5   5.119   1.024   1.9323   0.09149 .  
## temp         1  11.642  11.642  21.9744 5.687e-06 ***
## Residuals  168  89.009   0.530                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Plot the data

#SETUP-------------------------------------------------------------------------
#make a title which is partially in italics because I don't know how to do this in ggtitle
LM_title <- expression(paste("Model for ", italic("Listeria monocytogenes"), " on fruit products"))
LM_title2 <- expression(paste("CFU count of ", italic("Listeria monocytogenes"), " on fruit products"))


#calculate means, SD, SE of the data.
data.2 %>%
  group_by(product,temp,t) %>%
  summarize(N=length(LM),
            lmean = mean(logLM),
            lsd   = sd(logLM),
            lse   = sd(logLM) / sqrt(length(logLM)),
            lmeanPC = mean(logPC),
            lsdPC   = sd(logPC),
            lsePC   = sd(logPC) / sqrt(length(logPC))) %>%
  mutate(mean=10^lmean,
         mean_plus_sd = 10^(lmean + lsd),
         mean_minus_sd = 10^(lmean - lsd),
         meanPC = 10^(lmeanPC),
         meanPC_plus_sd = 10^(lmeanPC + lsdPC),
         meanPC_minus_sd = 10^(lmeanPC - lsdPC)) -> cdata
## Warning: package 'bindrcpp' was built under R version 3.4.4
#do the Listeria CFU/g plot: 
ggplot(cdata, aes(x=t, y=mean, color = product))+
  labs(title = LM_title2,
       subtitle="Starting concentration: 10^4 CFU/g",
       caption="Ribbon: SD",
       x="Time (days)",
       y="mean log CFU/g",
       linetype="product",
       shape="product",
       color="product",
       fill="product") +
  geom_point() +
  geom_text(aes(label= round(log10(mean), digits = 1), vjust=-0.6)) +
  geom_ribbon(group=1, aes(ymin=mean_minus_sd,
                           ymax=mean_plus_sd,
                           fill=product,
                           linetype=NA), alpha=0.2) +
  geom_line(group=1) +
  scale_y_log10(limits=c(2000, 5000000000))+
  #ylim(1, 11000000)+
  facet_grid(product~temp)

#plot total viable count CFU/g 
ggplot(cdata, aes(x=t, y=meanPC, color = product))+
  labs(title= "Mean CFU for the TVC (total viable count) in the inoculated samples",
       caption="Ribbon: SD",
       x="Time (days)",
       y="mean log CFU/g",
       linetype="product",
       shape="product",
       color="product",
       fill="product") +
  geom_point() +
  geom_text(aes(label= round(log10(meanPC), digits = 1), vjust=-0.6)) +
  geom_ribbon(group=1, aes(ymin=meanPC_minus_sd,
                           ymax=meanPC_plus_sd,
                           fill=product,
                           linetype=NA), alpha=0.2) +
  geom_line(group=1) +
  scale_y_log10(limits=c(1, 100000000000))+
  facet_grid(product~temp)

#

#