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
)

Arguments

T1

pre-treatment mean epg (or vector of individual epg) of the treated group.

For `method = "MacIntosh2"`, a data.frame containing individual epg values of the treated group before treatment, with one or more value per individual. The data.frame must be in long format (one row per epg value) and include columns:

  • "id": character or factor indicating which individual the epg value is from.

  • "epg": numeric, the epg value.

T2

post-treatment mean epg (or vector of individual epg) of the treated group.

For `method = "MacIntosh2"`, a data.frame containing individual epg values of the treated group after treatment, with one or more value per individual. The data.frame must be in long format (one row per epg value) and include columns:

  • "id": character or factor indicating which individual the epg value is from.

  • "epg": numeric, the epg value.

C1

pre-treatment mean epg (or vector of individual epg) of the control group.

For `method = "MacIntosh2"`, a data.frame containing individual epg values of the control group before treatment, with one or more value per individual. The data.frame must be in long format (one row per epg value) and include columns:

  • "id": character or factor indicating which individual the epg value is from.

  • "epg": numeric, the epg value.

C2

post-treatment mean epg (or vector of individual epg) of the control group.

For `method = "MacIntosh2"`, a data.frame containing individual epg values of the control group after treatment, with one or more value per individual. The data.frame must be in long format (one row per epg value) and include columns:

  • "id": character or factor indicating which individual the epg value is from.

  • "epg": numeric, the epg value.

method

method to base the FECR calculation on:

  • "Kochapakdee"the ratio of pre- and post-treatment epg arithmetic means of the treated group

  • "Dash"the ratio of pre- and post-treatment epg arithmetic means of the treated group, correcting for the evolution of mean epg in the control group.

  • "Coles"the ratio of the treated and control post-treatment epg arithmetic means

  • "Cabaret1"the mean ratio of individual pre- and post-treatment epg of the treated group

  • "Cabaret2"the mean ratio of pre- and post-treatment epg of the treated group, correcting for the individual epg in the control group.

  • "MacIntosh1"Similar to Cabaret2, but update: now run for all pairs of Ts and Cs, to not require Ts and Cs to have the same length.

  • "MacIntosh2"Similar to MacIntosh1, but update: now compatible with multiple epg values per individuals. Does not require even sample size across T1,T2,C1, or C2).

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?

Value

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).

Details

for more information, cf. Cabaret & Berrag (2004) and the literature they refer to.

Examples

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.97253
FECR(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.83641
FECR(T2 = T2.mean,C2 = C2.mean,method = "Coles")
#> [1] 88.55799
FECR(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.55799
FECR(T1,T2,method = "Cabaret1")
#> [1] 89.89805
FECR(T1,T2,C1,C2,method = "Cabaret2")
#> [1] 88.602
FECR(T1,T2,C1,C2,method = "Cabaret2",compute.CI = TRUE)
#> [1] 88.602 #> attr(,"CI") #> 2.5% 97.5% #> 87.35018 89.75919
FECR(T1,T2,C1,C2,method = "MacIntosh1",compute.CI = TRUE)
#> [1] 88.61238 #> attr(,"CI") #> 2.5% 97.5% #> 88.44445 88.76411
T1 <- 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.46709
FECR(T1,T2,C1,C2,method = "MacIntosh1",compute.CI = TRUE)
#> [1] 87.46709 #> attr(,"CI") #> 2.5% 97.5% #> 87.28565 87.64213
T1 <- 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