Learn R Programming

rprev (version 0.2.3)

yearly_incidence: Disease incidence.

Description

Calculates yearly incidence for the available registry data.

Usage

yearly_incidence(entry, start_date = NULL, num_years = NULL, end_date = NULL)

Arguments

entry
Vector of diagnosis dates for each patient in the registry in the format YYYY-MM-DD.
start_date
The initial date in the entry vector to start estimating incidence from.
num_years
The number of complete years to calculate incidence over. Defaults to the number of complete years of registry data available in entry.
end_date
The ending date in the entry vector to estimate incidence counting back from. If both end_date and start_date are specified then start_date takes precedence.

Value

Vector of length num_years of integers, representing the number of absolute incidence values for each included year of the registry.

See Also

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

Examples

Run this code
data(prevsim)

yearly_incidence(prevsim$entrydate, start_date="2004-01-01", num_years=8)
yearly_incidence(prevsim$entrydate)
yearly_incidence(prevsim$entrydate, start_date="2005-05-01", num_years=5)
yearly_incidence(prevsim$entrydate, start_date="2005-05-01")
yearly_incidence(prevsim$entrydate, num_years=5, end_date="2015-05-01")

Run the code above in your browser using DataLab