eggSim: Simulate and summarise egg reduction rate data

View source: R/eggSim.R

eggSimR Documentation

Simulate and summarise egg reduction rate data

Description

Simulate and summarise egg reduction rate data

Usage

eggSim(
  reduction,
  budget = 600,
  second_slide_cost = 0.621,
  max_screen = 0.9,
  community_mean = c(24, 48),
  cv_between = c(1.5),
  cv_within = 0.75,
  cv_slide = 0.25,
  cv_reduction = 0,
  true_prevalence = 1,
  count = TRUE,
  log_constant = if (count) 1 else 0,
  screen_threshold = 0,
  grams = 1/24,
  R = 10^3,
  design = c("NS", "NS2", "NS3", "SS", "SSR1", "SSR2", "SSR3"),
  summarise = TRUE,
  type = "gamma",
  parallelise = TRUE,
  max_vec = 5e+06
)

Arguments

reduction

The arithmetic mean reduction (may be vectorised)

budget

The total budget to use for each design

second_slide_cost

The cost of a second examination (e.g. Kato-Katz slide) from the same faecal sample, relative to the cost of an entirely independent sample

max_screen

The maximum proportion of the budget to use on screening

community_mean

A vector of arithmetic mean pre-treatment EPG in each community

cv_between

A vector of CV reflecting variation in EPG between individuals in each community

cv_within

Day-to-day variation in EPG within an individual

cv_slide

Variation between faecal samples from the same individual and day

cv_reduction

Variation in efficacy between individuals

true_prevalence

The true prevalence of infected individuals, i.e. one minus the zero inflation at individual level

count

Logical flag to base means on count data or the underlying rates

log_constant

A constant to add to the count data before calculating geometric means (ignored if count==FALSE)

screen_threshold

The threshold count on which to screen individuals

grams

The volume of faeces actually examined for eggs (1/24 grams is standard for Kato-Katz)

R

The number of replicate datasets

design

The survey design(s) to be examined

summarise

Should the simulation results be summarised?

type

One of gamma or lognormal - at present only the former is suppoered

parallelise

Option to parallelise simulations (can also be an integer giving the number of cores to use, or a cluster pre-created using the parallal package)

max_vec

The maximum number of data frame rows to use for vectorisation (affects memory usage)

Value

A data frame containing the simulated data

Examples

means <- eggSim(c(0.2,0.1), cv_reduction=0, R=10^2, design = c('NS','SS'), parallelise=FALSE)


ku-awdc/eggSim documentation built on Feb. 23, 2024, 10:22 p.m.