Description Usage Arguments Details Value Author(s) Examples
Sample size for a discrete variable, according to Cochran's formula
1 | CochranDis(alfa = 0.05, p, E, N = Inf, correct = FALSE)
|
alfa |
numeric, alfa error to use |
p |
numeric, estimated prevalence in population, 1 as whole (fo instance, 50 |
E |
numeric, Measurement Error, 1 as whole (for instance, 10 |
N |
numeric, Size of the study population |
correct |
logical, if set to TRUE, it will check if the internally computed sample size is 5 per cent or bigger than the whole population, if this is the case, it will correct the sample size according to the formula n / (1 + n/N) |
n <- Zalpha^2 * p * (1-p) / E^2
A list containing:
n |
numeric value with the sample size estimated for Measurement Error choosen. This value, rounded, is the only printed output |
Error |
numeric value of Measurement Error as it was set with 'E' argument |
alfa |
numeric value of alfa error as it was set with 'alfa' argument |
p |
numeric value of estimated prevalence as it was set with 'p' argument |
Evect |
vector of numeric values, with different alternative values of Measurement Error |
nvector |
vector of numeric values, with different alternative values of sample size estimated for the Evect values |
Miguel Menéndez
1 | size1 <- CochranDis(alfa = 0.05, p = 0.5, E = 0.1, N = 2000, correct = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.