## The expected prevalence of disease in a population of cattle is 0.10.
## We wish to conduct a survey, sampling 50 animals per farm. No data
## are available to provide an estimate of rho, though we suspect
## the intra-cluster correlation for this disease to be relatively high.
## We wish to be 95\% certain of being within 10\% of the true population
## prevalence of disease. How many herds should be sampled?
p <- 0.10; b <- 50; D <- 7
rho <- (D - 1) / (b - 1)
epi.clustersize(p = 0.10, b = 50, rho = rho, epsilon.r = 0.10,
conf.level = 0.95)
## We need to sample 485 herds (24250 samples in total).Run the code above in your browser using DataLab