Create the evaluation cohort
createEvaluationCohort(
connectionDetails,
oracleTempSchema = NULL,
tempEmulationSchema = getOption("sqlRenderTempEmulationSchema"),
phenotype,
analysisName,
runDateTime,
databaseId,
xSpecCohortId,
daysFromxSpec = 0,
xSensCohortId,
prevalenceCohortId,
caseCohortId,
caseFirstOccurrenceOnly,
xSpecCohortSize = 5000,
cdmDatabaseSchema,
cohortDatabaseSchema,
cohortTable,
workDatabaseSchema,
covariateSettings = createDefaultCovariateSettings(excludedCovariateConceptIds = c(),
addDescendantsToExclude = TRUE),
modelPopulationCohortId = 0,
modelPopulationCohortIdStartDay = 0,
modelPopulationCohortIdEndDay = 0,
inclusionEvaluationCohortId = 0,
inclusionEvaluationDaysFromStart = 0,
inclusionEvaluationDaysFromEnd = 0,
duringInclusionEvaluationOnly = FALSE,
exclusionEvaluationCohortId = 0,
exclusionEvaluationDaysFromStart = 0,
exclusionEvaluationDaysFromEnd = 0,
priorModelToUse = NULL,
minimumOffsetFromStart = 365,
minimumOffsetFromEnd = 365,
modelBaseSampleSize = 25000,
baseSampleSize = 2e+06,
lowerAgeLimit = 0,
upperAgeLimit = 120,
visitLength = 0,
visitType = c(9201, 9202, 9203, 262, 581477),
gender = c(8507, 8532),
race = 0,
ethnicity = 0,
startDate = "19001010",
endDate = "21000101",
falsePositiveNegativeSubjects = 10,
cdmVersion = "5",
outFolder = getwd(),
exportFolder,
modelId = "main",
evaluationCohortId = "main",
excludeModelFromEvaluation = FALSE,
randomVisitTable = "",
removeSubjectsWithFutureDates = TRUE,
saveEvaluationCohortPlpData = FALSE
)
connectionDetails created using the function createConnectionDetails in the DatabaseConnector package.
DEPRECATED: use tempEmulationSchema
instead.
Some database platforms like Oracle and Impala do not truly support temp tables. To emulate temp tables, provide a schema with write privileges where temp tables can be created.
Name of the phenotype for analysis
Name of the analysis
Starting date and time of the PheValuator run
Name of the database in the analysis
The number of the "extremely specific (xSpec)" cohort definition id in the cohort table (for noisy positives).
Number of days allowed from xSpec condition until analyzed visit
The number of the "extremely sensitive (xSens)" cohort definition id in the cohort table (for noisy negatives).
The number of the cohort definition id to determine the disease prevalence.
The number of the cohort definition id to determine cases in the evaluation cohort
Set to true if only the first occurrence per subject in the case cohort is to be used
The recommended xSpec sample size to use in model (default = NULL)
The name of the database schema that contains the OMOP CDM instance. Requires read permissions to this database. On SQL Server, this should specifiy both the database and the schema, so for example 'cdm_instance.dbo'.
The name of the database schema that is the location where the cohort data used to define the at risk cohort is available. Requires read permissions to this database.
The tablename that contains the at risk cohort. The expectation is cohortTable has format of COHORT table: cohort_concept_id, SUBJECT_ID, COHORT_START_DATE, COHORT_END_DATE.
The name of the database schema that is the location where a table can be created and afterwards removed. Requires write permissions to this database.
A covariateSettings object as generated using createCovariateSettings().
The number of the cohort to be used as a base population for the model. If set to 0, the entire database population will be used.
The number of days relative to the mainPopulationCohortId cohort start date to begin including visits.
The number of days relative to the mainPopulationCohortId cohort start date to end including visits.
The number of the cohort of the population to be used to designate which visits are eligible to be in the evaluation cohort
The number of days from the cohort start date of the inclusionEvaluationCohortId to start eligible included visits
The number of days from the cohort start date of the inclusionEvaluationCohortId to end eligible included visits
Only include visits that are within the cohort start and end dates
The number of the cohort of the population to be used to designate which visits are NOT eligible to be in the evaluation cohort
The number of days from the cohort start date of the exclusionEvaluationCohortId to start ineligible included visits
The number of days from the cohort start date of the exclusionEvaluationCohortId to end ineligible included visits
folder where a previously developed model to use in analysis will be found
Minimum number of days to offset for the analysis visit from the start of the observation period
Minimum number of days to offset for the analysis visit from the end of the observation period
The number of non-xSpec subjects to include in the model
The maximum number of subjects in the evaluation cohort.
The lower age for subjects in the model.
The upper age for subjects in the model.
The minimum length of index visit for acute outcomes.
The concept_id for the visit type.
The gender(s) to be included.
The race(s) to be included.
The ethnicity(s) to be included.
The starting date for including subjects in the model.
The ending date for including subjects in the model.
Number of subjects to include for evaluating false positives and negatives
The CDM version of the database.
The folder where the output files will be written.
The folder where the csv output files will be written.
A string used to generate the file names for this model.
A string used to generate the file names for this evaluation cohort.
Should subjects used in the model be excluded from the evaluation cohort?
Table stored in work directory with pre-selected random visits in format of visit_occurrence table
For buggy data with data in the future: ignore subjects with dates in the future?
Should the large PLP file for the evaluation cohort be saved? To be used for debugging purposes.
Fits a diagnostic prediction model, and uses it to create an evaluation cohort with probabilities for the health outcome of interest.