Package: CohortMethod 6.0.3

Martijn Schuemie

CohortMethod: Comparative Cohort Method with Large Scale Propensity and Outcome Models

Functions for performing comparative cohort studies in an observational database in the Observational Medical Outcomes Partnership (OMOP) Common Data Model. Can extract all necessary data from a database. This implements large-scale propensity scores (LSPS) as described in Tian et al. (2018) <doi:10.1093/ije/dyy120>, using a large set of covariates, including for example all drugs, diagnoses, procedures, as well as age, comorbidity indexes, etc. Large scale regularized regression is used to fit the propensity and outcome models as described in Suchard et al. (2013) <doi:10.1145/2414416.2414791>. Functions are included for trimming, stratifying, (variable and fixed ratio) matching and weighting by propensity scores, as well as diagnostic functions, such as propensity score distribution plots and plots showing covariate balance before and after matching and/or trimming. Supported outcome models are (conditional) logistic regression, (conditional) Poisson regression, and (stratified) Cox regression. Also included are Kaplan-Meier plots that can adjust for the stratification or matching.

Authors:Martijn Schuemie [aut, cre], Marc Suchard [aut], Patrick Ryan [aut]

CohortMethod_6.0.3.tar.gz
CohortMethod_6.0.3.zip(r-4.7)CohortMethod_6.0.3.zip(r-4.6)CohortMethod_6.0.3.zip(r-4.5)
CohortMethod_6.0.3.tgz(r-4.6-x86_64)CohortMethod_6.0.3.tgz(r-4.6-arm64)CohortMethod_6.0.3.tgz(r-4.5-x86_64)CohortMethod_6.0.3.tgz(r-4.5-arm64)
CohortMethod_6.0.3.tar.gz(r-4.7-arm64)CohortMethod_6.0.3.tar.gz(r-4.7-x86_64)CohortMethod_6.0.3.tar.gz(r-4.6-arm64)CohortMethod_6.0.3.tar.gz(r-4.6-x86_64)
CohortMethod_6.0.3.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
CohortMethod/json (API)

