New-user cohort studies with the HADES CohortMethod Package
Source:R/Module-CohortMethod.R
CohortMethodModule.RdModule for performing new-user cohort studies against the OMOP Common Data Model
Super class
Strategus::StrategusModule -> CohortMethodModule
Methods
Method execute()
Executes the CohortMethod package
Arguments
connectionDetailsAn object of class
connectionDetailsas created by theDatabaseConnector::createConnectionDetails()function.analysisSpecificationsThe analysis specifications for the study
executionSettingsAn object of type
ExecutionSettingsas created bycreateCdmExecutionSettings()orcreateResultsExecutionSettings().
Method createResultsDataModel()
Create the results data model for the module
Usage
CohortMethodModule$createResultsDataModel(
resultsConnectionDetails,
resultsDatabaseSchema,
tablePrefix = ""
)Arguments
resultsConnectionDetailsThe connection details to the results database which is an object of class
connectionDetailsas created by theDatabaseConnector::createConnectionDetails()function.resultsConnectionDetailsThe connection details to the results database which is an object of class
connectionDetailsas created by theDatabaseConnector::createConnectionDetails()function.resultsDatabaseSchemaThe schema in the results database that holds the results data model.
tablePrefixA prefix to apply to the database table names (optional).
tablePrefixA prefix to apply to the database table names (optional).
Method uploadResults()
Upload the results for the module
Usage
CohortMethodModule$uploadResults(
resultsConnectionDetails,
analysisSpecifications,
resultsDataModelSettings
)Arguments
resultsConnectionDetailsThe connection details to the results database which is an object of class
connectionDetailsas created by theDatabaseConnector::createConnectionDetails()function.resultsConnectionDetailsThe connection details to the results database which is an object of class
connectionDetailsas created by theDatabaseConnector::createConnectionDetails()function.analysisSpecificationsAn object of type
AnalysisSpecificationsas created bycreateEmptyAnalysisSpecificiations().resultsDataModelSettingsThe 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
cmAnalysisListA list of objects of type
cmAnalysisas created using the `CohortMethod::createCmAnalysis function.targetComparatorOutcomesListA list of objects of type
targetComparatorOutcomesas created using the CohortMethod::createTargetComparatorOutcomes function.analysesToExcludeAnalyses to exclude. See the Analyses to Exclude section for details.
refitPsForEveryOutcomeShould 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.
refitPsForEveryStudyPopulationShould 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.
cmDiagnosticThresholdsAn object of type
CmDiagnosticThresholdsas created usingCohortMethod::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: