## EXAMPLE 1:
## A cross-sectional study is to be carried out to quantify the association
## between farm management type (intensive, extensive) and evidence of
## Q fever in dairy goat herds. The investigators would like to be 0.80 sure
## of being able to detect when the risk ratio of Q fever is 2.0 for
## intensively managed herds, using a 0.05 significance test. Previous evidence
## suggests that the prevalence of Q fever in extensively managed dairy goat
## herds is 5 per 100 herds at risk and the prevalence of intensively managed
## herds in the population (the prevalence of exposure) is around 0.20.
## Assuming equal numbers of intensively managed and extensively managed
## herds will be sampled, how many herds need to be enrolled into the study?
## You estimate that there are around 60 dairy goat herds in your study area.
pdexp1 = 2.0 * (5 / 100); pdexp0 = 5 / 100
epi.ssxsectn(N = 60, pdexp1 = pdexp1, pdexp0 = pdexp0, pexp = 0.20, n = NA,
power = 0.80, r = 1, design = 1, sided.test = 2,
nfractional = FALSE, conf.level = 0.95)
## A total of 58 of the 60 herds need to be enrolled into the study
## (29 intensively managed and 29 extensively managed herds).
## EXAMPLE 2:
## Say, for example, we're only able to enrol 45 herds into the study
## described above. What is the minimum and maximum detectable prevalence
## ratio and minimum and maximum detectable odds ratio?
epi.ssxsectn(N = 60, pdexp1 = NA, pdexp0 = pdexp0, pexp = 0.20, n = 45,
power = 0.80, r = 1, design = 1, sided.test = 2,
nfractional = FALSE, conf.level = 0.95)
## The minimum detectable prevalence ratio >1 is 3.64. The maximum detectable
## prevalence ratio <1 is 0.
## The minimum detectable odds ratio >1 is 4.65. The maximum detectable
## odds ratio <1 is 0.
Run the code above in your browser using DataLab