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.
test_homogeneity(
entry,
year_start = "01-01",
truncate_start = FALSE,
truncate_end = FALSE,
population_size = NULL,
df = 4,
proportion = 1e+05,
level = 0.95,
precision = 2
)
Vector of diagnosis dates for each patient in the registry in the format YYYY-MM-DD.
Date which to use to delimit years in the format MM-DD. See details for how this is used.
See details.
See details.
The population of the area covered by the registry. If not provided then only absolute incidence can be calculated.
The desired degrees of freedom of the smooth.
The denominator of the incidence rate.
The desired confidence interval width.
The number of decimal places required.
An S3 object of class incidence
with the following attributes:
Vector of absolute incidence values for each included year of the registry
Vector of times (days) between diagnosis date and the earliest date of inclusion in the registry, ordered shortest to longest.
Smooth fitted to the cumulative incidence data.
Dates delimiting the years in which incidence is calculated.
List containing absolute yearly incidence as well as relative rates.
p-values resulting to a test of over and under dispersion on the incidence data respectively. Used to test the suitability of the homogeneous Poission process assumption.
Degrees of freedom of the smooth.
Annual incidence rates are calculated for every year that is present in
entry
, with years being delimited by the date specified in year_start
that include every incident case.
For example, under the default values, if the earliest incident date in entry
is 1981-04-28, and the latest is 2016-12-16, then annual incidence rates will be
calculated with the boundaries [1981-01-01, 1982-01-01), ..., [2016-01-01, 2017-01-01).
If year_start
was specified as '09-01' then the boundaries would be
[1980-09-01, 1981-09-01), ..., [2016-09-01, 2017-09-01).
The truncate_start
and truncate_end
arguments remove incident
cases in the first and last years before and after the yearly boundaries
respectively.
So if they were both TRUE
, with year_start
as '09-01' as before, then the
boundaries would be [1981-09-01, 1982-09-01), ..., [2015-09-01, 2016-09-01),
i.e. the incident cases in [1981-04-28, 1981-09-01) are discarded by truncate_start
and those in [2016-09-01, 2016-12-16] removed by truncate_end
.
This helps to ensure that annual incidence is measured on a time-scale appropriate for your registry.
# NOT RUN {
data(prevsim)
# }
# NOT RUN {
test_homogeneity(prevsim$entrydate)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab