sim_Rs: Simulate R and R0

Description Usage Arguments Value Author(s) Examples

View source: R/simulate.R

Description

Simulation function for: R the number of people, out of n, that have been declared positive in the random sample, and among these ones, the ones that have been declared as infected before, i.e. R0.

Usage

1
sim_Rs(p, pi0, n, alpha0 = 0, alpha = 0, beta0 = 0, beta = 0, seed = NULL, ...)

Arguments

p

A numeric that provides the true poportion of proportion of people in this population who are positive.

pi0

A numeric that provides the proportion of people (in the whole population) who are positive, as measured through a non-random, but systematic sampling (e.g. based on medical selection).

n

A numeric that provides the sample size.

alpha0

A numeric that provides the False Negative (FN) rate for the sample R0. Default value is 0.

beta

A numeric that provides the False Positive (FP) rate for the sample R. Default value is 0.

seed

A numeric that provides the simulation seed. Default value is NULL.

...

Additional arguments.

Value

A list containing R, R0, pi0, n, alpha, alpha0, beta and beta0.

Author(s)

Stephane Guerrier

Examples

1
2
3
4
5
6
# Samples without measurement error
sim_Rs(p = 3/100, pi0 = 1/100, n = 1500, seed = 18)

# With measurement error
sim_Rs(p = 3/100, pi0 = 1/100, n = 1500, alpha0 = 0.01,
alpha = 0.01, beta0 = 0.05, beta = 0.05, seed = 18)

stephaneguerrier/CPreval documentation built on June 6, 2020, 2:28 a.m.