similarPlpData: Extract new plpData using plpModel settings use metadata in...

Description Usage Arguments Examples

View source: R/ApplyPlp.R

Description

Extract new plpData using plpModel settings use metadata in plpModel to extract similar data and population for new databases:

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
similarPlpData(
  plpModel = NULL,
  createCohorts = T,
  newConnectionDetails,
  newCdmDatabaseSchema = NULL,
  newCohortDatabaseSchema = NULL,
  newCohortTable = NULL,
  newCohortId = NULL,
  newOutcomeDatabaseSchema = NULL,
  newOutcomeTable = NULL,
  newOutcomeId = NULL,
  newOracleTempSchema = newCdmDatabaseSchema,
  sample = NULL,
  createPopulation = T
)

Arguments

plpModel

The trained PatientLevelPrediction model or object returned by runPlp()

createCohorts

Create the tables for the target and outcome - requires sql in the plpModel object

newConnectionDetails

The connectionDetails for the new database

newCdmDatabaseSchema

The database schema for the new CDM database

newCohortDatabaseSchema

The database schema where the cohort table is stored

newCohortTable

The table name of the cohort table

newCohortId

The cohort_definition_id for the cohort of at risk people

newOutcomeDatabaseSchema

The database schema where the outcome table is stored

newOutcomeTable

The table name of the outcome table

newOutcomeId

The cohort_definition_id for the outcome

newOracleTempSchema

The temp coracle schema

sample

The number of people to sample (default is NULL meaning use all data)

createPopulation

Whether to create the study population as well

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
# set the connection
connectionDetails <- DatabaseConnector::createConnectionDetails()
   
# load the model and data
plpModel <- loadPlpModel("C:/plpmodel")

# extract the new data in the 'newData.dbo' schema using the model settings 
newDataList <- similarPlpData(plpModel=plpModel, 
                              newConnectionDetails = connectionDetails,
                              newCdmDatabaseSchema = 'newData.dbo',
                              newCohortDatabaseSchema = 'newData.dbo',   
                              newCohortTable = 'cohort', 
                              newCohortId = 1, 
                              newOutcomeDatabaseSchema = 'newData.dbo', 
                              newOutcomeTable = 'outcome',     
                              newOutcomeId = 2)    
               
# get the prediction:
prediction <- applyModel(newDataList$population, newDataList$plpData, plpModel)$prediction

## End(Not run)

ted9219/CoDImputationHeart documentation built on Sept. 15, 2020, 11:30 a.m.