generateSequenceCohortSet {CohortSymmetry}R Documentation

Intersecting the index and marker cohorts prior to calculating Sequence Symmetry Ratios

Description

Join two tables in the CDM (one for index and the other for marker cohorts) into a new table in the cdm taking into account the maximum time interval between events. Index and marker cohorts should be instantiated in advance by the user.

Usage

generateSequenceCohortSet(
  cdm,
  indexTable,
  markerTable,
  name,
  cohortDateRange = as.Date(c(NA, NA)),
  indexId = NULL,
  markerId = NULL,
  daysPriorObservation = 0,
  washoutWindow = 0,
  indexMarkerGap = NULL,
  combinationWindow = c(0, 365)
)

Arguments

cdm

A CDM reference.

indexTable

A table in the CDM that the index cohorts should come from.

markerTable

A table in the CDM that the marker cohorts should come from.

name

The name within the cdm that the output is called. Default is joined_cohorts.

cohortDateRange

Two dates indicating study period and the sequences that the user wants to restrict to.

indexId

Cohort definition IDs in indexTable to be considered for the analysis. Change to NULL if all indices are wished to be included.

markerId

Cohort definition IDs in markerTable to be considered for the analysis. Change to NULL if all markers are wished to be included.

daysPriorObservation

The minimum amount of prior observation required on both the index and marker cohorts per person.

washoutWindow

A washout window to be applied on both the index cohort event and marker cohort.

indexMarkerGap

The maximum allowable gap between the end of the first episode and the start of the second episode in a sequence/combination.

combinationWindow

A constrain to be placed on the gap between two initiations. Default c(0,365), meaning the gap should be larger than 0 but less than or equal to 365.

Value

A table within the cdm reference.

Examples


library(CohortSymmetry)
cdm <- mockCohortSymmetry()
cdm <- generateSequenceCohortSet(
  cdm = cdm,
  name = "joined_cohorts",
  indexTable = "cohort_1",
  markerTable = "cohort_2"
)
 cdm$joined_cohorts
 CDMConnector::cdmDisconnect(cdm = cdm)


[Package CohortSymmetry version 0.1.2 Index]