CochranDis: Cochran's Sample Size for discrete variables

Description Usage Arguments Details Value Author(s) Examples

View source: R/CochranDis.R

Description

Sample size for a discrete variable, according to Cochran's formula

Usage

1
CochranDis(alfa = 0.05, p, E, N = Inf, correct = FALSE)

Arguments

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)

Details

n <- Zalpha^2 * p * (1-p) / E^2

Value

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

Author(s)

Miguel Menéndez

Examples

1
size1 <- CochranDis(alfa = 0.05, p = 0.5, E = 0.1, N = 2000, correct = TRUE)

MiguelMenendezOrenga/usualsupport documentation built on April 11, 2020, 11:43 a.m.