design_means: Calculate the mean egg counts/rates according to various...

View source: R/design_means.R

design_meansR Documentation

Calculate the mean egg counts/rates according to various design types

Description

Calculate the mean egg counts/rates according to various design types

Usage

design_means(
  simdata,
  design = c("NS1", "NS2", "NS3", "SS", "SSR1", "SSR2", "SSR3"),
  budget = 600,
  second_slide_cost = 0.621,
  max_screen = 0.9,
  count = TRUE,
  log_constant = if (count) 1 else 0,
  screen_threshold = 0
)

Arguments

simdata

The data as simulated by cgpDataSim or clpDataSim

design

The survey design(s) to be examined

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

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

Value

A data frame of summary statistics

Examples

data <- cgpDataSim(10^2, 600, 0.1, 100, 1, 1, 1, 0, true_prevalence=0.8)
means <- design_means(data, second_slide_cost = c(0.1, 0.621, 1))
library("dplyr")
means %>%
  group_by(Design, SecondSlideCost) %>%
  summarise(N = mean(N), Budget = mean(ScreenBudget + SampleBudget),
    Bias = median(ArithmeticEfficacy - TrueArithmetic),
    SD = sd(ArithmeticEfficacy - TrueArithmetic))


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