get_attrition {visR} | R Documentation |
Generate cohort attrition table
Description
This is an experimental function that may be developed over time.
This function calculates the subjects counts excluded and included for each step of the cohort selection process.
Usage
get_attrition(data, criteria_descriptions, criteria_conditions,
subject_column_name)
Arguments
data |
Dataframe. It is used as the input data to count the subjects that meets the criteria of interest |
criteria_descriptions |
|
criteria_conditions |
|
subject_column_name |
|
Details
criteria_descriptions and criteria_conditions need to be of same length
Value
The counts and percentages of the remaining and excluded subjects for each step of the cohort selection in a table format.
Examples
visR::get_attrition(adtte,
criteria_descriptions =
c(
"1. Placebo Group", "2. Be 75 years of age or older.",
"3. White", "4. Site 709"
),
criteria_conditions = c(
"TRTP=='Placebo'", "AGE>=75",
"RACE=='WHITE'", "SITEID==709"
),
subject_column_name = "USUBJID"
)