R/FECR.R
FECR.Rd
Fecal egg count reduction Calculate the FECR according to several methods described (cf. Cabaret & Berrag (2004))
FECR( T1 = NULL, T2 = NULL, C1 = NULL, C2 = NULL, method = c("Kochapakdee", "Dash", "Coles", "Cabaret1", "Cabaret2", "MacIntosh1", "MacIntosh2"), compute.CI = FALSE, percentile = c(0.025, 0.975), boot = 2000, boot.original.data = FALSE, pb = TRUE )
T1 | pre-treatment mean epg (or vector of individual epg) of the treated group.
|
---|---|
T2 | post-treatment mean epg (or vector of individual epg) of the treated group.
|
C1 | pre-treatment mean epg (or vector of individual epg) of the control group.
|
C2 | post-treatment mean epg (or vector of individual epg) of the control group.
|
method | method to base the FECR calculation on:
|
compute.CI | logical. Should confidence interval be calculated? |
percentile | quantiles to use if compute.CI is TRUE, unused otherwise. |
boot | number of bootstrap iteration to compute if compute.CI is TRUE, unused otherwise. |
boot.original.data | logical, should the original data be bootstrapped? |
pb | logical, a progress bar be displayed during bootstrap? |
the fecal egg count reduction, in percentage (if compute.CI is TRUE, a vector of lower and upper limit quantiles are passed as a "CI" attribute).
for more information, cf. Cabaret & Berrag (2004) and the literature they refer to.
set.seed(42) T1 <- rpois(50,100);T1.mean <- mean(T1) T2 <- rpois(50,10);T2.mean <- mean(T2) C1 <- rpois(50,100);C1.mean <- mean(C1) C2 <- rpois(50,90);C2.mean <- mean(C2) FECR(T1.mean,T2.mean,method = "Kochapakdee")#> [1] 89.97253FECR(T1,T2,C1,C2,method = "Dash")#> Warning: a vector of epg has been provided in place of a mean. The arithmetic mean of the vector has been used.#> [1] 88.83641FECR(T2 = T2.mean,C2 = C2.mean,method = "Coles")#> [1] 88.55799FECR(T2 = T2,C2 = C2,method = "Coles")#> Warning: a vector of epg has been provided in place of a mean. The arithmetic mean of the vector has been used.#> [1] 88.55799FECR(T1,T2,method = "Cabaret1")#> [1] 89.89805FECR(T1,T2,C1,C2,method = "Cabaret2")#> [1] 88.602FECR(T1,T2,C1,C2,method = "Cabaret2",compute.CI = TRUE)#> [1] 88.602 #> attr(,"CI") #> 2.5% 97.5% #> 87.35018 89.75919FECR(T1,T2,C1,C2,method = "MacIntosh1",compute.CI = TRUE)#> [1] 88.61238 #> attr(,"CI") #> 2.5% 97.5% #> 88.44445 88.76411T1 <- rpois(60,100);T1.mean<- mean(T1) T2 <- rpois(60,10);T2.mean<- mean(T2) C1 <- rpois(50,100);C1.mean<- mean(C1) C2 <- rpois(50,90);C2.mean<- mean(C2) FECR(T1,T2,C1,C2,method = "MacIntosh1")#> [1] 87.46709FECR(T1,T2,C1,C2,method = "MacIntosh1",compute.CI = TRUE)#> [1] 87.46709 #> attr(,"CI") #> 2.5% 97.5% #> 87.28565 87.64213T1 <- data.frame(id = rep(letters[9:18],each = 5), epg = do.call(c,lapply(1:10,\(x) rpois(5,65)))) T2 <- data.frame(id = rep(letters[9:18],each = 4), epg = do.call(c,lapply(1:10,\(x) rpois(4,15)))) C1 <- data.frame(id = rep(letters[1:8],each = 6), epg = do.call(c,lapply(1:8,\(x) rpois(6,70)))) C2 <- data.frame(id = rep(letters[1:8],each = 7), epg = do.call(c,lapply(1:8,\(x) rpois(7,65)))) FECR(T1,T2,C1,C2,method = "MacIntosh2",boot = 100)#> [1] 75.75135 #> attr(,"CI") #> 2.5% 97.5% #> 69.90758 80.42890