## EXAMPLE 1:
## A cross-sectional study is to be carried out to confirm the absence of
## disease using risk based sampling. Assume a design prevalence of 0.02
## at the cluster (herd) level and a design prevalence of 0.10 at the
## surveillance unit (individual) level. Clusters are categorised as
## being either high, medium or low risk with the probability of disease for
## clusters in the high and medium risk area 5 and 3 times the probability of
## disease in the low risk area. The proportions of clusters in the high,
## medium and low risk area are 0.10, 0.20 and 0.70, respectively. The
## proportion of samples from the high, medium and low risk area will be
## 0.40, 0.40 and 0.20, respectively.
## Surveillance units (individuals) are categorised as being either high or
## low risk with the probability of disease for units in the high risk group
## 4 times the probability of disease in the low risk group. The proportions
## of units in the high and low risk groups are 0.10 and 0.90, respectively.
## All of your samples will be taken from units in the high risk group.
## You intend to use a test with diagnostic sensitivity of 0.95 and you'd
## like to take sufficient samples to be 95% certain that you've detected
## disease at the population level, 95% certain that you've detected disease
## at the cluster level and 95% at the surveillance unit level. How many
## clusters and how many units need to be sampled to meet the requirements
## of the study?
rsu.sssep.rb2st2rf(
rr.c = c(5,3,1), ppr.c = c(0.1,0.2,0.7), spr.c = c(0.4,0.4,0.2),
pstar.c = 0.02, se.c = 0.95,
rr.u = c(4,1), ppr.u = c(0.1, 0.9), spr.u = c(1,0),
pstar.u = 0.10, se.u = 0.90,
se.p = 0.95)
## A total of 82 clusters needs to be sampled: 33 from the high risk area,
## 33 from the medium risk area and 16 from the low risk area. A total of
## 10 surveillance units should be sampled from each cluster.
Run the code above in your browser using DataLab