Learn R Programming

surveillance (version 1.20.3)

imdepifit: Example twinstim Fit for the imdepi Data

Description

data("imdepifit") is a twinstim model fitted to the imdepi data.

Usage

data("imdepifit")

Arguments

Format

an object of class "twinstim"

See Also

common methods for "twinstim" fits, exemplified using imdepifit, e.g., summary.twinstim, plot.twinstim, and simulate.twinstim

Examples

Run this code
data("imdepi", "imdepifit")

if (FALSE) {
## reproduce "imdepifit"
myimdepifit <- twinstim(
    endemic = addSeason2formula(~ offset(log(popdensity)) + I(start/365-3.5),
                                S = 1, period = 365, timevar = "start"),
    epidemic = ~ type + agegrp, siaf = siaf.gaussian(),
    data = imdepi, subset = !is.na(agegrp),
    optim.args = list(control = list(reltol = sqrt(.Machine$double.eps))),
    ## the historical default for reltol is 1e-6, which is rather large
    model = FALSE, cumCIF = FALSE
)
stopifnot(all.equal(imdepifit, myimdepifit))
}

Run the code above in your browser using DataLab