Learn R Programming

eggCounts (version 1.4)

simData1s: Simulate faecal egg count data (1-sample situation)

Description

Simulates (zero-inflated) egg count data

Usage

simData1s(n = 10, mean = 500, kappa = 0.5, phi = 1, f = 50, rounding = TRUE)

Arguments

n

sample size (number of faeces collected)

mean

true number of eggs per gram (epg)

kappa

overdispersion parameter, \(\kappa \to \infty\) corresponds to Poisson

phi

prevalence i.e. proportion of infected animals, between 0 and 1

f

correction factor of the egg counting technique, either an integer or a vector of integers with length n

rounding

logical. If true, the Poisson mean for the raw counts is rounded. The rounding applies since the mean epg is frequently reported as an integer value. For more information, please see Details.

Value

A matrix with three columns, namely the observed epg (obs), number of eggs counted on the McMaster slide (master) and true egg counts (true).

Details

The simulation process does not exactly match the proposed models in [ref:paper], however the simulated data resembles the data observed in real world.

In the simulation of raw (master) counts, it follows a Poisson distribution with some mean. The mean is frequently rounded down if it has a very low value and rounding = TRUE, hence there expects to be a negative bias overall when \(\mu\) < 150. Set rounding = FALSE if one does not wish to have any bias in the simulated counts.

See Also

fec_stan for analyzing faecal egg count data with one sample

Examples

Run this code
# NOT RUN {
fec <- simData1s(n=10, mean=500, kappa=0.5, phi=0.7)
# }

Run the code above in your browser using DataLab