Learn R Programming

PatientProfiles (version 1.4.2)

addDeathFlag: Add flag for death for individuals. Only death within the same observation period than `indexDate` will be observed.

Description

Add flag for death for individuals. Only death within the same observation period than `indexDate` will be observed.

Usage

addDeathFlag(
  x,
  indexDate = "cohort_start_date",
  censorDate = NULL,
  window = c(0, Inf),
  deathFlagName = "death",
  name = NULL
)

Value

table x with the added column with death information added.

Arguments

x

Table with individuals in the cdm.

indexDate

Variable in x that contains the window origin.

censorDate

Name of a column to stop followup.

window

window to consider events over.

deathFlagName

name of the new column to be added.

name

Name of the new table, if NULL a temporary table is returned.

Examples

Run this code
# \donttest{
cdm <- mockPatientProfiles()

cdm$cohort1 |>
  addDeathFlag()

mockDisconnect(cdm = cdm)
# }

Run the code above in your browser using DataLab