The package can be installed from github with
devtools::install_github("sverchkov/BaselineRegularization", build_vignettes = TRUE)
The R vignettes include a tutorial that covers most features of the package, these can be accessed with
browseVignettes("BaselineRegularization")
# Load the package
library("BaselineRegularization")
# Connect to Database, e.g. postgres [1]
con <- DBI::dbConnect( RPostgreSQL::PostgreSQL()
, host = "localhost"
, user = "user"
, dbname = "omop_example"
, password = rstudioapi::askForPassword("Database Password") )
# Define the Event of interest
event = 4110956 # The concept_id for "Acute myocardial infarction NOS"
# Extract relevant data
br_data <- prepareBRData( con, response_event = event )
# Parametrize task
parameters <- defineBRParameters()
# Fit model
fit <- fitBaselineRegularization( br_data, parameters )
# Show results (beta coefficients)
getCoefficients( fit )
- See this guide for a more comprehensive overview of database connection. We use
dplyr
under the hood.
BaselineRegularization is an R package.
Requires R (version 3.0.0 or greater).
Always required:
- rlang (>= 0.2)
- Matrix (>= 1.2)
- dplyr (>= 0.7)
- tidyr (>= 0.8)
- glmnet (>= 2.0)
- futile.logger (>= 1.4)
Required for database access:
- DBI (>= 1.0.0),
- dbplyr (>= 1.2),
- Database drivers, depending on the database being accessed, e.g.
- RPostgreSQL
- RSQLite
Required for building the documentation:
- knitr
- rmarkdown
Required for testing:
- testthat (>= 2.0.0)
BaselineRegularization is licensed under Apache License 2.0
BaselineRegularization is being developed in R Studio.
We use the GitHub issue tracker for bugs and feature requests
Original papers describing the underlying algorithms:
- Kuang, Z. et al. (2016). Computational drug repositioning using continuous self-controlled case series. In: Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. ACM, pp. 491-500.
- Kuang, Z. et al. (2017). Pharmacovigilance via Baseline Regularization with Large-Scale Longitudinal Observational Data. In: Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. ACM, pp. 1537-1546.