Learn R Programming

rprev (version 0.2.4)

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:

raw_incidence

Vector of absolute incidence values for each included year of the registry, as generated using yearly_incidence.

ordered_diagnoses

Vector of times (days) between diagnosis date and the earliest date of inclusion in the registry, ordered shortest to longest.

smooth

Smooth fitted to the cumulative incidence data.

index_dates

Dates delimiting the years in which incidence is calculated.

mean

List containing mean incidence per 100K with confidence intervals. See mean_incidence_rate.

dof

Degrees of freedom of the smooth.

See Also

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

Examples

Run this code
# NOT RUN {
data(prevsim)

# }
# NOT RUN {
incidence(prevsim$entrydate, 1e6)

incidence(prevsim$entrydate, 1e6, start = "2004-01-30", num_reg_years = 9)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab