Skip to contents

Generate trajectories using the logic specified in the configuration

Usage

createTrajectories(
  cdm = NULL,
  studyEnv = NULL,
  trajectoryType = studyEnv$trajectoryType,
  runSavedStudy = studyEnv$runSavedStudy,
  oocFix = studyEnv$oocFix,
  outOfCohortAllowed = studyEnv$outOfCohortAllowed,
  lengthOfStay = studyEnv$lengthOfStay,
  stateCohortLabels = studyEnv$stateCohortLabels,
  stateCohortPriorityOrder = studyEnv$stateCohortPriorityOrder,
  stateSelectionType = studyEnv$stateSelectionType,
  stateCohortAbsorbing = studyEnv$stateCohortAbsorbing,
  stateCohortMandatory = studyEnv$stateCohortMandatory,
  allowedStatesList = studyEnv$allowedStatesList,
  useCDM = studyEnv$useCDM,
  pathToStudy = studyEnv$pathToStudy,
  batchSize = studyEnv$batchSize
)

Arguments

cdm

object created with CDMConnector

studyEnv

environment created with cohort2TrajectoryConfiguration

trajectoryType

The type of the trajectory ("Discrete" - Discrete time, "Continuous" - Continuous time)

runSavedStudy

running a predefined study from studyName/Settings/trajectorySettings.csv

oocFix

the method to use for replacing "OUT OF COHORT" states with more relevant states ("None" -> "OUT OF COHORT"; "Last present state" -> repeat the last one; random str -> used as state)

outOfCohortAllowed

boolean whether the patient trajectory can surpass the target cohort's observation-period

lengthOfStay

The length of stay (days) in one state (Effect only in discrete case)

stateCohortLabels

vector of the customized labels of the state cohorts

stateCohortPriorityOrder

vector of the customized labels of the state cohorts in priority order

stateSelectionType

the type of state selection ("First" - First occurring, "Overlap" - Max overlap, "Priority" - Priority)

stateCohortAbsorbing

vector of the customized labels of the state cohorts which are absorbing

stateCohortMandatory

vector of the customized labels of the state cohorts which are mandatory in trajectory

allowedStatesList

A list object which indicates accessible states from said state

useCDM

The package can also be run without the OMOP CDM

pathToStudy

path to directory that contains study folder

batchSize

customizable batch size for trajectory generation process

Value

dataframe with trajectories

Examples

if (FALSE) createTrajectories(cdm = cdm, runSavedStudy = F,studyEnv = studyEnv) # \dontrun{}