Learn R Programming

SimInf (version 5.0.0)

prevalence: Prevalence

Description

Calculate the proportion of individuals with disease, or the proportion of nodes with individuals with disease, or the proportion of individuals with disease in each node.

Usage

prevalence(model, type = c("pop", "bnp", "wnp"), i = NULL, ...)

# S4 method for SIR prevalence(model, type = c("pop", "bnp", "wnp"), i = NULL, ...)

# S4 method for SISe prevalence(model, type = c("pop", "bnp", "wnp"), i = NULL, ...)

# S4 method for SISe3 prevalence(model, type, i, age = 1:3, ...)

# S4 method for SISe3_sp prevalence(model, type, i, age = 1:3, ...)

# S4 method for SISe_sp prevalence(model, type = c("pop", "bnp", "wnp"), i = NULL, ...)

Arguments

model

The model to calculated the prevalence from.

type

The type of prevalence measure to calculate: 'pop' (default) calcalates the proportion of the individuals in the population that have disease (model specific) at each time point in tspan, 'bnp' calculates the between-node prevalence, and 'wnp' calculates the within-node prevalence.

i

Indices specifying the nodes to include in the calculation of the prevalence. Default is NULL, which includes all nodes.

...

Additional arguments affecting the measure

age

For models with age categories, the age category to include in the calculation. Default is that all age categories are included.

Value

Vector when type equals 'pop' or 'bnp' but matrix when type equals 'wnp'.