Learn R Programming

PatientLevelPrediction (version 3.0.0)

evaluateExistingModel: evaluateExistingModel

Description

This function implements an existing model

Usage

evaluateExistingModel(modelTable, covariateTable, interceptTable = NULL,
  type = "score", covariateSettings, customCovariates = NULL,
  riskWindowStart = 1, addExposureDaysToEnd = F, riskWindowEnd = 365,
  requireTimeAtRisk = T, minTimeAtRisk = 364, includeAllOutcomes = T,
  removeSubjectsWithPriorOutcome = T, connectionDetails, cdmDatabaseSchema,
  cohortDatabaseSchema, cohortTable, cohortId, outcomeDatabaseSchema,
  outcomeTable, outcomeId, oracleTempSchema = cdmDatabaseSchema,
  modelName = "existingModel", calibrationPopulation = NULL)

Arguments

modelTable

The model covariates and scores

covariateTable

The mapping from model covariates to standard covariates

interceptTable

The model intercepts

type

Model type (score or logistic)

covariateSettings

The standard covariate settings (specify covariate lookback time)

customCovariates

A table of covariateId, sql (sql creates the custom covariate)

riskWindowStart

The day after index to start predicting the outcome

addExposureDaysToEnd

riskWindomEnd relative to the cohort end date instead of the cohort start date?

riskWindowEnd

The day after index to stop predicting the outcome

requireTimeAtRisk

Do you want to ignore people who leave the database some point between the riskWindowStart and riskWindowEnd

minTimeAtRisk

If requireTimeAtRisk is TRUE, how many days must they be observed before leaving to get included (default recommendation is all risk period: riskWindowEnd-riskWindowStart)

includeAllOutcomes

Setting this to TRUE means people with the outcome who leave the data during the risk period are still included, so only non-outcome people who leave during the risk period are removed

removeSubjectsWithPriorOutcome

Remove people from the target population if they have the outcome prior to target cohort start date

connectionDetails

The details to connect to the CDM

cdmDatabaseSchema

A string specifying the database containing the cdm

cohortDatabaseSchema

A string specifying the database containing the target cohorts

cohortTable

A string specifying the table containing the target cohorts

cohortId

An iteger specifying the cohort id for the target cohorts

outcomeDatabaseSchema

A string specifying the database containing the outcome cohorts

outcomeTable

A string specifying the table containing the outcome cohorts

outcomeId

An iteger specifying the cohort id for the outcome cohorts

oracleTempSchema

The temp oracle schema

modelName

The name of the model

calibrationPopulation

A data.frame of subjectId, cohortStartDate, indexes used to recalibrate the model on new data

Value

The performance of the existing model and prediction

Details

Implements an existing model and evaluates its performance