counted_prevalence {rprev} | R Documentation |
Count prevalence from registry data.
Description
Counts contribution to prevalence at a specific index from each year of a registry. A person is included as contributing to disease prevalence if they are incident within the specified time-span, and are either alive or censored at the index date. The rationale for including censored cases in prevalence estimation is that such cases have typically been lost to follow-up, and are often more likely to have been alive at the index date than not.
Usage
counted_prevalence(formula, index, data, start_date, status_col)
Arguments
formula |
A formula of the form <event date column> ~ <entry date column>. |
index |
The date at which to estimate point prevalence as a string in the format YYYY-MM-DD. |
data |
A data frame with the corresponding column names provided in
|
start_date |
The initial date to start counting prevalence from as a |
status_col |
The name of the column holding a binary indicator variable of whether the individual experienced an event at their event time or was censored. |
Value
The number of prevalent cases at the specified index date as a single integer.