# Install 'CohortMethod' in R:
install.packages('CohortMethod', repos = c('https://ohdsi.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/ohdsi/cohortmethod/issues

Pkgdown/docs site:https://ohdsi.github.io

Uses libs:
  • c++– GNU Standard C++ Library v3
  • openjdk– OpenJDK Java runtime, using Hotspot JIT
Datasets:

On CRAN:

Conda:

hadescppopenjdk

10.00 score 89 stars 300 scripts 697 downloads 68 exports 73 dependencies

Last updated from:dd1a2a856e. Checks:11 WARNING, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64WARNING414
linux-devel-x86_64WARNING411
source / vignettesOK295
linux-release-arm64WARNING487
linux-release-x86_64WARNING401
macos-release-arm64WARNING246
macos-release-x86_64WARNING930
macos-oldrel-arm64WARNING239
macos-oldrel-x86_64WARNING504
windows-develWARNING479
windows-releaseWARNING486
windows-oldrelWARNING521
wasm-releaseOK194

Exports:adjustedKmcheckCmInstallationcomputeCovariateBalancecomputeEquipoisecomputeMdrrcomputePsAucconvertUntypedListToCmAnalysesSpecificationscreateCmAnalysesSpecificationscreateCmAnalysiscreateCmDiagnosticThresholdscreateCmTable1createCohortMethodDataSimulationProfilecreateComputeCovariateBalanceArgscreateCreatePsArgscreateCreateStudyPopulationArgscreateDefaultMultiThreadingSettingscreateFitOutcomeModelArgscreateGetDbCohortMethodDataArgscreateMatchOnPsArgscreateMultiThreadingSettingscreateOutcomecreatePscreateResultsDataModelcreateStratifyByPsArgscreateStudyPopulationcreateTargetComparatorOutcomescreateTrimByPsArgscreateTruncateIptwArgsdrawAttritionDiagramexportToCsvfitOutcomeModelgetAttritionTablegetDataMigratorgetDbCohortMethodDatagetDefaultCmTable1SpecificationsgetDiagnosticsSummarygetFileReferencegetFollowUpDistributiongetGeneralizabilityTablegetInteractionResultsSummarygetOutcomeModelgetPsModelgetResultsDataModelSpecificationsgetResultsSummaryisCohortMethodDataloadCmAnalysisListloadCohortMethodDataloadTargetComparatorOutcomesListmatchOnPsmigrateDataModelplotCovariateBalanceOfTopVariablesplotCovariateBalanceScatterPlotplotCovariatePrevalenceplotFollowUpDistributionplotKaplanMeierplotPsplotTimeToEventrunCmAnalysessaveCmAnalysisListsaveCohortMethodDatasaveTargetComparatorOutcomesListshowsimulateCohortMethodDatastratifyByPssummarytrimByPstruncateIptwuploadResults

Dependencies:Andromedabackportsbitbit64blobcachemcheckmateclicliprcpp11crayonCyclopsDatabaseConnectorDBIdbplyrdigestdplyrduckdbEmpiricalCalibrationfarverfastmapFeatureExtractiongenericsggplot2gluegridExtragtablehmsisobandjsonlitelabelinglatticelifecyclemagrittrMatrixmemoisememuseParallelLoggerpillarpkgconfigplyrprettyunitsprogresspurrrR6RColorBrewerRcppRcppEigenreadrrJavarlangRSQLiterstudioapiS7scalessnowSqlRenderstringistringrsurvivaltibbletidyrtidyselecttriebeardtzdburltoolsutf8vctrsviridisLitevroomwithrxml2zip

Single studies using the CohortMethod package
Introduction | Data extraction | Configuring the connection to the server | Preparing the exposures and outcome(s) | Extracting the data from the server | Saving the data to file | Defining the study population | Propensity scores | Fitting a propensity model | Propensity score diagnostics | Using the propensity score | Evaluating covariate balance | Inspecting select population characteristics | Generalizability | Follow-up and power | Outcome models | Fitting a simple outcome model | Adding interaction terms | Adding covariates to the outcome model | Inspecting the outcome model | Kaplan-Meier plot | Time-to-event plot | Acknowledgments

Last update: 2026-03-10
Started: 2014-11-21

Running multiple analyses at once using the CohortMethod package
Introduction | General approach | Preparation for the example | Preparing the exposures and outcome(s) | Specifying hypotheses of interest | Specifying analyses | Covariate balance | Executing multiple analyses | Restarting | Retrieving the results | Diagnostics | Empirical calibration and negative control distribution | Exporting to CSV | Acknowledgments

Last update: 2025-11-26
Started: 2015-06-24

Results schema of the CohortMethod package
Introduction | Fields with minimum values | Tables

Last update: 2025-11-14
Started: 2025-11-14

Readme and manuals

Help Manual

Help pageTopics
Compute a weight-adjusted Kaplan-Meier curveadjustedKm
Check is CohortMethod and its dependencies are correctly installedcheckCmInstallation
Cohort Method DataCohortMethodData CohortMethodData-class show,CohortMethodData-method summary,CohortMethodData-method
A simulation profilecohortMethodDataSimulationProfile
Compute covariate balance before and after PS adjustmentcomputeCovariateBalance
Compute fraction in equipoisecomputeEquipoise
Compute the minimum detectable relative riskcomputeMdrr
Compute the area under the ROC curvecomputePsAuc
Convert untyped list to SccsAnalysesSpecificationsconvertUntypedListToCmAnalysesSpecifications
Create full CM analysis specificationscreateCmAnalysesSpecifications
Create a CohortMethod analysis specificationcreateCmAnalysis
Create CohortMethod diagnostics thresholdscreateCmDiagnosticThresholds
Create a table 1createCmTable1
Create simulation profilecreateCohortMethodDataSimulationProfile
Create a parameter object for the function 'computeCovariateBalance()'createComputeCovariateBalanceArgs
Create a parameter object for the function 'createPs()'createCreatePsArgs
Create a parameter object for the function 'createStudyPopulation()'createCreateStudyPopulationArgs
Create default CohortMethod multi-threading settingscreateDefaultMultiThreadingSettings
Create a parameter object for the function 'fitOutcomeModel()'createFitOutcomeModelArgs
Create a parameter object for the function 'getDbCohortMethodData()'createGetDbCohortMethodDataArgs
Create a parameter object for the function 'matchOnPs()'createMatchOnPsArgs
Create CohortMethod multi-threading settingscreateMultiThreadingSettings
Create outcome definitioncreateOutcome
Create propensity scorescreatePs
Create the results data model tables on a database server.createResultsDataModel
Create a parameter object for the function 'stratifyByPs()'createStratifyByPsArgs
Create a study populationcreateStudyPopulation
Create target-comparator-outcomes combinations.createTargetComparatorOutcomes
Create a parameter object for the function 'trimByPs()'createTrimByPsArgs
Create a parameter object for the function 'truncateIptw()'createTruncateIptwArgs
Draw the attrition diagramdrawAttritionDiagram
Export cohort method results to CSV filesexportToCsv
Create an outcome model, and compute the relative riskfitOutcomeModel
Get the attrition table for a populationgetAttritionTable
Get database migrations instancegetDataMigrator
Get the cohort data from the servergetDbCohortMethodData
Get the default table 1 specificationsgetDefaultCmTable1Specifications
Get a summary report of the analyses diagnosticsgetDiagnosticsSummary
Get file referencegetFileReference
Get the distribution of follow-up timegetFollowUpDistribution
Get information on generalizabilitygetGeneralizabilityTable
Get a summary report of the analyses resultsgetInteractionResultsSummary
Get the outcome modelgetOutcomeModel
Get the propensity modelgetPsModel
Get specifications for CohortMethod results data modelgetResultsDataModelSpecifications
Get a summary report of the analyses resultsgetResultsSummary
Check whether an object is a CohortMethodData objectisCohortMethodData
Load a list of CmAnalysis from fileloadCmAnalysisList
Load the cohort method data from a fileloadCohortMethodData
Load a list of 'TargetComparatorOutcomes' from fileloadTargetComparatorOutcomesList
Match persons by propensity scorematchOnPs
Migrate Data modelmigrateDataModel
Plot variables with largest imbalanceplotCovariateBalanceOfTopVariables
Create a scatterplot of the covariate balanceplotCovariateBalanceScatterPlot
Plot covariate prevalenceplotCovariatePrevalence
Plot the distribution of follow-up timeplotFollowUpDistribution
Plot the Kaplan-Meier curveplotKaplanMeier
Plot the propensity score distributionplotPs
Plot time-to-eventplotTimeToEvent
Run a list of analysesrunCmAnalyses
Save a list of CmAnalysis to filesaveCmAnalysisList
Save the cohort method data to filesaveCohortMethodData
Save a list of 'TargetComparatorOutcomes' to filesaveTargetComparatorOutcomesList
Generate simulated datasimulateCohortMethodData
Stratify persons by propensity scorestratifyByPs
Trim persons by propensity scoretrimByPs
Truncate IPTW valuestruncateIptw
Upload results to the database server.uploadResults