R/vartrack_samplesize_detect.R
vartrack_samplesize_detect.Rd
This function calculates the sample size needed for detecting the presence of a variant given a desired probability of detection and sampling strategy.
vartrack_samplesize_detect(
prob,
t = NA,
p_v1 = NA,
omega,
p0_v1 = NA,
r_v1 = NA,
c_ratio = 1,
sampling_freq
)
desired probability of detection
time step number (e.g., days) at which variant should be detected by. Default = NA (either 't'
or 'p_v1'
should be provided, not both)
the desired prevalence to detect a variant by. Default = NA (either 't'
or 'p_v1'
should be provided, not both)
probability of sequencing (or other characterization) success
initial variant prevalence (# introductions / infected population size)
logistic growth rate
coefficient of detection ratio, calculated as the ratio of the coefficients of variant 1 to variant 2. Default = 1 (no bias)
the sampling frequency (must be either 'xsect' or 'cont')
scalar of expected sample size
Other variant detection functions:
vartrack_prob_detect_cont()
,
vartrack_prob_detect_xsect()
,
vartrack_prob_detect()
,
vartrack_samplesize_detect_cont()
,
vartrack_samplesize_detect_xsect()
Other variant tracking functions:
vartrack_cod_ratio()
,
vartrack_prob_detect_cont()
,
vartrack_prob_detect_xsect()
,
vartrack_prob_detect()
,
vartrack_prob_prev_xsect()
,
vartrack_prob_prev()
,
vartrack_samplesize_detect_cont()
,
vartrack_samplesize_detect_xsect()
,
vartrack_samplesize_prev_xsect()
,
vartrack_samplesize_prev()
# Cross-sectional sampling
vartrack_samplesize_detect(p_v1 = 0.1, prob = 0.95, omega = 0.8,
c_ratio = 1, sampling_freq = 'xsect')
#> Calculating sample size for variant detection assuming single cross-sectional sample
#> [1] 35.54145
# Periodic sampling
vartrack_samplesize_detect(prob = 0.95, t = 30, omega = 0.8, p0_v1 = 1/10000,
r_v1 = 0.1, c_ratio = 1, sampling_freq = 'cont')
#> Calculating sample size for variant detection assuming periodic sampling
#> [1] 196.3915