testPhenotypeAlgorithm: Test phenotype algorithms

Description Usage Arguments Details Value

View source: R/TestPhenotype.R

Description

Test phenotype algorithms

Usage

1
2
3
4
5
testPhenotypeAlgorithm(connectionDetails, cutPoints = c(0.1, 0.2, 0.3,
  0.4, 0.5, "EV", 0.6, 0.7, 0.8, 0.9), evaluationOutputFileName,
  phenotypeCohortId, cdmShortName = "", phenotypeText = "",
  order = 1, modelText = "", xSpecCohort = "", xSensCohort = "",
  prevalenceCohort = "", cohortDatabaseSchema, cohortTable)

Arguments

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

evaluationOutputFileName

The full file name with path for the evaluation file

phenotypeCohortId

The number of the cohort of the phenotype algorithm to test

cdmShortName

A string to identify the CDM tested (Default = NULL)

phenotypeText

A string to identify the phenotype algorithm in the output file

order

The order of this algorithm for sorting in the output file (used when there are multiple phenotypes to test) (Default = 1)

modelText

Descriptive name for the model (Default = NULL)

xSpecCohort

The number of the "extremely specific (xSpec)" cohort definition id in the cohort table (for noisy positives) (Default = NULL)

xSensCohort

The number of the "extremely sensitive (xSens)" cohort definition id in the cohort table (used to exclude subjects from the base population) (Default = NULL)

prevalenceCohort

The number of the cohort definition id to determine the disease prevalence, (default=xSensCohort)

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.

Details

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

Value

A list containg 2 dataframes: 1) results - a dataframe with the results from the phenotype algorithm evaluation 2) misses - a dataframe with a sample of subject ids for TPs, FPs, TNs, and FNs for the 50 percent and over prediction threshold


OHDSI/PheValuator documentation built on Oct. 15, 2019, 6:49 p.m.