relR_samplesize_simsolve {phylosamp} | R Documentation |
Calculate optimized sample size for detecting differential transmission
Description
Function to calculate optimized sample size by solving the transcendental equation that occurs when you replace the R values with ones that account for sensitivity and specificity.
Usage
relR_samplesize_simsolve(
R_a,
R_b,
p_a,
N,
alpha = 0.05,
alternative = c("two_sided", "less", "greater"),
power = 0.8,
sensitivity = 1,
specificity = 1,
overdispersion = NULL,
epsilon = 0.01,
nsims = 1e+05,
tolerance = 10
)
Arguments
R_a |
Numeric (Positive). The assumed R among the group in the denominator of the ratio. Input value must be greater than 0. |
R_b |
Numeric (Positive). The assumed R among the group in the numerator of the ratio. Input value must be greater than 0. |
p_a |
Numeric. The proportion of the population in group |
N |
Numeric (Positive). The size of the infected pool. Only one of
|
alpha |
Numeric. The desired alpha level. Default: 0.05 |
alternative |
Character. Specifies the alternative hypothesis.
Must be: |
power |
Numeric. The desired power. Must be a value between 0 and 1. Default: 0.8. |
sensitivity |
Numeric. The sensitivity of the linkage criteria. Must be between 0 and 1. Default: 1. |
specificity |
Numeric. The specificity of the linkage criteria. Must be between 0 and 1. Default: 1. |
overdispersion |
Numeric (Positive). An overdispersion parameter, set
if the assumed distribution of the number of edges is negative binomial.
If |
epsilon |
Numeric. Dictates the minimum value for |
nsims |
Dictates the number of simulations for each power simulation. Default: 100000 |
tolerance |
Dictates the tolerance for the binary search. Default: 10. |
Value
Simulated sample size needed achieve desired type I and II error rates under assumptions. Will return NA and throw a warning if impossible.