precision.simulation: Simulate incubation period analyses with coarse data

View source: R/sampleSizeSimulation.R

precision.simulationR Documentation

Simulate incubation period analyses with coarse data

Description

These functions simulate coarse incubation period data sets and analyze them. The goal is for these simulations to provide evidence for how much information a given dataset contains about a characteristic of the incubation period distribution.

Usage

precision.simulation(
  N,
  med = 2,
  disp = 1.3,
  percentile = 0.5,
  nsim = 100,
  exact.data = FALSE,
  pct.type.A = 0.5,
  exp.win.dat = NULL,
  verb = FALSE
)

precision.simulation.exact(N, med, disp, percentile, nsim, verb)

precision.simulation.coarse(
  N,
  med,
  disp,
  percentile,
  nsim,
  pct.type.A,
  exp.win.dat,
  verb
)

generate.coarse.data(N, med, disp, pct.type.A, exp.win.dat)

Arguments

N

Overall sample size for the datasets to be simulated.

med

Median for the assumed log normal distribution of the incubation periods.

disp

Dispersion for the assumed log normal distribution of the incubation periods.

percentile

Percentile of the incubation period distribution which we want to estimate.

nsim

Number of datasets to analyze in the simulation.

exact.data

Either TRUE/FALSE. Incidates whether the data generated should be coarsened at all. If TRUE, pct.type.A and exp.win.dat are ignored.

pct.type.A

Percent of the N observations that are assumed to be type A data. If N*pct.type.A is not an integer, it will be rounded to the nearest integer.

exp.win.dat

A vector of exposure window lengths. Defaults to the observed window lengths from Lessler et al. (see below).

verb

If TRUE, a message with the system time and iteration number will be printed ten times during the simulation run.

Value

The precision.simulation functions return a matrix with four columns and nsim rows. The "ests" column gives the estimated percentiles for the incubation period distribution. The "SE" column gives the standard error for the estimate. The "conv" column is 1 if the doubly interval-censored likelihood maximization converged. Otherwise, it is 0. The "bias" column gives the estimated percentile - true percentile. The generate.coarse.data function returns a matrix with data suitable for analysis by the dic.fit function.


nickreich/coarseDataTools documentation built on July 8, 2023, 12:24 a.m.