Skip to content

CohortMethod

Comparative Cohort Method with Large Scale Propensity and Outcome Models

v6.0.3 · Jun 22, 2026 · Apache License 2.0

Description

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.

Downloads

CRAN

653

Last 30 days

4905th

1.6K

Last 90 days

2K

Last year

Trend: +5% (30d vs prior 30d)

r2u CRAN

43

Last 30 days

169

Last 90 days

194

Last year

Trend: -33.9% (30d vs prior 30d)

CRAN Check Status

13 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 27, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Jun 19, 2026
ERROR r-devel-linux-x86_64-debian-gcc

tests

Running ‘testthat.R’ [227s/324s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > test_check("CohortMethod")
  Loading required package: CohortMethod
  Loading required package: DatabaseConnector
  Loading re
...[truncated]...
cannot use a variable created in the same `summarise()`.
  ✖ `sum` was created earlier in this `summarise()`.
  ℹ You need an extra `mutate()` step to use it.
  
  [ FAIL 6 | WARN 2 | SKIP 1 | PASS 433 ]
  Error:
  ! Test failures.
  Execution halted
OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 9, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Jun 8, 2026
ERROR r-devel-linux-x86_64-debian-gcc

package dependencies

Packages required but not available:
  'DatabaseConnector', 'Cyclops', 'FeatureExtraction', 'Andromeda'

Packages suggested but not available for checking:
  'Eunomia', 'ResultModelManager'

See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’
manual.
OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE May 24, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE May 17, 2026
ERROR r-release-linux-x86_64

package dependencies

Packages required but not available:
  'Cyclops', 'FeatureExtraction', 'Andromeda'

See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’
manual.
OK 13 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE May 15, 2026
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE May 13, 2026
ERROR r-devel-linux-x86_64-debian-gcc

package dependencies

Packages required but not available:
  'Cyclops', 'FeatureExtraction', 'Andromeda'

See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’
manual.
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Apr 22, 2026
ERROR 13 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Apr 18, 2026
ERROR r-devel-windows-x86_64

whether package can be installed

Installation failed.
See 'd:/Rcompile/CRANpkg/local/4.6/CohortMethod.Rcheck/00install.out' for details.
OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Apr 6, 2026
ERROR 13 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE Apr 3, 2026
ERROR r-devel-linux-x86_64-debian-gcc

package dependencies

Packages required but not available:
  'DatabaseConnector', 'FeatureExtraction', 'SqlRender'

Packages suggested but not available for checking:
  'Eunomia', 'ResultModelManager'

See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’
manual.
OK 6 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 21, 2026

Code

Structure

Lines of code

19,568

Files

147

Compiled share

4%

Has compiled src

Yes

Language breakdown

R 10,391 (53.1%)C/C++/src 787 (4%)Tests 3,955 (20.2%)Docs 2,730 (14%)Vignettes 1,705 (8.7%)

API

Exported functions

66

Internal functions

97

Recent export changes

v6.0.1+66 adjustedKm, checkCmInstallation, computeCovariateBalance +63 more

Testing & CI

Has tests

Yes

Test-to-code ratio

0.38

testthat edition

CI present

No

CI type

[]

PR gated

No

Docs

Return-value doc rate

87.9%

\dontrun example ratio

0%

Roxygen coverage

100%

Has pkgdown

No

NEWS present

Yes

Health & Security signals

Informational signals; not verdicts.

on.exit coverage

20%

Unsafe pattern score

0

Dep constraint coverage

31.8%

Secret pattern count

0

Bundled 3rd-party code

2 items

Portability & License

Min R version

4.1.0

System requirements

1

C++ standard

License

Apache License 2.0

License flags

SPDX valid, OSI approved

History

Versions

3

First release

2026-03-21

Latest release

2026-06-22

Avg cadence

47 days

Cold removal rate

Dep drift

0

LOC over versions

v6.0.1: 19,545 LOCv6.0.2: 19,567 LOCv6.0.3: 19,568 LOC

Per-file churn detail lives in the source pipeline: https://github.com/r-observatory/cran-code-metrics.

Dependency Network

Dependencies Reverse dependencies DatabaseConnector Cyclops (>= 3.6.0) FeatureExtraction Andromeda ggplot2 gridExtra readr plyr dplyr rlang Rcpp SqlRender survival ParallelLogger checkmate +4 more dependencies CohortMethod

Version History

3 tracked
updated 6.0.3 ← 6.0.2 diff Jun 22, 2026
updated 6.0.2 ← 6.0.1 diff May 8, 2026
new 6.0.1 Mar 21, 2026