get_attrition: Generate cohort attrition table

View source: R/get_attrition.R

get_attritionR Documentation

Generate cohort attrition table

Description

[Questioning] 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

character It contains the descriptions of the inclusion/exclusion criteria. Each element of the vector corresponds to the description of each criterion.

criteria_conditions

character It contains the corresponding conditions of the criteria. These conditions will be used in the table to compute the counts of the subjects.

subject_column_name

character The column name of the table that contains the subject id.

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"
)

visR documentation built on Nov. 21, 2023, 1:07 a.m.