Learn R Programming

CohortSymmetry (version 0.2.4)

summariseTemporalSymmetry: Summarise temporal symmetry

Description

Using generateSequenceCohortSet to obtain temporal symmetry (aggregated counts) of two cohorts.

Usage

summariseTemporalSymmetry(cohort, cohortId = NULL, timescale = "month")

Value

An aggregated table with difference in time (marker - index) and the relevant counts.

Arguments

cohort

A cohort table in the cdm.

cohortId

The Ids in the cohort that are to be included in the analyses.

timescale

Timescale for the x axis of the plot (month, day, year).

Examples

Run this code
# \donttest{
library(CohortSymmetry)
cdm <- mockCohortSymmetry()
cdm <- generateSequenceCohortSet(cdm = cdm,
                                 name = "joined_cohorts",
                                 indexTable = "cohort_1",
                                 markerTable = "cohort_2")
temporal_symmetry <- summariseTemporalSymmetry(cohort = cdm$joined_cohorts)
CDMConnector::cdmDisconnect(cdm)
# }

Run the code above in your browser using DataLab