Skip to content

A package for implementing the death imputation model on OMOP CDM data

Notifications You must be signed in to change notification settings

ohdsi-studies/DeadModel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Identifying the DEAD: Development and Validation of a Patient-Level Model to Predict Death Status in Population-Level Claims Data

Study Status: Complete

  • Analytics use case(s): Patient-Level Prediction
  • Study type: Clinical Application
  • Tags: -
  • Study lead: Jenna Reps
  • Study lead forums tag: jreps
  • Study start date: Jan 1, 2018
  • Study end date: April 1, 2018
  • Protocol: -
  • Publications: Paper
  • Results explorer: Shiny App

This package contains the DEAD risk model - using the last 365 days what is the risk that the patient with an end of observation is dead?

Features

  • code to validate the death model on data with death status recorded
  • code to create a death risk covariate
  • code to predict the current alive or dead status

Technology

DeadModel is an R package.

System Requirements

Requires R (version 3.3.0 or higher).

Dependencies

  • PatientLevelPrediction

Getting Started

  1. In R, use the following commands to download and install:
install.packages("devtools")
# If you dont have PatientLevelPrediction installed uncomment the 2 lines below and run:
#devtools::install_github("OHDSI/FeatureExtraction")
#devtools::install_github("OHDSI/PatientLevelPrediction")

# When you have PatientLevelPrediction installed run:
devtools::install_github("ohdsi-studies/DeadModel")

library(DeadModel)

#==============
# EXPLORE
#==============
# To view the model coefficients:
viewDeadCoefficients()

# To view the model performance in a shiny app
viewDeadShiny()

#==============
# APPLY
#==============
# INPUTS:
options(fftempdir = 'T:/fftemp')
dbms <- "pdw"
user <- NULL
pw <- NULL
server <- Sys.getenv('server')
port <- Sys.getenv('port')

connectionDetails <- DatabaseConnector::createConnectionDetails(dbms = dbms,
                                                              server = server,
                                                              user = user,
                                                              password = pw,
                                                              port = port)
outputLocation <- file.path(getwd(),'Death Risk')
cdmDatabaseSchema <- 'CDM database schema'
cohortDatabaseSchema <- 'cohort database schema'
cohortTable <- 'cohortTable containing people who you want to predict risk of being dead'
cohortId <- 'cohortDefinitionId for target cohort people in cohortTable'

outcomeId <- '(if externally validating model) cohortDefinitionId for dead people in cohortTable'

# Now run the following to check plp is working:
checkInstall(connectionDetails=connectionDetails)

# code to do prediction for each patient in the cohortTable with cohort_definition_id 1
prediction <- applyDeadModel(connectionDetails = connectionDetails,
                              cdmDatabaseSchema = cdmDatabaseSchema,
                              cohortDatabaseSchema = cohortDatabaseSchema,
                              oracleTempSchema = NULL,
                              cohortTable = cohortTable,
                              cohortId=cohortId)

# code to externall validate the model
validation <- validateDeadModel(connectionDetails = connectionDetails,
                   cdmDatabaseSchema = cdmDatabaseSchema,
                   cohortDatabaseSchema = cohortDatabaseSchema,
                   oracleTempSchema = NULL,
                   cohortTable = cohortTable,
                   targetId = cohortId,
                   outcomeId = outcomeId)
                   
# code to create custom covariate corresponding to smoking risk
e <- environment()
createDeadCovariate(covariateConstructionName = 'DeadRiskCov',
                                 analysisId = 967,
                                 eniviron=e)
#createDeadRiskCovCovariateSettings()

License

DeadModel is licensed under Apache License 2.0

Development

DeadModel is being developed in R Studio.

About

A package for implementing the death imputation model on OMOP CDM data

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages