Class for handling cohort tables in a CDM database. Inherits from CDMdbHandler.
Super class
HadesExtras::CDMdbHandler -> CohortTableHandler
Active bindings
cohortDatabaseSchemaSchema where cohort tables are stored
cohortTableNamesNames of the cohort tables in the database
incrementalFolderPath to folder for incremental operations
cohortDefinitionSetSet of cohort definitions
cohortGeneratorResultsResults from cohort generation process
cohortDemograpicsDemographic information for cohorts
cohortsOverlapInformation about overlapping cohorts
Methods
Method new()
Initialize the CohortTableHandler object
Usage
CohortTableHandler$new(
connectionHandler,
databaseId,
databaseName,
databaseDescription,
cdmDatabaseSchema,
vocabularyDatabaseSchema = cdmDatabaseSchema,
cohortDatabaseSchema,
cohortTableName,
loadConnectionChecksLevel = "allChecks"
)Arguments
connectionHandlerThe connection handler object.
databaseIdA text id for the database the it connects to
databaseNameA text name for the database the it connects to
databaseDescriptionA text description for the database the it connects to
cdmDatabaseSchemaName of the CDM database schema.
vocabularyDatabaseSchemaName of the vocabulary database schema. Default is the same as the CDM database schema.
cohortDatabaseSchemaName of the cohort database schema.
cohortTableNameName of the cohort table.
loadConnectionChecksLevel(Optional) Level of checks to perform when loading the connection (default is "allChecks")
loadConnection
Method loadConnection()
Reloads the connection with the initial setting and updates connection status
insertOrUpdateCohorts
Method insertOrUpdateCohorts()
If there is no cohort with the same cohortId it is added to the cohortDefinitionSet, If there is a cohort with the same cohortId, the cohort is updated in the cohortDefinitionSet CohortDefinitionSet is generated and demographics is updated for only the cohorts that have changed
Method getCohortsSummary()
Retrieves the summary of cohorts including cohort start and end year histograms and sex counts.
Method getNumberOfOverlappingSubjects()
Retrieves the number of subjects that are overlapping between two given cohorts.
Method getSexFisherTest()
Compares the proportion of males and females in two cohorts using Fisher's exact test.
Usage
CohortTableHandler$getSexFisherTest(
selected_cohortId1,
selected_cohortId2,
testFor = "Subjects"
)Method getYearOfBirthTests()
Compares the year of birth distributions between the case and control cohorts using two-sample t-test to compare mean year of birth, uses cohen's d to assess effect size of the difference in the mean of the year of births,and the Kolmogorov-Smirnov test to evaluate if year of births in the two cohorts have similar distribution.
Usage
CohortTableHandler$getYearOfBirthTests(
selected_cohortId1,
selected_cohortId2,
testFor = "Subjects"
)