## EXAMPLE 1:
## You are working with a population that is comprised of indviduals in
## 'high' and 'low' risk area. There are 300 individuals in the high risk
## area and 1200 individuals in the low risk area. The risk of disease for
## those in the high risk area is assumed to be three times that of the low
## risk area.
C <- c(300,1200)
pstar.c <- 0.01
rr <- c(3,1)
## Generate population sensitivity values for clusters in each component of
## the surveillance system. Each of the three dataframes below lists id,
## rg (risk group) and cse (component sensitivity):
comp1 <- data.frame(id = 1:100,
rg = c(rep(1,time = 50), rep(2, times = 50)),
cse = rep(0.5, times = 100))
comp2 <- data.frame(id = seq(from = 2, to = 120, by = 2),
rg = c(rep(1, times = 25), rep(2, times = 35)),
cse = runif(n = 60, min = 0.5, max = 0.8))
comp3 <- data.frame(id = seq(from = 5, to = 120, by = 5),
rg = c(rep(1, times = 10), rep(2, times = 14)),
cse = runif(n = 24, min = 0.7, max = 1))
# Combine the three components into a list:
se.c <- list(comp1, comp2, comp3)
## What is the overall population-level (surveillance system) sensitivity?
rsu.sep.rsmult(C = C, pstar.c = pstar.c, rr = rr, ppr = NA, se.c = se.c)
## The overall adjusted system sensitivity (calculated using the binomial
## distribution) is 0.85.
## EXAMPLE 2:
## Assume that you don't know exactly how many individuals are in the high
## and low risk areas but you have a rough estimate that the proportion of
## the population in each area is 0.2 and 0.8, respectively. What is the
## population-level (surveillance system) sensitivity?
ppr <- c(0.20,0.80)
rsu.sep.rsmult(C = NA, pstar.c = pstar.c, rr = rr, ppr = ppr, se.c = se.c)
## The overall adjusted system sensitivity (calculated using the binomial
## distribution) is 0.85.
Run the code above in your browser using DataLab