CohortMethod is an R package for performing new-user cohort studies in an observational database in the OMOP Common Data Model.
- Extracts the necessary data from a database in OMOP Common Data Model format.
- Uses a large set of covariates for both the propensity and outcome model, including for example all drugs, diagnoses, procedures, as well as age, comorbidity indexes, etc.
- Large scale regularized regression to fit the propensity and outcome models.
- Includes function for trimming, stratifying and matching on propensity scores.
- Includes diagnostic functions, including 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 (conditional) Cox regression.
Propensity (preference score) distribution | Covariate balance plot |
CohortMethod is an R package, with some functions implemented in C++.
Requires R (version 3.1.0 or higher). Installation on Windows requires RTools. Libraries used in CohortMethod require Java.
- Cyclops
- DatabaseConnector
- SqlRender
- OhdsiRTools
- FeatureExtraction
- On Windows, make sure RTools is installed.
- The DatabaseConnector and SqlRender packages require Java. Java can be downloaded from http://www.java.com. Once Java is installed, ensure that Java is being pathed correctly. Under environment variables in the control panel, ensure that the jvm.dll file is added correctly to the path.
- In R, use the following commands to download and install CohortMethod:
install.packages("drat")
drat::addRepo("OHDSI")
install.packages("CohortMethod")
- Optionally, run this to check if CohortMethod was correctly installed:
connectionDetails <- createConnectionDetails(dbms="postgresql",
server="my_server.org",
user = "joe",
password = "super_secret")
checkCmInstallation(connectionDetails)
Where dbms, server, user, and password need to be changed to the settings for your database environment. Type
?createConnectionDetails
for more details on how to configure your database connection.
- Vignette: Single studies using the CohortMethod package
- Vignette: Running multiple analyses at once using the CohortMethod package
- Package manual: CohortMethod.pdf
- Developer questions/comments/feedback: OHDSI Forum
- We use the GitHub issue tracker for all bugs/issues/enhancements
CohortMethod is licensed under Apache License 2.0
CohortMethod is being developed in R Studio.
CohortMethod is actively being used in several studies and is ready for use.
- This project is supported in part through the National Science Foundation grant IIS 1251151.