Test phenotype algorithms

testPhenotypeAlgorithm(
  phenotype,
  analysisName,
  runDateTime,
  connectionDetails,
  cutPoints = c("EV"),
  outFolder,
  exportFolder,
  evaluationCohortId = "main",
  phenotypeCohortId,
  cdmDatabaseSchema,
  databaseId,
  cohortDatabaseSchema,
  cohortTable,
  washoutPeriod = 0,
  splayPrior = 7,
  splayPost = 7
)

Arguments

phenotype

Name of the phenotype for analysis

analysisName

Name of the analysis

runDateTime

Starting date and time of the PheValuator run

connectionDetails

ConnectionDetails created using the function createConnectionDetails in the DatabaseConnector package.

cutPoints

A list of threshold predictions for the evaluations. Include "EV" for the expected value

outFolder

The folder where the cohort evaluation output files are written

exportFolder

The folder where the csv output files will be written.

evaluationCohortId

A string used to generate the file names for the evaluation cohort.

phenotypeCohortId

The ID of the cohort to evaluate in the specified cohort table.

cdmDatabaseSchema

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'.

databaseId

Name of the database in the analysis

cohortDatabaseSchema

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.

cohortTable

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.

washoutPeriod

The mininum required continuous observation time prior to index date for subjects within the cohort to test (Default = 0).

splayPrior

The number of days to allow for test phenotype visit date prior to evaluation date

splayPost

The number of days to allow for test phenotype visit date after evaluation date

Value

A dataframe with the results from the phenotype algorithm evaluation.

If 0.5 is included as a cutpoint, the data frame will have an attribute called 'misses', a dataframe with a sample of subject ids for TPs, FPs, TNs, and FNs for the 50 percent and over prediction threshold.

Details

This function will perform the phenotype algorithm evaluation using the evaluation cohort returned from createEvalCohort and the phenotype algorithm cohort specified