## EXAMPLE 1:
## A cross-sectional study is to be carried out to confirm the absence of
## disease using risk based sampling. Assume a population level design
## prevalence of 0.10 and there are 'high', 'medium' and 'low' risk areas
## where the risk of disease in the high risk area compared with the low risk
## area is 5 and the risk of disease in the medium risk area compared with
## the low risk area is 3. The proportions of the population at risk in the
## high, medium and low risk area are 0.10, 0.10 and 0.80, respectively.
## Half of your samples will be taken from individuals in the high risk area,
# 0.30 from the medium risk area and 0.20 from the low risk area. You intend
## to use a test with diagnostic sensitivity of 0.90 and you'd like to take
## sufficient samples to return a population sensitivity of 0.95. How many
## units need to be sampled to meet the requirements of the study?
rsu.sssep.rbsrg(pstar = 0.10, rr = c(5,3,1), ppr = c(0.10,0.10,0.80),
spr = c(0.50,0.30,0.20), se.p = 0.95, se.u = 0.90)
## A total of 14 units needs to be sampled to meet the requirements of the
## study: 7 from the high risk area, 4 from the medium risk area and 3 from
## the low risk area.
Run the code above in your browser using DataLab