Learn R Programming

bayescount (version 0.9.9-1)

fecrt: Analyse FECRT Data Using Mcmc to Give a Probability Distribution of Values for the Mean Egg Count Reduction

Description

This function applies a Bayesian [zero-inflated] gamma Poisson (negative binomial) model to faecal egg count reduction test (FECRT) data to return possible values for the mean drug efficacy. Pre-treatment data are assumed to arise from either a gamma-Poisson or zero-inflated gamma-Poisson distribution, with post-treatment data described by a separate gamma-Poisson or zero-inflated gamma-Poisson distribution. The change in mean between these distributions is therefore the mean egg count reduction. If paired.model=TRUE, a slightly different formulation is used whereby the observed count pre-treatment is assumed to follow a compound gamma-gamma-Poisson distribution with the variability within and between animals separated. The post treatment mean for each animal is derived from the pre-treatment animal mean and FEC reduction. This formulation allows data with non-random missing post-treatment counts to be analysed correctly, and also allows data with repeat counts from an individual to be analysed - providing a method of increasing the power of the method substantially. Results are also obtained using non-parametric bootstrapping and the method advocated in the 1992 World Association for the Advancement of Veterinary Parasitology (W.A.A.V.P.) methods for the detection of anthelmintic resistance in nematodes of veterinary importance (unless the data contains repeat values or missing values). Confidence intervals for the relevant statistics are printed to file if write.file = TRUE, and returned using a custom print method.

Lower level running of JAGS and assessing the simulation for convergence and required run length is done using autorun.jags. Note: The GUI interface for R in Windows may not continually refresh the output window, making it difficult to track the progress of the simulation (if silent.jags is FALSE). To avoid this, you can run the function from the terminal version of R (located in the Program Files/R/bin/ folder).

*THIS SOFTWARE IS INTENDED FOR EDUCATIONAL PURPOSES ONLY AND SHOULD NOT BE RELIED UPON FOR REAL WORLD APPLICATIONS*

Usage

fecrt(name = NA, pre.data = NA, post.data = NA,
   data = list(pre=pre.data, post=post.data), animal.names = FALSE, 
   efficacy=95, confidence=95, restrict.efficacy = TRUE, 
   control.animals = FALSE, paired.model = FALSE, zero.inflation = FALSE, 
   divide.data = 1, record.chains = FALSE, write.file = FALSE, 
   bootstrap.iters=10000, plot.graph = TRUE, skip.mcmc = FALSE, ...)

Arguments

Value

Returns a list of the results obtained using each method, printed using a custom print method.

References

M. J. Denwood, S. W. J. Reid, S. Love, M. K. Nielsen, L. Matthews, I. J. McKendrick, and G. T. Innocent. Comparison of three alternative methods for analysis of equine Faecal Egg Count Reduction Test data. Prev. Vet. Med. (2009), doi:10.1016/j.prevetmed.2009.11.009

See Also

fecrt.power and fecrt.power.limits for power analysis methods for the FECRT, bayescount, autorun.jags