Description Usage Arguments See Also Examples
Models the (age-dependent) force of infection using non-linear models, given input parameters and the specification of a model (see arguments).
1 | NonLinearModels(data, parameters, fun)
|
data |
Contains all input parameters: Age describes the population's age categories, Pos represents the number of seropositive individuals by age category, and Tot are the total number of individuals in each specified age category. |
parameters |
Specifies the parameters used in the non-linear force of infection equation: λ(a) = (aα - γ)e^{-aβ} + γ, where gamma is the long-term residual value of the force of infection (Farrington et al., 1990). In order to ensure that the force of infection satisfies λ(a) ≥ 0, the parameter space is constrained to be non-negative. |
fun |
This specifies which non-linear model for the force of infection you want to use: FarringtonABG is Farrington's model where alpha, beta, and gamma are used as model parameters, FarringtonAB_G is an alternative simplified model in which gamma is kept as a fixed parameter and alpha and beta are the model parameters that are estimated. |
Farrington, C. P. (1990). Modelling forces of infection for measles, mumps and rubella, 9(8), 953-967.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Load UK's Rubella data from '86-'87
data("Rubella_UK_8687")
# Prepare the data
data <- list(Tot=(Rubella_UK_8687$Pos+Rubella_UK_8687$Neg),
Pos=Rubella_UK_8687$Pos, Age=Rubella_UK_8687$Age)
# Prepare the parameters
params <- list(alpha=0.07, beta=0.1, gamma=0.03)
# Farrington's model, with alpha, beta, and gamma as starting values for MLE
result <- NonLinearModels(data, params, FarringtonABG)
summary(result)
# Farrington's model, with alpha and beta as starting values for MLE, and gamma as a fixed parameter
params <- list(alpha=0.07, beta=0.1, gamma=0)
result <- NonLinearModels(data, params, FarringtonAB_G)
summary(result)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.