sample_s {RCMsize} | R Documentation |
Sample Size Calculation
Description
Estimates the required sample size so that the confidence interval width for SCR does not exceed a specified limit.
Usage
sample_s(
SCR,
RL,
SRR,
ages,
A_max,
limits,
max_iter = 10000,
conf.level = 0.95,
method = "asymptotic"
)
Arguments
SCR |
Seroconversion rate. |
RL |
Desired relative width. |
SRR |
Seroreversion rate. |
ages |
Vector with the proportions of different ages in the population (age structure). |
A_max |
Maximum age considered in the population. |
limits |
Lower and upper limits for the calculation of |
max_iter |
Maximum number of iterations. |
conf.level |
Confidence level (default is 0.95). |
method |
Method for calculating the confidence interval. Available methods: "waldcc" and the methods in IC_SP documentation. |
Details
**Disclaimer**: The sample size function may not produce accurate values for scenarios involving extremely low SCR (e.g., elimination scenarios). Users are advised to exercise caution and consider the results critically when applying this function to such cases.
Value
A list with the required sample size, the confidence interval for
seroprevalence, and the confidence interval for SCR
.
Examples
A_max <- 80
age_distribution <- rep(1 / A_max, A_max)
sample_s(0.03, 1, 0.01, age_distribution, A_max, limits = c(0, 1))