# NOT RUN {
#------- "Quantitative Microbial Risk Assessment (Haas et al., 2014) --------
# Table 6.1 (Sample A)
my_count <- c(1, 2, 1, 0, 0, 1, 1, 3, 6, 8, 4)
my_amount_scor <- c(1, 1, 1, 1, 1, 2.5, 2.5, 2.5, 2.5, 5, 5)
apc(my_count, my_amount_scor) #1.08
# Table 6.1 (Sample B)
my_count <- c(1, 0, 5, 1, 0, 5, 0, 1, 5, 1, 8)
my_amount_scor <- c(1, 1, 1, 1, 1, 2.5, 2.5, 2.5, 2.5, 5, 5)
apc(my_count, my_amount_scor) #1.08
# Table 6.2
my_count <- c(12, 8, 15, 40, 58)
my_amount_scor <- c(1, 1, 1, 10, 10)
my_amount_tntc <- c(10, 100, 100, 100)
my_tntc_limit <- 100
apc(my_count, my_amount_scor, my_amount_tntc, my_tntc_limit) #~7 (6.03, 7.96)
#----------- "Averaging of TNTC Counts" (Haas & Heller, 1988) ---------------
# Note:
# Results are slightly different due mostly to differences in how the TNTC
# portion of the likelihood function is formulated (i.e., incomplete gamma
# function vs. infinite Poisson sum--see Haas et al. (2014) for details of
# this mathematical relationship).
my_count <- c(10, 12, 23, 48, 63)
my_amount_scor <- c(1, 1, 1, 5, 5)
my_amount_tntc <- c(5, 10, 10)
my_tntc_limit <- 80
apc(my_count, my_amount_scor, my_amount_tntc, my_tntc_limit)
#Haas & Heller: APC = 13.28 CFU/ml
# }
Run the code above in your browser using DataLab