Package: CohortMethod 6.0.2

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.2.tar.gz
CohortMethod_6.0.2.tar.gz(r-4.7-arm64)CohortMethod_6.0.2.tar.gz(r-4.7-x86_64)CohortMethod_6.0.2.tar.gz(r-4.6-arm64)CohortMethod_6.0.2.tar.gz(r-4.6-x86_64)
CohortMethod_6.0.2.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
CohortMethod/json (API)
NEWS

# Install 'CohortMethod' in R:
install.packages('CohortMethod', repos = c('https://cran.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:

cppopenjdk

4.89 score 258 scripts 585 downloads 68 exports 73 dependencies

Last updated from:9e61f513e4. Checks:4 WARNING, 2 OK. Indexed: no.

TargetResultTimeFilesSyslog
linux-devel-arm64WARNING409
linux-devel-x86_64WARNING459
source / vignettesOK281
linux-release-arm64WARNING452
linux-release-x86_64WARNING423
wasm-releaseOK166

Exports:adjustedKmcheckCmInstallationcomputeCovariateBalancecomputeEquipoisecomputeMdrrcomputePsAucconvertUntypedListToCmAnalysesSpecificationscreateCmAnalysesSpecificationscreateCmAnalysiscreateCmDiagnosticThresholdscreateCmTable1createCohortMethodDataSimulationProfilecreateComputeCovariateBalanceArgscreateCreatePsArgscreateCreateStudyPopulationArgscreateDefaultMultiThreadingSettingscreateFitOutcomeModelArgscreateGetDbCohortMethodDataArgscreateMatchOnPsArgscreateMultiThreadingSettingscreateOutcomecreatePscreateResultsDataModelcreateStratifyByPsArgscreateStudyPopulationcreateTargetComparatorOutcomescreateTrimByPsArgscreateTruncateIptwArgsdrawAttritionDiagramexportToCsvfitOutcomeModelgetAttritionTablegetDataMigratorgetDbCohortMethodDatagetDefaultCmTable1SpecificationsgetDiagnosticsSummarygetFileReferencegetFollowUpDistributiongetGeneralizabilityTablegetInteractionResultsSummarygetOutcomeModelgetPsModelgetResultsDataModelSpecificationsgetResultsSummaryisCohortMethodDataloadCmAnalysisListloadCohortMethodDataloadTargetComparatorOutcomesListmatchOnPsmigrateDataModelplotCovariateBalanceOfTopVariablesplotCovariateBalanceScatterPlotplotCovariatePrevalenceplotFollowUpDistributionplotKaplanMeierplotPsplotTimeToEventrunCmAnalysessaveCmAnalysisListsaveCohortMethodDatasaveTargetComparatorOutcomesListshowsimulateCohortMethodDatastratifyByPssummarytrimByPstruncateIptwuploadResults

Dependencies:Andromedabackportsbitbit64blobcachemcheckmateclicliprcpp11crayonCyclopsDatabaseConnectorDBIdbplyrdigestdplyrduckdbEmpiricalCalibrationfarverfastmapFeatureExtractiongenericsggplot2gluegridExtragtablehmsisobandjsonlitelabelinglatticelifecyclemagrittrMatrixmemoisememuseParallelLoggerpillarpkgconfigplyrprettyunitsprogresspurrrR6RColorBrewerRcppRcppEigenreadrrJavarlangRSQLiterstudioapiS7scalessnowSqlRenderstringistringrsurvivaltibbletidyrtidyselecttriebeardtzdburltoolsutf8vctrsviridisLitevroomwithrxml2zip

Running multiple analyses at once using the CohortMethod package

Rendered fromMultipleAnalyses.Rmdusingknitr::rmarkdownon May 23 2026.

Last update: 2026-03-21
Started: 2026-03-21

Results schema of the CohortMethod package

Rendered fromResultsSchema.Rmdusingknitr::rmarkdownon May 23 2026.

Last update: 2026-03-21
Started: 2026-03-21

Single studies using the CohortMethod package

Rendered fromSingleStudies.Rmdusingknitr::rmarkdownon May 23 2026.

Last update: 2026-03-21
Started: 2026-03-21

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