Learn R Programming

bayescount (version 0.9.0-7)

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. MCMC output is also used to provide inference for the drug efficacy in each individual animal, the prevalence of egg shedding (one minus zero-inflation) and the change in variability between egg counts after treatment. 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. 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, restrict.efficacy = TRUE, 
   zero.inflation = FALSE, divide.data = 1, record.chains = FALSE, 
   write.file = FALSE, bootstrap.iters=10000, plot.graph = TRUE, 
   skip.mcmc = FALSE, individual.analysis=TRUE, ...)

Arguments

Value

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

See Also

bayescount, bayescount.single, autorun.jags

Examples

Run this code
fecrt("test", pre.data=rnbinom(10, mu=10, size=1), post.data=rnbinom(10, mu=1, size=1))

Run the code above in your browser using DataLab