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
)
Name of the phenotype for analysis
Name of the analysis
Starting date and time of the PheValuator run
ConnectionDetails created using the function createConnectionDetails in the DatabaseConnector package.
A list of threshold predictions for the evaluations. Include "EV" for the expected value
The folder where the cohort evaluation output files are written
The folder where the csv output files will be written.
A string used to generate the file names for the evaluation cohort.
The ID of the cohort to evaluate in the specified cohort table.
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'.
Name of the database in the analysis
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 mininum required continuous observation time prior to index date for subjects within the cohort to test (Default = 0).
The number of days to allow for test phenotype visit date prior to evaluation date
The number of days to allow for test phenotype visit date after evaluation date
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.
This function will perform the phenotype algorithm evaluation using the evaluation cohort returned from createEvalCohort and the phenotype algorithm cohort specified