Skip to contents

Module for performing new-user cohort studies against the OMOP Common Data Model

Super class

Strategus::StrategusModule -> CohortMethodModule

Methods

Inherited methods


Method new()

Initialize the module

Usage


Method execute()

Executes the CohortMethod package

Usage

CohortMethodModule$execute(
  connectionDetails,
  analysisSpecifications,
  executionSettings
)

Arguments

connectionDetails

An object of class connectionDetails as created by the DatabaseConnector::createConnectionDetails() function.

analysisSpecifications

The analysis specifications for the study

executionSettings

An object of type ExecutionSettings as created by createCdmExecutionSettings() or createResultsExecutionSettings().


Method createResultsDataModel()

Create the results data model for the module

Usage

CohortMethodModule$createResultsDataModel(
  resultsConnectionDetails,
  resultsDatabaseSchema,
  tablePrefix = ""
)

Arguments

resultsConnectionDetails

The connection details to the results database which is an object of class connectionDetails as created by the DatabaseConnector::createConnectionDetails() function.

resultsConnectionDetails

The connection details to the results database which is an object of class connectionDetails as created by the DatabaseConnector::createConnectionDetails() function.

resultsDatabaseSchema

The schema in the results database that holds the results data model.

tablePrefix

A prefix to apply to the database table names (optional).

tablePrefix

A prefix to apply to the database table names (optional).


Method getResultsDataModelSpecification()

Get the results data model specification for the module

Usage

CohortMethodModule$getResultsDataModelSpecification(tablePrefix = "")

Arguments

tablePrefix

A prefix to apply to the database table names (optional).

tablePrefix

A prefix to apply to the database table names (optional).


Method uploadResults()

Upload the results for the module

Usage

CohortMethodModule$uploadResults(
  resultsConnectionDetails,
  analysisSpecifications,
  resultsDataModelSettings
)

Arguments

resultsConnectionDetails

The connection details to the results database which is an object of class connectionDetails as created by the DatabaseConnector::createConnectionDetails() function.

resultsConnectionDetails

The connection details to the results database which is an object of class connectionDetails as created by the DatabaseConnector::createConnectionDetails() function.

analysisSpecifications

An object of type AnalysisSpecifications as created by createEmptyAnalysisSpecificiations().

resultsDataModelSettings

The results data model settings as created using [@seealso createResultsDataModelSettings()]


Method createModuleSpecifications()

Creates the CohortMethod Module Specifications

Usage

CohortMethodModule$createModuleSpecifications(
  cmAnalysisList,
  targetComparatorOutcomesList,
  analysesToExclude = NULL,
  refitPsForEveryOutcome = FALSE,
  refitPsForEveryStudyPopulation = TRUE,
  cmDiagnosticThresholds = CohortMethod::createCmDiagnosticThresholds()
)

Arguments

cmAnalysisList

A list of objects of type cmAnalysis as created using the `CohortMethod::createCmAnalysis function.

targetComparatorOutcomesList

A list of objects of type targetComparatorOutcomes as created using the CohortMethod::createTargetComparatorOutcomes function.

analysesToExclude

Analyses to exclude. See the Analyses to Exclude section for details.

refitPsForEveryOutcome

Should the propensity model be fitted for every outcome (i.e. after people who already had the outcome are removed)? If false, a single propensity model will be fitted, and people who had the outcome previously will be removed afterwards.

refitPsForEveryStudyPopulation

Should the propensity model be fitted for every study population definition? If false, a single propensity model will be fitted, and the study population criteria will be applied afterwards.

cmDiagnosticThresholds

An object of type CmDiagnosticThresholds as created using CohortMethod::createCmDiagnosticThresholds().

Details

Run a list of analyses for the target-comparator-outcomes of interest. This function will run all specified analyses against all hypotheses of interest, meaning that the total number of outcome models is length(cmAnalysisList) * length(targetComparatorOutcomesList) (if all analyses specify an outcome model should be fitted). When you provide several analyses it will determine whether any of the analyses have anything in common, and will take advantage of this fact. For example, if we specify several analyses that only differ in the way the outcome model is fitted, then this function will extract the data and fit the propensity model only once, and re-use this in all the analysis.

After completion, a tibble containing references to all generated files can be obtained using the CohortMethod::getFileReference() function. A summary of the analysis results can be obtained using the CohortMethod::getResultsSummary() function.

Analyses to Exclude

Normally, runCmAnalyses will run all combinations of target-comparator-outcome-analyses settings. However, sometimes we may not need all those combinations. Using the analysesToExclude argument, we can remove certain items from the full matrix. This argument should be a data frame with at least one of the following columns:


Method validateModuleSpecifications()

Validate the module specifications

Usage

CohortMethodModule$validateModuleSpecifications(moduleSpecifications)

Arguments

moduleSpecifications

The CohortMethod module specifications


Method clone()

The objects of this class are cloneable with this method.

Usage

CohortMethodModule$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.