Skip to content

Latest commit

 

History

History
131 lines (94 loc) · 3.81 KB

README.md

File metadata and controls

131 lines (94 loc) · 3.81 KB

Cause-specific mortality prediction

Study Status: Design Finalized

  • Analytics use case(s): Patient-Level Prediction

  • Study type: Clinical Application

  • Tags: -

  • Study lead: Chungsoo Kim, Seng Chan You, Rae Woong Park*

  • Study lead forums tag: [Chungsoo_Kim], [SCYou], [RWPark]

  • Study start date: June 1, 2019

  • Study end date: -

  • Protocol: -

  • Publications: -

  • Results explorer: -

Development of cause of death predictive model using Patient-level prediction.

Instructions To Build Package

  • Build the package by clicking the R studio 'Install and Restart' button in the built tab

Instructions To Run Package

library(CauseSpecificMortality)
# USER INPUTS

#=======================
# The folder where the study intermediate and result files will be written:
outputFolder <- "./CauseSpecificMortalityResults"

# Specify where the temporary files (used by the ff package) will be created:
options(fftempdir = "location with space to save big data")

# Details for connecting to the server:
dbms <- "you dbms"
user <- 'your username'
pw <- 'your password'
server <- 'your server'
port <- 'your port'

connectionDetails <- DatabaseConnector::createConnectionDetails(dbms = dbms,
                                                                server = server,
                                                                user = user,
                                                                password = pw,
                                                                port = port)

# Add the database containing the OMOP CDM data
cdmDatabaseSchema <- 'cdm database schema'
# Add a database with read/write access as this is where the cohorts will be generated
cohortDatabaseSchema <- 'work database schema'

oracleTempSchema <- NULL

# table name where the cohorts will be generated
cohortTable <- 'CauseSpecificMortalityCohort'

# parameter settings for causePrediction 

#=======================

execute(connectionDetails = connectionDetails,
        cdmDatabaseSchema = cdmDatabaseSchema,
        cohortDatabaseSchema = cohortDatabaseSchema,
        cohortTable = cohortTable,
        outputFolder = outputFolder,
        createProtocol = F,
        createCohorts = T,
        runAnalyses = T,
        causePrediction = T,
        createResultsDoc = F,
        packageResults = F,
        createValidationPackage = F,
        minCellCount= 5)
  • TAR: 30, 60, 90, 180, 365 days

  • algorithm: values in caret package

  • If you want to run the causePrediction function with multiple parameter, you can use this

TAR <- c(30,60,90,180,365)
algorithm <- "rf"
lapply(TAR, function(x) causePrediction(outputFolder, TAR = x, algorithm))
  • You can then easily transport the trained models into a network validation study package by running :
  
  execute(connectionDetails = connectionDetails,
        cdmDatabaseSchema = cdmDatabaseSchema,
        cohortDatabaseSchema = cohortDatabaseSchema,
        cohortTable = cohortTable,
        outputFolder = outputFolder,
        createProtocol = F,
        createCohorts = F,
        runAnalyses = F,
        createResultsDoc = F,
        packageResults = F,
        createValidationPackage = T,
        minCellCount= 5)
  • To create the shiny app and view run:
  
populateShinyApp(resultDirectory = outputFolder,
                 minCellCount = 10, 
                 databaseName = 'friendly name'
                 ) 
        
viewShiny('CauseSpecificMortality')
  

Development status

Under development. Do not use