Learn R Programming

rprev (version 0.2.3)

incidence: Summarise disease incidence.

Description

Calculates incidence by year of the registry data, along with mean incidence with confidence intervals. A smoothed cumulative incidence function is fit to the data for inspecting deviations in the registry data from a homogeneous Poisson process.

Usage

incidence(entry, population_size, start = NULL, num_reg_years = NULL, df = 6, precision = 2, level = 0.95)

Arguments

entry
Vector of diagnosis dates for each patient in the registry in the format YYYY-MM-DD.
population_size
Integer corresponding to the size of the population at risk.
start
Date from which incident cases are included in the format YYYY-MM-DD. Defaults to the earliest entry date.
num_reg_years
The number of years of the registry for which incidence is to be calculated. Defaults to using all available complete years.
df
The desired degrees of freedom of the smooth.
precision
The number of decimal places required.
level
The desired confidence interval width.

Value

An S3 object of class incidence with the following attributes:

See Also

Other incidence functions: incidence_age_distribution, mean_incidence_rate, plot.incidence, raw_incidence, test_incidence_fit, yearly_incidence

Examples

Run this code
data(prevsim)

## Not run: 
# incidence(prevsim$entrydate, 1e6)
# 
# incidence(prevsim$entrydate, 1e6, start = "2004-01-30", num_reg_years = 9)
# ## End(Not run)

Run the code above in your browser using DataLab