Description Usage Arguments Value Examples
This is what the function does bla bla bla.
1 2 | calculate_prevalence(data, pops = NULL, conf.level = 0.95,
region.head = "region", scale = 1)
|
data |
A line list-type data frame (one line per case), including a column with the region in which the case occurred |
pops |
A data frame containing one line per region in |
conf.level |
Level of confidence interval required for prevalence estimates. |
region.head |
A string containing the name of the column specifying the region for each case |
scale |
Scaling with which to report prevalence (per head, per 100 000, etc.) |
A data frame containing total population, number of cases and prevalence by region
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | my.data <- data.frame(county.id = ceiling(3*runif(10)),
age = rlnorm(10),
sex = factor(floor(2*runif(10)), levels=c(0,1), labels=c("male", "female"))
)
my.populations <- data.frame(county.id = 1:3,
population = c(10, 50, 100)
)
# example without population of each region
calculate_prevalence(my.data, region.head="county.id")
# example with populations
calculate_prevalence(my.data, region.head="county.id", pops=my.populations)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.