simData1s.Rd
Simulates (zero-inflated) egg count data
simData1s(n = 10, mean = 500, kappa = 0.5, phi = 1, f = 50, rounding = TRUE, seed = NULL)
n | positive integer. Sample size. |
---|---|
mean | numeric. True number of eggs per gram (epg). |
kappa | numeric. Overdispersion parameter, \(\kappa \to \infty\) corresponds to Poisson distribution. |
phi | numeric. Prevalence, i.e. proportion of infected animals, between 0 and 1. |
f | positive integer. Correction factor of the egg counting technique, either an integer or a vector of integers with length |
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, see Details. |
seed | integer. Random seed. |
A data.frame with three columns, namely the observed epg (obs
), actual number of eggs counted (master
) and
true epg in the sample (true
).
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 bias overall when \(\mu\) < 150. Set rounding = FALSE
for not to have any bias in the simulated counts.
fec_stan
for analyzing faecal egg count data with one sample
fec <- simData1s(n = 10, mean = 500, kappa = 0.5, phi = 0.7)