Skip to content

Commit 869c1f6

Browse files
authored
Merge branch 'version_6' into IptwTrimFix
2 parents c05d20d + a54fba1 commit 869c1f6

File tree

323 files changed

+23026
-10406
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

323 files changed

+23026
-10406
lines changed

.Rbuildignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ deploy.sh
1010
compare_versions
1111
.github
1212
docs
13-
.idea
13+
.idea
14+
^cran-comments.md$
15+
^CRAN-SUBMISSION$

.github/workflows/R_CMD_check_Hades.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,31 @@ jobs:
9898
path: check/*.tar.gz
9999

100100
- name: Install covr
101-
if: runner.os == 'macOS'
101+
if: runner.os == 'Linux'
102102
run: |
103-
install.packages("covr")
103+
remotes::install_cran("covr")
104+
remotes::install_cran("xml2")
104105
shell: Rscript {0}
105106

106107
- name: Test coverage
107-
if: runner.os == 'macOS'
108-
run: covr::codecov()
108+
if: runner.os == 'Linux'
109+
run: |
110+
cov <- covr::package_coverage(
111+
quiet = FALSE,
112+
clean = FALSE,
113+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
114+
)
115+
covr::to_cobertura(cov)
109116
shell: Rscript {0}
110117

118+
- uses: codecov/codecov-action@v4
119+
if: runner.os == 'Linux'
120+
with:
121+
file: ./cobertura.xml
122+
plugin: noop
123+
disable_search: true
124+
token: ${{ secrets.CODECOV_TOKEN }}
125+
111126
Release:
112127
needs: R-CMD-Check
113128

DESCRIPTION

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: CohortMethod
22
Type: Package
33
Title: New-User Cohort Method with Large Scale Propensity and Outcome Models
4-
Version: 5.5.2
5-
Date: 2025-10-30
4+
Version: 6.0.0
5+
Date: 2025-11-25
66
Authors@R: c(
77
person("Martijn", "Schuemie", , "schuemie@ohdsi.org", role = c("aut", "cre")),
88
person("Marc", "Suchard", role = c("aut")),
@@ -23,44 +23,44 @@ Description: Functions for performing new-user cohort studies
2323
the stratification or matching.
2424
License: Apache License 2.0
2525
VignetteBuilder: knitr
26-
URL: https://ohdsi.github.io/CohortMethod, https://github.com/OHDSI/CohortMethod
26+
URL: https://ohdsi.github.io/CohortMethod/, https://github.com/OHDSI/CohortMethod
2727
BugReports: https://github.com/OHDSI/CohortMethod/issues
2828
Depends:
2929
R (>= 4.1.0),
3030
DatabaseConnector (>= 6.0.0),
31-
Cyclops (>= 3.1.2),
31+
Cyclops (>= 3.6.0),
3232
FeatureExtraction (>= 3.0.0),
3333
Andromeda (>= 0.6.3)
3434
Imports:
3535
methods,
36+
utils,
3637
ggplot2,
3738
gridExtra,
3839
grid,
3940
readr,
4041
plyr,
4142
dplyr,
4243
rlang,
43-
cli,
44-
pillar,
4544
Rcpp (>= 0.11.2),
4645
SqlRender (>= 1.18.0),
4746
survival,
4847
ParallelLogger (>= 3.4.2),
49-
bit64,
5048
checkmate,
5149
EmpiricalCalibration,
52-
zip
50+
jsonlite,
51+
R6,
52+
digest
5353
Suggests:
5454
testthat,
5555
pROC,
5656
knitr,
5757
rmarkdown,
5858
Eunomia,
59+
zip,
5960
withr,
6061
R.utils,
6162
RSQLite,
6263
ResultModelManager,
63-
OhdsiShinyAppBuilder,
6464
markdown
6565
SystemRequirements: Java
6666
LinkingTo: Rcpp

NAMESPACE

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export(computeCovariateBalance)
1010
export(computeEquipoise)
1111
export(computeMdrr)
1212
export(computePsAuc)
13+
export(convertUntypedListToCmAnalysesSpecifications)
14+
export(createCmAnalysesSpecifications)
1315
export(createCmAnalysis)
1416
export(createCmDiagnosticThresholds)
1517
export(createCmTable1)
@@ -20,19 +22,15 @@ export(createCreateStudyPopulationArgs)
2022
export(createDefaultMultiThreadingSettings)
2123
export(createFitOutcomeModelArgs)
2224
export(createGetDbCohortMethodDataArgs)
23-
export(createMatchOnPsAndCovariatesArgs)
2425
export(createMatchOnPsArgs)
2526
export(createMultiThreadingSettings)
2627
export(createOutcome)
2728
export(createPs)
2829
export(createResultsDataModel)
29-
export(createStratifyByPsAndCovariatesArgs)
3030
export(createStratifyByPsArgs)
3131
export(createStudyPopulation)
3232
export(createTargetComparatorOutcomes)
33-
export(createTrimByIptwArgs)
3433
export(createTrimByPsArgs)
35-
export(createTrimByPsToEquipoiseArgs)
3634
export(createTruncateIptwArgs)
3735
export(drawAttritionDiagram)
3836
export(exportToCsv)
@@ -41,6 +39,7 @@ export(getAttritionTable)
4139
export(getDataMigrator)
4240
export(getDbCohortMethodData)
4341
export(getDefaultCmTable1Specifications)
42+
export(getDiagnosticsSummary)
4443
export(getFileReference)
4544
export(getFollowUpDistribution)
4645
export(getGeneralizabilityTable)
@@ -49,15 +48,11 @@ export(getOutcomeModel)
4948
export(getPsModel)
5049
export(getResultsDataModelSpecifications)
5150
export(getResultsSummary)
52-
export(insertExportedResultsInSqlite)
5351
export(isCohortMethodData)
54-
export(launchResultsViewer)
55-
export(launchResultsViewerUsingSqlite)
5652
export(loadCmAnalysisList)
5753
export(loadCohortMethodData)
5854
export(loadTargetComparatorOutcomesList)
5955
export(matchOnPs)
60-
export(matchOnPsAndCovariates)
6156
export(migrateDataModel)
6257
export(plotCovariateBalanceOfTopVariables)
6358
export(plotCovariateBalanceScatterPlot)
@@ -72,10 +67,7 @@ export(saveCohortMethodData)
7267
export(saveTargetComparatorOutcomesList)
7368
export(simulateCohortMethodData)
7469
export(stratifyByPs)
75-
export(stratifyByPsAndCovariates)
76-
export(trimByIptw)
7770
export(trimByPs)
78-
export(trimByPsToEquipoise)
7971
export(truncateIptw)
8072
export(uploadResults)
8173
exportClasses(CohortMethodData)
@@ -85,6 +77,7 @@ import(Andromeda)
8577
import(Cyclops)
8678
import(DatabaseConnector)
8779
import(FeatureExtraction)
80+
import(R6)
8881
import(dplyr)
8982
importFrom(Rcpp,evalCpp)
9083
importFrom(SqlRender,loadRenderTranslateSql)
@@ -116,5 +109,6 @@ importFrom(utils,head)
116109
importFrom(utils,install.packages)
117110
importFrom(utils,installed.packages)
118111
importFrom(utils,setTxtProgressBar)
112+
importFrom(utils,tail)
119113
importFrom(utils,txtProgressBar)
120114
useDynLib(CohortMethod)

NEWS.md

Lines changed: 92 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,93 @@
1+
CohortMethod 6.0.0
2+
==================
3+
4+
This major release introduces many changes. The three most important ones are (1) changing the settings objects, (2) supporting nesting cohorts, and (3) covariate balance significance testing.
5+
6+
7+
## Changes related to the settings objects
8+
9+
1. All settings objects have been changed to R6 classes, and are now used both when calling functions individually and when using `runCmAnalyses()`. The main rationale is that allows 3rd parties to more easily generate valid settings.
10+
11+
2. Dropped the `cdmVersion` argument in `getDbCohortMethodData()` and `runCmAnalyses()`. The version will be identified in the `cdm_source` table.
12+
13+
3. Dropped the `trimByIptw()` and `trimByPsToEquipoise()` functions. Added `equipoiseBounds` and `maxWeight` arguments to `createTrimByPsArgs()` so functionality remains.
14+
15+
4. Dropped the `matchOnPsAndCovariates()` function and added a `stratificationCovariateIds` argument to `createMatchOnPsArgs()` so functionality remains.
16+
17+
5. Dropped the `stratifyByPsAndCovariates()` function and added a `stratificationCovariateIds` argument to `createStratifyByPsPsArgs()` so functionality remains.
18+
19+
6. Renamed `createStudyPopArgs` argument of `createCmAnalysis()` to `createStudyPopulationArgs` for consistency.
20+
21+
7. Dropping the deprecated `attritionFractionThreshold` argument of `createCmDiagnosticThresholds()`. The amount of attrition is not a good measure of generalizability. Use the generalizability diagnostic instead, which measures the similarity between the target and analytic cohort characteristcs.
22+
23+
8. Changed the default outcome model type from 'logistic' to 'cox'.
24+
25+
9. Set the defaults of `createGetDbCohortMethodDataArgs()` to those most often used.
26+
27+
10. Dropped the `firstExposureOnly`, `restrictToCommonPeriod`, `washoutPeriod`, and `removeDuplicateSubjects` arguments from `CreateStudyPopulationArgs`. These were duplicated from `getDbCohortMethodData()`, and we'll keep them only there from now on.
28+
29+
30+
## Changes related to nesting cohorts
31+
32+
11. Added ability to restrict to a nesting cohort (e.g. restricting drug exposures to a specific indication). See the `nestingCohortId` argument in the `createGetDbCohortMethodDataArgs()` and `createTargetComparatorOutcomes()` functions and the `nestingCohortDatabaseSchema` and `nestingCohortTable` arguments in the `getDbCohortMethodData()` function.
33+
34+
12. The results schema now includes the `target_comparator` table that combines the `target_id`, `comparator_id`, and `nesting_cohort_id` into a single unique `target_comparator_id`. This new ID is a hash of its components, allowing results from multiple runs to be combined into a single database.
35+
36+
13. In addition to restricting to a nesting cohort the population can now also be restricted by age and gender using the `minAge`, `maxAge`, and `genderConceptIds` arguments of `createGetDbCohortMethodDataArgs()`.
37+
38+
39+
## Changes related to the new covariate balance diagnostic
40+
41+
14. Added optional significance testing to covariate balance. This avoids failing the balance diagnostic on smaller databases just because of random chance, and was found to be superior in our methods research. This introduces the following changes to the interface:
42+
43+
- Added the `threshold` and `alpha` arguments to the `createComputeCovariateBalanceArgs()` function. These do not impact blinding when running `runCmAnalyses` but do add columns to the balance files, for when running single studies.
44+
- Added the `sdmAlpha` argument to the `createCmDiagnosticThresholds()` function.
45+
46+
This adds the `sdm_family_wise_min_p` and `shared_sdm_family_wise_min_p` fields to the `cm_diagnostics_summary` table when exporting to CSV.
47+
For now, the default is not to use significance testing, but the family-wise min P can help understand if one would have passed when using it.
48+
49+
50+
## Other important changes
51+
52+
15. Added a new option for the `removeDuplicateSubjects` argument: "keep first, truncate to second". This is similar to "keep first", but also truncates the first exposure to stop the day before the second starts.
53+
54+
16. Now performing empirical calibration *after* removing estimates that fail diagnostics. In general this should lead to narrower calibrated confidence intervals.
55+
56+
17. If high correlation is detected when fitting a propensity model, but `stopOnError = FALSE`, the export will show the highly correlated covariates in the model with extreme coefficients (1e6 * correlation).
57+
58+
18. Added the ability to use bootstrap for computing confidence intervals. See the `bootstrapCi` and `bootstrapReplicates` arguments of `createFitOutcomeModelArgs()`.
59+
60+
19. All restrictions on the study populations performed by `getDbCohortMethodData()` are now step-by-step recorded in the attrition table.
61+
62+
20. Completely updated of all unit tests to increase coverage of functional tests, while also increasing speed.
63+
64+
21. Renamed the `showEquipoiseLabel` argument of `plotPs()` to `showEquipoiseLabel`.
65+
66+
67+
## Minor changes
68+
69+
22. Added support for grid-with-gradient likelihood profiles. Use the following arguments in `createFitOutcomeModelArgs()` to use:
70+
71+
```r
72+
profileGrid = seq(log(0.1), log(10), length.out = 8),
73+
profileBounds = NULL
74+
```
75+
76+
This adds the `gradient` field to the `cm_likelihood_profile` table when exporting to CSV.
77+
78+
23. Removed mention of legacy function `grepCovariateNames()` from the vignette.
79+
80+
24. Added citation to the HADES paper to the package.
81+
82+
25. Dropped `insertExportedResultsInSqlite()`, `launchResultsViewerUsingSqlite`, and `launchResultsViewer()`. The `OhdsiShinyAppBuilder` package should be used directly instead.
83+
84+
26. Corrected the `minDaysAtRisk` argument. Days at risk is now computed as end - start + 1 (end day inclusive).
85+
86+
27. Added a vignette showing the results schema.
87+
88+
28. Changed the data type of the `interaction_covariate_id` field in the `cm_interaction_result` table from `INT` to `BIGINT`.
89+
90+
191
CohortMethod 5.5.2
292
==================
393

@@ -23,7 +113,7 @@ Changes:
23113

24114
1. `createPs()` now checks if filtering of the covariate data is necessary (either because subject have been removed from the study population or because `excludeCovariateIds` or `includeCovariateIds` was specified). If no filtering is required, no extra copy of the covariate data data is created, saving IO time.
25115

26-
2. Added `minimumCaseCount` argument to `createCohortMethodDataSimulationProfile ()`.
116+
2. Added `minimumCaseCount` argument to `createCohortMethodDataSimulationProfile()`.
27117

28118
3. Preparing for `Andromeda 1.0.0`: no longer assuming Andromeda tables are sorted.
29119

@@ -198,7 +288,7 @@ Changes:
198288

199289
Bug fixes:
200290

201-
1. Fixed error when using integer `maxWeight` when performng IPTW.
291+
1. Fixed error when using integer `maxWeight` when performing IPTW.
202292

203293

204294
CohortMethod 4.2.3

0 commit comments

Comments
 (0)