Type: Package
Title: Observational Health Data Sciences and Informatics Report Generator
Version: 2.0.2
Date: 2025-12-17
Maintainer: Jenna Reps <jreps@its.jnj.com>
Description: Extract results into R from the Observational Health Data Sciences and Informatics result database (see https://ohdsi.github.io/Strategus/results-schema/index.html) and generate reports/presentations via 'quarto' that summarize results in HTML format. Learn more about 'OhdsiReportGenerator' at https://ohdsi.github.io/OhdsiReportGenerator/.
License: Apache License 2.0
URL: https://ohdsi.github.io/OhdsiReportGenerator/, https://github.com/OHDSI/OhdsiReportGenerator
BugReports: https://github.com/OHDSI/OhdsiReportGenerator/issues
VignetteBuilder: knitr
Depends: R (≥ 3.3.0)
Imports: CirceR, DatabaseConnector, forestplot, dplyr, fs, ggplot2, ggpubr, gt, htmltools, kableExtra, ParallelLogger, quarto, reactable (≥ 0.4.4), rlang, rmarkdown, tibble, tidyr
Suggests: knitr, markdown, ResultModelManager, RSQLite, testthat
RoxygenNote: 7.3.2
Encoding: UTF-8
NeedsCompilation: no
Packaged: 2025-12-17 20:21:50 UTC; jreps
Author: Jenna Reps [aut, cre], Anthony Sena [aut]
Repository: CRAN
Date/Publication: 2025-12-17 23:00:19 UTC

OhdsiReportGenerator

Description

A package for extracting analyses results and creating reports.

Author(s)

Maintainer: Jenna Reps jreps@its.jnj.com

Authors:

See Also

Useful links:


addTarColumn

Description

Finds the four TAR columns and creates a new column called tar that pastes the columns into a nice string

Usage

addTarColumn(data)

Arguments

data

The data.frame with the individual TAR columns that you want to combine into one column

Details

Create a friendly single tar column

Value

The data data.frame object with the tar column added if seperate TAR columns are found

See Also

Other helper: formatBinaryCovariateName(), getExampleConnectionDetails(), getOutcomeTable(), getTargetTable(), kableDark(), printReactable(), removeSpaces()

Examples

addTarColumn(data.frame(
tarStartWith = 'cohort start',
tarStartOffset = 1,
tarEndWith = 'cohort start',
tarEndOffset = 0
))


createPredictionReport

Description

Generates a report for a given prediction model design

Usage

createPredictionReport(
  connectionHandler,
  schema,
  plpTablePrefix,
  databaseTablePrefix = plpTablePrefix,
  cgTablePrefix = plpTablePrefix,
  modelDesignId,
  output,
  intermediatesDir = file.path(tempdir(), "plp-prot"),
  outputFormat = "html_document"
)

Arguments

connectionHandler

The connection handler to the results database

schema

The result database schema

plpTablePrefix

The prediction table prefix

databaseTablePrefix

The database table name e.g., database_meta_data

cgTablePrefix

The cohort generator table prefix

modelDesignId

The model design ID of interest

output

The folder name where main.html will be save to

intermediatesDir

The work directory for rmarkdown

outputFormat

the type of outcome html_document or html_fragment

Details

Specify the connection handler to the result database, the schema name and the modelDesignId of interest to generate a html report summarizing the performance of models developed across databases.

Value

An named R list with the elements 'standard' and 'source'

See Also

Other Reporting: generateFullReport(), generatePresentation(), generatePresentationMultiple(), generateSummaryPredictionReport()


formatBinaryCovariateName

Description

Removes the long part of the covariate name to make it friendly

Usage

formatBinaryCovariateName(data)

Arguments

data

The data.frame with the covariateName column

Details

Makes the covariateName more friendly and shorter

Value

The data data.frame object with the ovariateName column changed to be more friendly

See Also

Other helper: addTarColumn(), getExampleConnectionDetails(), getOutcomeTable(), getTargetTable(), kableDark(), printReactable(), removeSpaces()

Examples

formatBinaryCovariateName(data.frame(
covariateName = c("fdfgfgf: dgdgff","made up test")
))


generateFullReport

Description

Generates a full report from a Strategus analysis

Usage

generateFullReport(
  server,
  username,
  password,
  dbms,
  resultsSchema = NULL,
  targetId = 1,
  outcomeIds = 3,
  comparatorIds = 2,
  indicationIds = "",
  cohortNames = c("target name", "outcome name", "comp name"),
  cohortIds = c(1, 3, 2),
  includeCI = TRUE,
  includeCharacterization = TRUE,
  includeCohortMethod = TRUE,
  includeSccs = TRUE,
  includePrediction = TRUE,
  webAPI = NULL,
  authMethod = NULL,
  webApiUsername = NULL,
  webApiPassword = NULL,
  outputLocation,
  outputName = paste0("full_report_", gsub(":", "_", gsub(" ", "_",
    as.character(date()))), ".html"),
  intermediateDir = tempdir(),
  pathToDriver = Sys.getenv("DATABASECONNECTOR_JAR_FOLDER")
)

Arguments

server

The server containing the result database

username

The username for an account that can access the result database

password

The password for an account that can access the result database

dbms

The dbms used to access the result database

resultsSchema

The result database schema

targetId

The cohort definition id for the target cohort

outcomeIds

The cohort definition id for the outcome

comparatorIds

(optional) The cohort definition id for any comparator cohorts. If NULL the report will find and include all possible comparators in the results if includeCohortMethod is TRUE.

indicationIds

The cohort definition id for any indication cohorts. If no indication use ” and if you want some indications plus no indication use c(”, indicationId1, indicationId2). Use 'Any' to include all children of targetId.

cohortNames

Friendly names for any cohort used in the study

cohortIds

The corresponding Ids for the cohortNames

includeCI

Whether to include the cohort incidence slides

includeCharacterization

Whether to include the characterization slides

includeCohortMethod

Whether to include the cohort method slides

includeSccs

Whether to include the self controlled case series slides

includePrediction

Whether to include the patient level prediction slides

webAPI

The ATLAS web API to use for the characterization index breakdown (set to NULL to not include)

authMethod

The authorization method for the webAPI

webApiUsername

The username for the webAPI authorization

webApiPassword

The password for the webAPI authorization

outputLocation

The file location and name to save the protocol

outputName

The name of the html protocol that is created

intermediateDir

The work directory for quarto

pathToDriver

Path to a folder containing the JDBC driver JAR files.

Details

Specify the connection details to the result database and the schema name to generate the full report.

Value

An html document containing the full results for the target, comparators, indications and outcomes specified.

See Also

Other Reporting: createPredictionReport(), generatePresentation(), generatePresentationMultiple(), generateSummaryPredictionReport()


generatePresentation

Description

Generates a presentation from a Strategus result

Usage

generatePresentation(
  server,
  username,
  password,
  dbms,
  resultsSchema = NULL,
  dbDetails = NULL,
  lead = "add name",
  team = "name 1 name 2",
  trigger = "A signal was found in spontaneous reports",
  safetyQuestion = "",
  objective = "",
  topline1 =
    "Very brief executive summary. You can copy-paste language from the conclusion.",
  topline2 =
    "If an estimation was requested but not feasible, this should be mentioned here.",
  topline3 =
    "If no estimation study was requested, this high-level summary might be skipped.",
  date = as.character(Sys.Date()),
  targetId = 1,
  outcomeIds = 3,
  cohortNames = c("target name", "outcome name"),
  cohortIds = c(1, 3),
  covariateIds = NULL,
  details = list(studyPeriod = "All Time", restrictions = "Age - None"),
  evaluationText = "",
  includeCI = TRUE,
  includeCharacterization = TRUE,
  includeCM = TRUE,
  includeSCCS = TRUE,
  includePLP = TRUE,
  outputLocation,
  outputName = paste0("presentation_", gsub(":", "_", gsub(" ", "_",
    as.character(date()))), ".html"),
  intermediateDir = fs::path_real(tempdir()),
  pathToDriver = Sys.getenv("DATABASECONNECTOR_JAR_FOLDER")
)

Arguments

server

The server containing the result database

username

The username for an account that can access the result database

password

The password for an account that can access the result database

dbms

The dbms used to access the result database

resultsSchema

The result database schema

dbDetails

(Optional) a data.frame with the columns:

lead

The name of the presenter

team

A vector or all the team members

trigger

What triggered the request

safetyQuestion

What is the general safety question

objective

What is the request/objective of the work.

topline1

add a very brief executive summary for the topline slide

topline2

add estimation summary here for the topline slide

topline3

add any other statement summary here for the topline slide

date

The date of the presentation

targetId

The cohort definition id for the target cohort

outcomeIds

The cohort definition id for the outcome

cohortNames

Friendly names for any cohort used in the study

cohortIds

The corresponding Ids for the cohortNames

covariateIds

A vector of covariateIds to include in the characterization

details

a list with the studyPeriod and restrictions

evaluationText

a list of bullet points for the evaluation

includeCI

Whether to include the cohort incidence slides

includeCharacterization

Whether to include the characterization slides

includeCM

Whether to include the cohort method slides

includeSCCS

Whether to include the self controlled case series slides

includePLP

Whether to include the patient level prediction slides

outputLocation

The file location and name to save the protocol

outputName

The name of the html protocol that is created

intermediateDir

The work directory for quarto

pathToDriver

Path to a folder containing the JDBC driver JAR files.

Details

Specify the connection details to the result database and the schema name to generate a presentation.

Value

An named R list with the elements 'standard' and 'source'

See Also

Other Reporting: createPredictionReport(), generateFullReport(), generatePresentationMultiple(), generateSummaryPredictionReport()


generatePresentationMultiple

Description

Generates a presentation from a Strategus result

Usage

generatePresentationMultiple(
  server,
  username,
  password,
  dbms,
  resultsSchema = NULL,
  targetId = 1,
  targetName = "target cohort",
  cmSubsetId = 2,
  sccsSubsetId = NULL,
  indicationName = NULL,
  outcomeIds = 3,
  outcomeNames = "outcome cohort",
  comparatorIds = c(2, 4),
  comparatorNames = c("comparator cohort 1", "comparator cohort 2"),
  covariateIds = NULL,
  details = list(studyPeriod = "All Time", restrictions = "Age - None"),
  title = "ASSURE 001 ...",
  lead = "add name",
  date = Sys.Date(),
  backgroundText = "",
  evaluationText = "",
  outputLocation,
  outputName = paste0("presentation_", gsub(":", "_", gsub(" ", "_",
    as.character(date()))), ".html"),
  intermediateDir = tempdir()
)

Arguments

server

The server containing the result database

username

The username for an account that can access the result database

password

The password for an account that can access the result database

dbms

The dbms used to access the result database

resultsSchema

The result database schema

targetId

The cohort definition id for the target cohort

targetName

A friendly name for the target cohort

cmSubsetId

Optional a subset ID for the cohort method/prediction results

sccsSubsetId

Optional a subset ID for the SCCS and characterization results

indicationName

A name for the indication if used or NULL

outcomeIds

The cohort definition id for the outcome

outcomeNames

Friendly names for the outcomes

comparatorIds

The cohort method comparator cohort id

comparatorNames

Friendly names for the comparators

covariateIds

A vector of covariateIds to include in the characterization

details

a list with the studyPeriod and restrictions

title

A title for the presentation

lead

The name of the presentor

date

The date of the presentation

backgroundText

a character with any background text

evaluationText

a list of bullet points for the evaluation

outputLocation

The file location and name to save the protocol

outputName

The name of the html protocol that is created

intermediateDir

The work directory for quarto

Details

Specify the connection details to the result database and the schema name to generate a presentation.

Value

An named R list with the elements 'standard' and 'source'

See Also

Other Reporting: createPredictionReport(), generateFullReport(), generatePresentation(), generateSummaryPredictionReport()


generateSummaryPredictionReport

Description

Generates a summary report for a given targets and outcomes

Usage

generateSummaryPredictionReport(
  connectionHandler,
  schema,
  targetIds = NULL,
  outcomeIds = NULL,
  plpTablePrefix = "plp_",
  databaseTablePrefix = "",
  cgTablePrefix = "cg_",
  outputFolder,
  outputFileName = "plp-summary.html",
  intermediatesDir = file.path(tempdir(), "plp-prot"),
  overwrite = FALSE
)

Arguments

connectionHandler

The connection handler to the results database

schema

The result database schema

targetIds

The target cohort IDs of interest

outcomeIds

The outcome cohort IDs of interest

plpTablePrefix

The prediction table prefix

databaseTablePrefix

The database table name e.g., database_meta_data

cgTablePrefix

The cohort generator table prefix

outputFolder

The folder name where file will be save to

outputFileName

The file name of the saved report

intermediatesDir

The work directory for rmarkdown

overwrite

whether to overwrite any existing file at the outputFolder/outputFileName

Details

Specify the connection handler to the result database, the schema name and the cohortId of interest to generate a html report summarizing the performance of prediction models in the database.

Value

A html file is created with the summary report

See Also

Other Reporting: createPredictionReport(), generateFullReport(), generatePresentation(), generatePresentationMultiple()


A function to extract case series characterization results

Description

A function to extract case series characterization results

Usage

getBinaryCaseSeries(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetId = NULL,
  outcomeId = NULL,
  databaseIds = NULL,
  riskWindowStart = NULL,
  riskWindowEnd = NULL,
  startAnchor = NULL,
  endAnchor = NULL,
  conceptIds = NULL,
  minVal = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetId

An integer corresponding to the target cohort ID

outcomeId

Am integer corresponding to the outcome cohort ID

databaseIds

(optional) One or more unique identifiers for the databases

riskWindowStart

(optional) A riskWindowStart to restrict to

riskWindowEnd

(optional) A riskWindowEnd to restrict to

startAnchor

(optional) A startAnchor to restrict to

endAnchor

(optional) An endAnchor to restrict to

conceptIds

(optional) An conceptIds to restrict to

minVal

(optional) the minimum averageVal to extract

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs

Value

A data.frame with the characterization case series results

See Also

Other Characterization: getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cs <- getBinaryCaseSeries(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetId = 1, 
  outcomeId = 3
)


A function to extract non-case and case binary characterization results

Description

A function to extract non-case and case binary characterization results

Usage

getBinaryRiskFactors(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetId = NULL,
  outcomeId = NULL,
  databaseId = NULL,
  analysisIds = c(3),
  riskWindowStart = NULL,
  riskWindowEnd = NULL,
  startAnchor = NULL,
  endAnchor = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetId

An integer corresponding to the target cohort ID

outcomeId

Am integer corresponding to the outcome cohort ID

databaseId

The database ID to restrict results to

analysisIds

The feature extraction analysis ID of interest (e.g., 201 is condition)

riskWindowStart

(optional) A vector of time-at-risk risk window starts to restrict to

riskWindowEnd

(optional) A vector of time-at-risk risk window ends to restrict to

startAnchor

(optional) A vector of time-at-risk start anchors to restrict to

endAnchor

(optional) A vector of time-at-risk end anchors to restrict to

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs

Value

A data.frame with the characterization results for the cases and non-cases

See Also

Other Characterization: getBinaryCaseSeries(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

rf <- getBinaryRiskFactors(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetId = 1, 
  outcomeId = 3
)


Extract the cohort method results

Description

This function extracts the single database cohort method estimates for results that can be unblinded and have a calibrated RR

Usage

getCMEstimation(
  connectionHandler,
  schema,
  cmTablePrefix = "cm_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  outcomeIds = NULL,
  comparatorIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cmTablePrefix

The prefix used for the cohort method results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetIds

A vector of integers corresponding to the target cohort IDs

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

comparatorIds

A vector of integers corresponding to the comparator cohort IDs

Details

Specify the connectionHandler, the schema and the target/comparator/outcome cohort IDs

Value

Returns a data.frame with the columns:

See Also

Other Estimation: getCmDiagnosticsData(), getCmMetaEstimation(), getCmNegativeControlEstimates(), getCmOutcomes(), getCmPropensityModel(), getCmTable(), getCmTargets(), getSccsDiagnosticsData(), getSccsEstimation(), getSccsMetaEstimation(), getSccsModel(), getSccsNegativeControlEstimates(), getSccsOutcomes(), getSccsTable(), getSccsTargets(), getSccsTimeToEvent(), plotCmEstimates(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cmEst <- getCMEstimation(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetIds = 1,
  outcomeIds = 3
)


Extract aggregate statistics of binary feature analysis IDs of interest for cases

Description

This function extracts the feature extraction results for cases corresponding to specified target and outcome cohorts.

Usage

getCaseBinaryFeatures(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  outcomeIds = NULL,
  databaseIds = NULL,
  analysisIds = c(3),
  riskWindowStart = NULL,
  riskWindowEnd = NULL,
  startAnchor = NULL,
  endAnchor = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetIds

A vector of integers corresponding to the target cohort IDs

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

databaseIds

(optional) A vector of database ids to restrict to

analysisIds

(optional) The feature extraction analysis ID of interest (e.g., 201 is condition)

riskWindowStart

(optional) A vector of time-at-risk risk window starts to restrict to

riskWindowEnd

(optional) A vector of time-at-risk risk window ends to restrict to

startAnchor

(optional) A vector of time-at-risk start anchors to restrict to

endAnchor

(optional) A vector of time-at-risk end anchors to restrict to

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs

Value

Returns a data.frame with the columns:

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cbf <- getCaseBinaryFeatures(
connectionHandler = connectionHandler, 
schema = 'main'
)


Extract aggregate statistics of continuous feature analysis IDs of interest for targets

Description

This function extracts the continuous feature extraction results for cases corresponding to specified target and outcome cohorts.

Usage

getCaseContinuousFeatures(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  outcomeIds = NULL,
  analysisIds = NULL,
  databaseIds = NULL,
  riskWindowStart = NULL,
  riskWindowEnd = NULL,
  startAnchor = NULL,
  endAnchor = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetIds

A vector of integers corresponding to the target cohort IDs

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

analysisIds

The feature extraction analysis ID of interest (e.g., 201 is condition)

databaseIds

(optional) A vector of database IDs to restrict results to

riskWindowStart

(optional) A vector of time-at-risk risk window starts to restrict to

riskWindowEnd

(optional) A vector of time-at-risk risk window ends to restrict to

startAnchor

(optional) A vector of time-at-risk start anchors to restrict to

endAnchor

(optional) A vector of time-at-risk end anchors to restrict to

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs

Value

Returns a data.frame with the columns:

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

ccf <- getCaseContinuousFeatures(
connectionHandler = connectionHandler, 
schema = 'main'
)


Extract the outcome cohort counts result

Description

This function extracts outcome cohort counts across databases in the results for specified target and outcome cohorts.

Usage

getCaseCounts(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  outcomeIds = NULL,
  databaseIds = NULL,
  riskWindowStart = NULL,
  riskWindowEnd = NULL,
  startAnchor = NULL,
  endAnchor = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetIds

A vector of integers corresponding to the target cohort IDs

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

databaseIds

(optional) A vector of database IDs to restrict to

riskWindowStart

(optional) A vector of time-at-risk risk window starts to restrict to

riskWindowEnd

(optional) A vector of time-at-risk risk window ends to restrict to

startAnchor

(optional) A vector of time-at-risk start anchors to restrict to

endAnchor

(optional) A vector of time-at-risk end anchors to restrict to

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs

Value

Returns a data.frame with the columns:

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cc <- getCaseCounts(
connectionHandler = connectionHandler, 
schema = 'main'
)


Extract aggregate statistics of binary feature analysis IDs of interest for targets

Description

This function extracts the feature extraction results for targets corresponding to specified target and outcome cohorts.

Usage

getCaseTargetBinaryFeatures(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  outcomeIds = NULL,
  databaseIds = NULL,
  analysisIds = c(3)
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetIds

A vector of integers corresponding to the target cohort IDs

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

databaseIds

(optional) A vector of database ids to restrict to

analysisIds

(optional) The feature extraction analysis ID of interest (e.g., 201 is condition)

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs

Value

Returns a data.frame with the columns:

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

tbf <- getCaseTargetBinaryFeatures (
connectionHandler = connectionHandler, 
schema = 'main'
)


Extract the target cohort counts result

Description

This function extracts target cohort counts across databases in the results for specified target and outcome cohorts.

Usage

getCaseTargetCounts(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  outcomeIds = NULL,
  databaseIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetIds

A vector of integers corresponding to the target cohort IDs

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

databaseIds

A vector of database IDs to restrict to

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs

Value

Returns a data.frame with the columns:

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

tc <- getCaseTargetCounts(
connectionHandler = connectionHandler, 
schema = 'main'
)


A function to extract cohort aggregate binary feature characterization results

Description

A function to extract cohort aggregate binary feature characterization results

Usage

getCharacterizationCohortBinary(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  databaseIds = NULL,
  minThreshold = 0
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetIds

A vector of integers corresponding to the target cohort IDs

databaseIds

(optional) One or more unique identifiers for the databases

minThreshold

The minimum fraction of the cohort that must have the feature for it to be reported

Details

Specify the connectionHandler, the schema and the target cohort ID and database id

Value

A data.frame with the characterization aggregate binary features for a specific cohort and database

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

binCohort <- getCharacterizationCohortBinary(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetIds = 1, 
  databaseIds = 'eunomia'
)


A function to extract cohort aggregate continuous feature characterization results

Description

A function to extract cohort aggregate continuous feature characterization results

Usage

getCharacterizationCohortContinuous(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  databaseIds = NULL,
  minThreshold = 0
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetIds

A vector of integers corresponding to the target cohort IDs

databaseIds

(optional) One or more unique identifiers for the databases

minThreshold

The minimum fraction of the cohort that must have the feature for it to be reported

Details

Specify the connectionHandler, the schema and the target cohort ID and database id

Value

A data.frame with the characterization aggregate continuous features for a specific cohort and database

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

conCohort <- getCharacterizationCohortContinuous(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetIds = 1, 
  databaseIds = 'eunomia'
)


Extract the binary age groups for the cases and targets

Description

This function extracts the age group feature extraction results for cases and targets corresponding to specified target and outcome cohorts.

Usage

getCharacterizationDemographics(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetId = NULL,
  outcomeId = NULL,
  type = "age"
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetId

An integer corresponding to the target cohort ID

outcomeId

Am integer corresponding to the outcome cohort ID

type

A character of 'age' or 'sex'

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs

Value

Returns a data.frame with the columns:

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

# example code

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

ageData <- getCharacterizationDemographics(
connectionHandler = connectionHandler, 
schema = 'main'
)


A function to extract the outcomes found in characterization

Description

A function to extract the outcomes found in characterization

Usage

getCharacterizationOutcomes(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  targetId = NULL,
  printTimes = FALSE,
  useDcrc = TRUE,
  useTte = TRUE,
  useRf = TRUE
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

targetId

An integer corresponding to the target cohort ID

printTimes

Print the time it takes to run each query

useDcrc

look for outcome in dechal-rechal results

useTte

look for outcome in time-to-event results

useRf

look for outcome in risk-factor results

Details

Specify the connectionHandler, the schema and the prefixes

Value

A data.frame with the characterization outcome cohort ids, names and which characterization analyses the cohorts are used in.

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cohorts <- getCharacterizationOutcomes(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


A function to extarct the targets found in characterization

Description

A function to extarct the targets found in characterization

Usage

getCharacterizationTargets(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  printTimes = FALSE,
  useTte = TRUE,
  useDcrc = TRUE,
  useRf = TRUE
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

printTimes

Print the time it takes to run each query

useTte

whether to determine what cohorts are used in time to event

useDcrc

whether to determine what cohorts are used in dechal-rechal

useRf

whether to determine what cohorts are used in risk factor

Details

Specify the connectionHandler, the schema and the prefixes

Value

A data.frame with the characterization target cohort ids, names and which characterization analyses the cohorts are used in.

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cohorts <- getCharacterizationTargets(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the cohort method diagostic results

Description

This function extracts the cohort method diagnostics that examine whether the analyses were sufficiently powered and checks for different types of bias.

Usage

getCmDiagnosticsData(
  connectionHandler,
  schema,
  cmTablePrefix = "cm_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  outcomeIds = NULL,
  comparatorIds = NULL,
  analysisIds = NULL,
  databaseIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cmTablePrefix

The prefix used for the cohort method results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetIds

A vector of integers corresponding to the target cohort IDs

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

comparatorIds

A vector of integers corresponding to the comparator cohort IDs

analysisIds

An optional vector of analysisIds to filter to

databaseIds

An optional vector of databaseIds to filter to

Details

Specify the connectionHandler, the schema and the target/comparator/outcome cohort IDs

Value

Returns a data.frame with the columns:

See Also

Other Estimation: getCMEstimation(), getCmMetaEstimation(), getCmNegativeControlEstimates(), getCmOutcomes(), getCmPropensityModel(), getCmTable(), getCmTargets(), getSccsDiagnosticsData(), getSccsEstimation(), getSccsMetaEstimation(), getSccsModel(), getSccsNegativeControlEstimates(), getSccsOutcomes(), getSccsTable(), getSccsTargets(), getSccsTimeToEvent(), plotCmEstimates(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cmDiag <- getCmDiagnosticsData(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetIds = 1,
  outcomeIds = 3
)


Extract the cohort method meta analysis results

Description

This function extracts any meta analysis estimation results for cohort method.

Usage

getCmMetaEstimation(
  connectionHandler,
  schema,
  cmTablePrefix = "cm_",
  cgTablePrefix = "cg_",
  esTablePrefix = "es_",
  targetIds = NULL,
  outcomeIds = NULL,
  comparatorIds = NULL,
  includeOneSidedP = TRUE
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cmTablePrefix

The prefix used for the cohort method results tables

cgTablePrefix

The prefix used for the cohort generator results tables

esTablePrefix

The prefix used for the evidence synthesis results tables

targetIds

A vector of integers corresponding to the target cohort IDs

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

comparatorIds

A vector of integers corresponding to the comparator cohort IDs

includeOneSidedP

This lets you extract from older results that do not have the one sided p by setting this to FALSE

Details

Specify the connectionHandler, the schema and the target/comparator/outcome cohort IDs

Value

Returns a data.frame with the columns:

See Also

Other Estimation: getCMEstimation(), getCmDiagnosticsData(), getCmNegativeControlEstimates(), getCmOutcomes(), getCmPropensityModel(), getCmTable(), getCmTargets(), getSccsDiagnosticsData(), getSccsEstimation(), getSccsMetaEstimation(), getSccsModel(), getSccsNegativeControlEstimates(), getSccsOutcomes(), getSccsTable(), getSccsTargets(), getSccsTimeToEvent(), plotCmEstimates(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cmMeta <- getCmMetaEstimation(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetIds = 1,
  outcomeIds = 3
)


Extract the cohort method negative controls

Description

This function extracts the cohort method negative control table.

Usage

getCmNegativeControlEstimates(
  connectionHandler,
  schema,
  cmTablePrefix = "cm_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  comparatorIds = NULL,
  analysisIds = NULL,
  databaseIds = NULL,
  excludePositiveControls = TRUE
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cmTablePrefix

The prefix used for the cohort method results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetIds

A vector of integers corresponding to the target cohort IDs

comparatorIds

A vector of integers corresponding to the comparator cohort IDs

analysisIds

the analysis IDs to restrict to

databaseIds

the database IDs to restrict to

excludePositiveControls

Whether to exclude the positive controls

Details

Specify the connectionHandler, the schema and optionally the target/comparator/outcome/analysis/database IDs

Value

Returns a data.frame with the cohort method negative controls

See Also

Other Estimation: getCMEstimation(), getCmDiagnosticsData(), getCmMetaEstimation(), getCmOutcomes(), getCmPropensityModel(), getCmTable(), getCmTargets(), getSccsDiagnosticsData(), getSccsEstimation(), getSccsMetaEstimation(), getSccsModel(), getSccsNegativeControlEstimates(), getSccsOutcomes(), getSccsTable(), getSccsTargets(), getSccsTimeToEvent(), plotCmEstimates(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cmNc <- getCmNegativeControlEstimates(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


A function to extract the outcomes found in cohort method

Description

A function to extract the outcomes found in cohort method

Usage

getCmOutcomes(
  connectionHandler,
  schema,
  cmTablePrefix = "cm_",
  cgTablePrefix = "cg_",
  targetId = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cmTablePrefix

The prefix used for the cohort method results tables

cgTablePrefix

The prefix used for the cohort generator results tables

targetId

An integer corresponding to the target cohort ID

Details

Specify the connectionHandler, the schema and the prefixes

Value

A data.frame with the cohort method outcome ids and names.

See Also

Other Estimation: getCMEstimation(), getCmDiagnosticsData(), getCmMetaEstimation(), getCmNegativeControlEstimates(), getCmPropensityModel(), getCmTable(), getCmTargets(), getSccsDiagnosticsData(), getSccsEstimation(), getSccsMetaEstimation(), getSccsModel(), getSccsNegativeControlEstimates(), getSccsOutcomes(), getSccsTable(), getSccsTargets(), getSccsTimeToEvent(), plotCmEstimates(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

outcomes <- getCmOutcomes(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the cohort method model

Description

This function extracts the cohort method model.

Usage

getCmPropensityModel(
  connectionHandler,
  schema,
  cmTablePrefix = "cm_",
  targetId = NULL,
  comparatorId = NULL,
  analysisId = NULL,
  databaseId = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cmTablePrefix

The prefix used for the cohort method results tables

targetId

An integer corresponding to the target cohort ID

comparatorId

the comparator ID of interest

analysisId

the analysis ID to restrict to

databaseId

the database ID to restrict to

Details

Specify the connectionHandler, the schema and optionally the target/comparator/analysis/database IDs

Value

Returns a data.frame with the cohort method model

See Also

Other Estimation: getCMEstimation(), getCmDiagnosticsData(), getCmMetaEstimation(), getCmNegativeControlEstimates(), getCmOutcomes(), getCmTable(), getCmTargets(), getSccsDiagnosticsData(), getSccsEstimation(), getSccsMetaEstimation(), getSccsModel(), getSccsNegativeControlEstimates(), getSccsOutcomes(), getSccsTable(), getSccsTargets(), getSccsTimeToEvent(), plotCmEstimates(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cmModel <- getCmPropensityModel(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the cohort method table specified

Description

This function extracts the specific cohort method table.

Usage

getCmTable(
  connectionHandler,
  schema,
  table = c("attrition", "follow_up_dist", "interaction_result", "covariate_balance",
    "kaplan_meier_dist", "likelihood_profile", "preference_score_dist",
    "propensity_model", "shared_covariate_balance")[1],
  cmTablePrefix = "cm_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  outcomeIds = NULL,
  comparatorIds = NULL,
  analysisIds = NULL,
  databaseIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

table

The result table to extract

cmTablePrefix

The prefix used for the cohort method results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetIds

A vector of integers corresponding to the target cohort IDs

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

comparatorIds

A vector of integers corresponding to the comparator cohort IDs

analysisIds

the analysis IDs to restrict to

databaseIds

the database IDs to restrict to

Details

Specify the connectionHandler, the schema and optionally the target/comparator/outcome/analysis/database IDs

Value

Returns a data.frame with the cohort method requested table

See Also

Other Estimation: getCMEstimation(), getCmDiagnosticsData(), getCmMetaEstimation(), getCmNegativeControlEstimates(), getCmOutcomes(), getCmPropensityModel(), getCmTargets(), getSccsDiagnosticsData(), getSccsEstimation(), getSccsMetaEstimation(), getSccsModel(), getSccsNegativeControlEstimates(), getSccsOutcomes(), getSccsTable(), getSccsTargets(), getSccsTimeToEvent(), plotCmEstimates(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cmTable <- getCmTable(
  connectionHandler = connectionHandler, 
  schema = 'main',
  table = 'attrition'
)


A function to extract the targets found in cohort method

Description

A function to extract the targets found in cohort method

Usage

getCmTargets(
  connectionHandler,
  schema,
  cmTablePrefix = "cm_",
  cgTablePrefix = "cg_"
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cmTablePrefix

The prefix used for the cohort method results tables

cgTablePrefix

The prefix used for the cohort generator results tables

Details

Specify the connectionHandler, the schema and the prefixes

Value

A data.frame with the cohort method target cohort ids and names.

See Also

Other Estimation: getCMEstimation(), getCmDiagnosticsData(), getCmMetaEstimation(), getCmNegativeControlEstimates(), getCmOutcomes(), getCmPropensityModel(), getCmTable(), getSccsDiagnosticsData(), getSccsEstimation(), getSccsMetaEstimation(), getSccsModel(), getSccsNegativeControlEstimates(), getSccsOutcomes(), getSccsTable(), getSccsTargets(), getSccsTimeToEvent(), plotCmEstimates(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cohorts <- getCmTargets(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the cohort counds

Description

This function extracts all cohort counts for the cohorts of interest.

Usage

getCohortCounts(
  connectionHandler,
  schema,
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  cohortIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

cohortIds

Optionally a list of cohortIds to restrict to

Details

Specify the connectionHandler, the schema and the cohort IDs

Value

Returns a data.frame with the cohort inclusion rules

See Also

Other Cohorts: getCohortDefinitions(), getCohortInclusionRules(), getCohortInclusionStats(), getCohortInclusionSummary(), getCohortMeta(), getCohortSubsetDefinitions(), processCohorts()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cohortMeta <- getCohortCounts(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the cohort definition details

Description

This function extracts all cohort definitions for the targets of interest.

Usage

getCohortDefinitions(
  connectionHandler,
  schema,
  cgTablePrefix = "cg_",
  targetIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cgTablePrefix

The prefix used for the cohort generator results tables

targetIds

A vector of integers corresponding to the target cohort IDs

Details

Specify the connectionHandler, the schema and the target cohort IDs

Value

Returns a data.frame with the cohort details

See Also

Other Cohorts: getCohortCounts(), getCohortInclusionRules(), getCohortInclusionStats(), getCohortInclusionSummary(), getCohortMeta(), getCohortSubsetDefinitions(), processCohorts()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cohortDef <- getCohortDefinitions(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the cohort inclusion rules

Description

This function extracts all cohort inclusion rules for the cohorts of interest.

Usage

getCohortInclusionRules(
  connectionHandler,
  schema,
  cgTablePrefix = "cg_",
  cohortIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cgTablePrefix

The prefix used for the cohort generator results tables

cohortIds

Optionally a list of cohortIds to restrict to

Details

Specify the connectionHandler, the schema and the cohort IDs

Value

Returns a data.frame with the cohort inclusion rules

See Also

Other Cohorts: getCohortCounts(), getCohortDefinitions(), getCohortInclusionStats(), getCohortInclusionSummary(), getCohortMeta(), getCohortSubsetDefinitions(), processCohorts()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cohortInclsuionsRules <- getCohortInclusionRules(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the cohort inclusion stats

Description

This function extracts all cohort inclusion stats for the cohorts of interest.

Usage

getCohortInclusionStats(
  connectionHandler,
  schema,
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  cohortIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

cohortIds

Optionally a list of cohortIds to restrict to

Details

Specify the connectionHandler, the schema and the cohort IDs

Value

Returns a data.frame with the cohort inclusion stats

See Also

Other Cohorts: getCohortCounts(), getCohortDefinitions(), getCohortInclusionRules(), getCohortInclusionSummary(), getCohortMeta(), getCohortSubsetDefinitions(), processCohorts()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cohortInclsuionsStats <- getCohortInclusionStats(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the cohort inclusion summary

Description

This function extracts all cohort inclusion summary for the cohorts of interest.

Usage

getCohortInclusionSummary(
  connectionHandler,
  schema,
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  cohortIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

cohortIds

Optionally a list of cohortIds to restrict to

Details

Specify the connectionHandler, the schema and the cohort IDs

Value

Returns a data.frame with the cohort inclusion rules

See Also

Other Cohorts: getCohortCounts(), getCohortDefinitions(), getCohortInclusionRules(), getCohortInclusionStats(), getCohortMeta(), getCohortSubsetDefinitions(), processCohorts()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cohortInclsuionsSummary <- getCohortInclusionSummary(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the cohort meta

Description

This function extracts all cohort meta for the cohorts of interest.

Usage

getCohortMeta(
  connectionHandler,
  schema,
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  cohortIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

cohortIds

Optionally a list of cohortIds to restrict to

Details

Specify the connectionHandler, the schema and the cohort IDs

Value

Returns a data.frame with the cohort inclusion rules

See Also

Other Cohorts: getCohortCounts(), getCohortDefinitions(), getCohortInclusionRules(), getCohortInclusionStats(), getCohortInclusionSummary(), getCohortSubsetDefinitions(), processCohorts()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cohortMeta <- getCohortMeta(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the cohort subset definition details

Description

This function extracts all cohort subset definitions for the subsets of interest.

Usage

getCohortSubsetDefinitions(
  connectionHandler,
  schema,
  cgTablePrefix = "cg_",
  subsetIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cgTablePrefix

The prefix used for the cohort generator results tables

subsetIds

A vector of subset cohort ids or NULL

Details

Specify the connectionHandler, the schema and the subset IDs

Value

Returns a data.frame with the cohort subset details

See Also

Other Cohorts: getCohortCounts(), getCohortDefinitions(), getCohortInclusionRules(), getCohortInclusionStats(), getCohortInclusionSummary(), getCohortMeta(), processCohorts()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

subsetDef <- getCohortSubsetDefinitions(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


A function to extract case series continuous feature characterization results

Description

A function to extract case series continuous feature characterization results

Usage

getContinuousCaseSeries(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetId = NULL,
  outcomeId = NULL,
  databaseIds = NULL,
  riskWindowStart = NULL,
  riskWindowEnd = NULL,
  startAnchor = NULL,
  endAnchor = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetId

An integer corresponding to the target cohort ID

outcomeId

Am integer corresponding to the outcome cohort ID

databaseIds

(optional) One or more unique identifiers for the databases

riskWindowStart

(optional) A riskWindowStart to restrict to

riskWindowEnd

(optional) A riskWindowEnd to restrict to

startAnchor

(optional) A startAnchor to restrict to

endAnchor

(optional) An endAnchor to restrict to

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs

Value

A data.frame with the characterization case series results

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cs <- getContinuousCaseSeries(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetId = 1, 
  outcomeId = 3
)


A function to extract non-case and case continuous characterization results

Description

A function to extract non-case and case continuous characterization results

Usage

getContinuousRiskFactors(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetId = NULL,
  outcomeId = NULL,
  analysisIds = NULL,
  databaseIds = NULL,
  riskWindowStart = NULL,
  riskWindowEnd = NULL,
  startAnchor = NULL,
  endAnchor = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetId

An integer corresponding to the target cohort ID

outcomeId

Am integer corresponding to the outcome cohort ID

analysisIds

The feature extraction analysis ID of interest (e.g., 201 is condition)

databaseIds

(optional) A vector of database IDs to restrict to

riskWindowStart

(optional) A vector of time-at-risk risk window starts to restrict to

riskWindowEnd

(optional) A vector of time-at-risk risk window ends to restrict to

startAnchor

(optional) A vector of time-at-risk start anchors to restrict to

endAnchor

(optional) A vector of time-at-risk end anchors to restrict to

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs

Value

A data.frame with the characterization results for the cases and non-cases

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

rf <- getContinuousRiskFactors(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetId = 1, 
  outcomeId = 3
)


Extract the database used in the analyses

Description

This function extracts the databases and their information.

Usage

getDatabaseDetails(
  connectionHandler,
  schema,
  databaseTable = "database_meta_data"
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

databaseTable

The name of the table with the database details (default 'database_meta_data')

Details

Specify the connectionHandler, the schema and the database table name

Value

Returns a data.frame with the columns:

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

ir <- getIncidenceRates(
connectionHandler = connectionHandler, 
schema = 'main'
)


Extract the dechallenge rechallenge results

Description

This function extracts all dechallenge rechallenge results across databases for specified target and outcome cohorts.

Usage

getDechallengeRechallenge(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  outcomeIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetIds

A vector of integers corresponding to the target cohort IDs

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs

Value

Returns a data.frame with the columns:

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

dcrc <- getDechallengeRechallenge(
connectionHandler = connectionHandler, 
schema = 'main'
)


A function to extract the failed dechallenge-rechallenge cases

Description

A function to extract the failed dechallenge-rechallenge cases

Usage

getDechallengeRechallengeFails(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  targetId = NULL,
  outcomeId = NULL,
  databaseId = NULL,
  dechallengeStopInterval = NULL,
  dechallengeEvaluationWindow = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

targetId

An integer corresponding to the target cohort ID

outcomeId

Am integer corresponding to the outcome cohort ID

databaseId

The unique identifier for the database of interest

dechallengeStopInterval

(optional) The maximum number of days between the outcome start and target end for an outcome to be flagged

dechallengeEvaluationWindow

(optional) The maximum number of days after the target restarts to see whether the outcome restarts

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs and database id

Value

A data.frame each failed dechallenge rechallenge exposures and outcomes

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

conCohort <- getDechallengeRechallengeFails(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetId = 1, 
  outcomeId = 3,
  databaseId = 'eunomia'
)


create a connection detail for an example OHDSI results database

Description

This returns an object of class 'ConnectionDetails' that lets you connect via 'DatabaseConnector::connect()' to the example result database.

Usage

getExampleConnectionDetails(exdir = tempdir())

Arguments

exdir

a directory to unzip the example result data into. Default is tempdir().

Details

Finds the location of the example result database in the package and calls 'DatabaseConnector::createConnectionDetails' to create a 'ConnectionDetails' object for connecting to the database.

Value

An object of class 'ConnectionDetails' with the details to connect to the example OHDSI result database

See Also

Other helper: addTarColumn(), formatBinaryCovariateName(), getOutcomeTable(), getTargetTable(), kableDark(), printReactable(), removeSpaces()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)


Extract the model performances per evaluation

Description

This function extracts the model performances per evaluation

Usage

getFullPredictionPerformances(
  connectionHandler,
  schema,
  plpTablePrefix = "plp_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  databaseTablePrefix = "",
  modelDesignId = NULL,
  developmentDatabaseId = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

plpTablePrefix

The prefix used for the patient level prediction results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

databaseTablePrefix

A prefix to the database table, either ” or 'plp_'

modelDesignId

The identifier for a model design to restrict results to

developmentDatabaseId

The identifier for the development database to restrict results to

Details

Specify the connectionHandler, the resultDatabaseSettings and (optionally) a modelDesignId and/or developmentDatabaseId to restrict models to

Value

Returns a data.frame with the columns:

See Also

Other Prediction: getPredictionAggregateTopPredictors(), getPredictionCohorts(), getPredictionCovariates(), getPredictionDiagnosticTable(), getPredictionDiagnostics(), getPredictionHyperParamSearch(), getPredictionIntercept(), getPredictionLift(), getPredictionModelDesigns(), getPredictionOutcomes(), getPredictionPerformanceTable(), getPredictionPerformances(), getPredictionTargets(), getPredictionTopPredictors()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

perf <- getFullPredictionPerformances(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


A function to extract the outcomes found in incidence

Description

A function to extract the outcomes found in incidence

Usage

getIncidenceOutcomes(
  connectionHandler,
  schema,
  ciTablePrefix = "ci_",
  cgTablePrefix = "cg_",
  targetId = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

ciTablePrefix

The prefix used for the cohort incidence results tables

cgTablePrefix

The prefix used for the cohort generator results tables

targetId

An integer corresponding to the target cohort ID

Details

Specify the connectionHandler, the schema and the prefixes

Value

A data.frame with the incidence outcome cohort ids and names

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

outcomes <- getIncidenceOutcomes(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the cohort incidence result

Description

This function extracts all incidence rates across databases in the results for specified target and outcome cohorts.

Usage

getIncidenceRates(
  connectionHandler,
  schema,
  ciTablePrefix = "ci_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  outcomeIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

ciTablePrefix

The prefix used for the cohort incidence results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetIds

A vector of integers corresponding to the target cohort IDs

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs

Value

Returns a data.frame with the columns:

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

ir <- getIncidenceRates(
connectionHandler = connectionHandler, 
schema = 'main'
)


A function to extract the targets found in incidence

Description

A function to extract the targets found in incidence

Usage

getIncidenceTargets(
  connectionHandler,
  schema,
  ciTablePrefix = "ci_",
  cgTablePrefix = "cg_"
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

ciTablePrefix

The prefix used for the cohort incidence results tables

cgTablePrefix

The prefix used for the cohort generator results tables

Details

Specify the connectionHandler, the schema and the prefixes

Value

A data.frame with the incidence target cohort ids and names

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cohorts <- getIncidenceTargets(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the outcome cohorts and where they are used in the analyses.

Description

This function extracts the outcome cohorts, the number of subjects/entries and where the cohort was used.

Usage

getOutcomeTable(
  connectionHandler,
  schema,
  cgTablePrefix = "cg_",
  cTablePrefix = "c_",
  ciTablePrefix = "ci_",
  cmTablePrefix = "cm_",
  sccsTablePrefix = "sccs_",
  plpTablePrefix = "plp_",
  databaseTable = "database_meta_data",
  targetId = NULL,
  getIncidenceInclusion = TRUE,
  getCharacterizationInclusion = TRUE,
  getPredictionInclusion = TRUE,
  getCohortMethodInclusion = TRUE,
  getSccsInclusion = TRUE,
  printTimes = FALSE
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cgTablePrefix

The prefix used for the cohort generator results tables

cTablePrefix

The prefix used for the characterization results tables

ciTablePrefix

The prefix used for the cohort incidence results tables

cmTablePrefix

The prefix used for the cohort method results tables

sccsTablePrefix

The prefix used for the cohort generator results tables

plpTablePrefix

The prefix used for the patient level prediction results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetId

An integer corresponding to the target cohort ID

getIncidenceInclusion

Whether to check usage of the cohort in incidence

getCharacterizationInclusion

Whether to check usage of the cohort in characterization

getPredictionInclusion

Whether to check usage of the cohort in prediction

getCohortMethodInclusion

Whether to check usage of the cohort in cohort method

getSccsInclusion

Whether to check usage of the cohort in SCCS

printTimes

whether to print the time it takes to run each SQL query

Details

Specify the connectionHandler, the schema and the table prefixes

Value

Returns a data.frame with the columns:

See Also

Other helper: addTarColumn(), formatBinaryCovariateName(), getExampleConnectionDetails(), getTargetTable(), kableDark(), printReactable(), removeSpaces()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

outcomeTable <- getOutcomeTable(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the top N predictors across a set of models

Description

This function extracts the top N predictors across models by finding the sum of the absolute coefficient value across models.

Usage

getPredictionAggregateTopPredictors(
  connectionHandler,
  schema,
  plpTablePrefix = "plp_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  modelDesignIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

plpTablePrefix

The prefix used for the patient level prediction results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

modelDesignIds

One or more model design IDs to restrict to

Details

Specify the connectionHandler, the resultDatabaseSettings and (optionally) any modelDesignIds to restrict to

Value

Returns a data.frame with the columns:

See Also

Other Prediction: getFullPredictionPerformances(), getPredictionCohorts(), getPredictionCovariates(), getPredictionDiagnosticTable(), getPredictionDiagnostics(), getPredictionHyperParamSearch(), getPredictionIntercept(), getPredictionLift(), getPredictionModelDesigns(), getPredictionOutcomes(), getPredictionPerformanceTable(), getPredictionPerformances(), getPredictionTargets(), getPredictionTopPredictors()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

topPreds <- getPredictionAggregateTopPredictors(
  connectionHandler = connectionHandler, 
  schema = 'main',
  modelDesignIds = c(1,2,5)
)


Extract a complete set of cohorts used in the prediction results

Description

This function extracts the target and outcome cohorts used to develop any model in the results

Usage

getPredictionCohorts(
  connectionHandler,
  schema,
  plpTablePrefix = "plp_",
  cgTablePrefix = "cg_"
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

plpTablePrefix

The prefix used for the patient level prediction results tables

cgTablePrefix

The prefix used for the cohort generator results tables

Details

Specify the connectionHandler, the resultDatabaseSettings and any targetIds or outcomeIds to restrict models to

Value

Returns a data.frame with the columns:

See Also

Other Prediction: getFullPredictionPerformances(), getPredictionAggregateTopPredictors(), getPredictionCovariates(), getPredictionDiagnosticTable(), getPredictionDiagnostics(), getPredictionHyperParamSearch(), getPredictionIntercept(), getPredictionLift(), getPredictionModelDesigns(), getPredictionOutcomes(), getPredictionPerformanceTable(), getPredictionPerformances(), getPredictionTargets(), getPredictionTopPredictors()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

predCohorts <- getPredictionCohorts(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract covariate summary details

Description

This function extracts the covariate summary details

Usage

getPredictionCovariates(
  connectionHandler,
  schema,
  plpTablePrefix = "plp_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  performanceIds = NULL,
  modelDesignIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

plpTablePrefix

The prefix used for the patient level prediction results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

performanceIds

(optional) restrict to the input performanceIds

modelDesignIds

(optional) restrict to the input modelDesignIds

Details

Specify the connectionHandler, the resultDatabaseSettings, the table of interest and (optionally) modelDesignIds/performanceIds to filter to

Value

Returns a data.frame with the specified table

See Also

Other Prediction: getFullPredictionPerformances(), getPredictionAggregateTopPredictors(), getPredictionCohorts(), getPredictionDiagnosticTable(), getPredictionDiagnostics(), getPredictionHyperParamSearch(), getPredictionIntercept(), getPredictionLift(), getPredictionModelDesigns(), getPredictionOutcomes(), getPredictionPerformanceTable(), getPredictionPerformances(), getPredictionTargets(), getPredictionTopPredictors()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

covs <- getPredictionCovariates(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract specific diagnostic table

Description

This function extracts the specified diagnostic table

Usage

getPredictionDiagnosticTable(
  connectionHandler,
  schema,
  plpTablePrefix = "plp_",
  table = "diagnostic_participants",
  diagnosticId = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

plpTablePrefix

The prefix used for the patient level prediction results tables

table

The table to extract

diagnosticId

(optional) restrict to the input diagnosticId

Details

Specify the connectionHandler, the resultDatabaseSettings, the table of interest and (optionally) a diagnosticId to filter to

Value

Returns a data.frame with the specified table

See Also

Other Prediction: getFullPredictionPerformances(), getPredictionAggregateTopPredictors(), getPredictionCohorts(), getPredictionCovariates(), getPredictionDiagnostics(), getPredictionHyperParamSearch(), getPredictionIntercept(), getPredictionLift(), getPredictionModelDesigns(), getPredictionOutcomes(), getPredictionPerformanceTable(), getPredictionPerformances(), getPredictionTargets(), getPredictionTopPredictors()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

diagPred <- getPredictionDiagnosticTable(
  connectionHandler = connectionHandler, 
  schema = 'main',
  table = 'diagnostic_predictors'
)


Extract the model design diagnostics for a specific development database

Description

This function extracts the PROBAST diagnostics

Usage

getPredictionDiagnostics(
  connectionHandler,
  schema,
  plpTablePrefix = "plp_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  modelDesignIds = NULL,
  threshold1_2 = 0.9
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

plpTablePrefix

The prefix used for the patient level prediction results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

modelDesignIds

The identifier for a model design to restrict results to

threshold1_2

A threshold for probast 1.2

Details

Specify the connectionHandler, the resultDatabaseSettings and (optionally) a modelDesignId and threshold1_2 a threshold value to use for the PROBAST 1.2

Value

Returns a data.frame with the columns:

See Also

Other Prediction: getFullPredictionPerformances(), getPredictionAggregateTopPredictors(), getPredictionCohorts(), getPredictionCovariates(), getPredictionDiagnosticTable(), getPredictionHyperParamSearch(), getPredictionIntercept(), getPredictionLift(), getPredictionModelDesigns(), getPredictionOutcomes(), getPredictionPerformanceTable(), getPredictionPerformances(), getPredictionTargets(), getPredictionTopPredictors()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

diag <- getPredictionDiagnostics(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract hyper parameters details

Description

This function extracts the hyper parameters details

Usage

getPredictionHyperParamSearch(
  connectionHandler,
  schema,
  plpTablePrefix = "plp_",
  modelDesignId = NULL,
  databaseId = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

plpTablePrefix

The prefix used for the patient level prediction results tables

modelDesignId

The identifier for a model design to restrict to

databaseId

The identifier for the development database to restrict to

Details

Specify the connectionHandler, the resultDatabaseSettings, the modelDesignId and the databaseId

Value

Returns a data.frame with the columns:

plus columns for all the hyperparameters and their values

See Also

Other Prediction: getFullPredictionPerformances(), getPredictionAggregateTopPredictors(), getPredictionCohorts(), getPredictionCovariates(), getPredictionDiagnosticTable(), getPredictionDiagnostics(), getPredictionIntercept(), getPredictionLift(), getPredictionModelDesigns(), getPredictionOutcomes(), getPredictionPerformanceTable(), getPredictionPerformances(), getPredictionTargets(), getPredictionTopPredictors()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

hyperParams <- getPredictionHyperParamSearch(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract model interception (for logistic regression)

Description

This function extracts the interception value

Usage

getPredictionIntercept(
  connectionHandler,
  schema,
  plpTablePrefix = "plp_",
  modelDesignId = NULL,
  databaseId = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

plpTablePrefix

The prefix used for the patient level prediction results tables

modelDesignId

The identifier for a model design to restrict to

databaseId

The identifier for the development database to restrict to

Details

Specify the connectionHandler, the resultDatabaseSettings, the modelDesignId and the databaseId

Value

Returns a single value corresponding to the model intercept or NULL if not a logistic regression model

See Also

Other Prediction: getFullPredictionPerformances(), getPredictionAggregateTopPredictors(), getPredictionCohorts(), getPredictionCovariates(), getPredictionDiagnosticTable(), getPredictionDiagnostics(), getPredictionHyperParamSearch(), getPredictionLift(), getPredictionModelDesigns(), getPredictionOutcomes(), getPredictionPerformanceTable(), getPredictionPerformances(), getPredictionTargets(), getPredictionTopPredictors()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

intercepts <- getPredictionIntercept(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract model lift at given model sensitivity

Description

This function extracts the model lift (PPV/outcomeRate)

Usage

getPredictionLift(
  connectionHandler,
  schema,
  plpTablePrefix = "plp_",
  modelDesignIds = NULL,
  performanceIds = NULL,
  sensitivity = 0.1
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

plpTablePrefix

The prefix used for the patient level prediction results tables

modelDesignIds

(optional) restrict to the input modelDesignIds

performanceIds

(optional) restrict to the input performanceIds

sensitivity

(default 0.1) the lift at the threshold with the sensitivity closest to this value is return

Details

Specify the connectionHandler, the resultDatabaseSettings and (optionally) modelDesignIds or performanceIds to filter to

Value

Returns a data.frame with the columns: modelDesignId, performanceId, evaluation, sensitivity, outcomeCount, positivePredictiveValue, outcomeRate and lift.

See Also

Other Prediction: getFullPredictionPerformances(), getPredictionAggregateTopPredictors(), getPredictionCohorts(), getPredictionCovariates(), getPredictionDiagnosticTable(), getPredictionDiagnostics(), getPredictionHyperParamSearch(), getPredictionIntercept(), getPredictionModelDesigns(), getPredictionOutcomes(), getPredictionPerformanceTable(), getPredictionPerformances(), getPredictionTargets(), getPredictionTopPredictors()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

liftsAt0p15 <- getPredictionLift(
  connectionHandler = connectionHandler, 
  schema = 'main', 
  sensitivity = 0.15
)


Extract the model designs from the prediction results

Description

This function extracts the model design settings

Usage

getPredictionModelDesigns(
  connectionHandler,
  schema,
  plpTablePrefix = "plp_",
  cgTablePrefix = "cg_",
  targetIds = NULL,
  outcomeIds = NULL,
  modelDesignIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

plpTablePrefix

The prefix used for the patient level prediction results tables

cgTablePrefix

The prefix used for the cohort generator results tables

targetIds

A vector of integers corresponding to the target cohort IDs

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

modelDesignIds

(Optional) A set of model design ids to restrict to

Details

Specify the connectionHandler, the resultDatabaseSettings and (optionally) any targetIds or outcomeIds to restrict model designs to

Value

Returns a data.frame with the columns:

See Also

Other Prediction: getFullPredictionPerformances(), getPredictionAggregateTopPredictors(), getPredictionCohorts(), getPredictionCovariates(), getPredictionDiagnosticTable(), getPredictionDiagnostics(), getPredictionHyperParamSearch(), getPredictionIntercept(), getPredictionLift(), getPredictionOutcomes(), getPredictionPerformanceTable(), getPredictionPerformances(), getPredictionTargets(), getPredictionTopPredictors()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

modDesign <- getPredictionModelDesigns(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


A function to extract the outcomes found in prediction

Description

A function to extract the outcomes found in prediction

Usage

getPredictionOutcomes(
  connectionHandler,
  schema,
  plpTablePrefix = "plp_",
  cgTablePrefix = "cg_",
  targetId = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

plpTablePrefix

The prefix used for the patient level prediction results tables

cgTablePrefix

The prefix used for the cohort generator results tables

targetId

An integer corresponding to the target cohort ID

Details

Specify the connectionHandler, the schema and the prefixes

Value

A data.frame with the prediction outcome cohort ids and names.

See Also

Other Prediction: getFullPredictionPerformances(), getPredictionAggregateTopPredictors(), getPredictionCohorts(), getPredictionCovariates(), getPredictionDiagnosticTable(), getPredictionDiagnostics(), getPredictionHyperParamSearch(), getPredictionIntercept(), getPredictionLift(), getPredictionModelDesigns(), getPredictionPerformanceTable(), getPredictionPerformances(), getPredictionTargets(), getPredictionTopPredictors()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

outcomes <- getPredictionOutcomes(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract specific results table

Description

This function extracts the specified table

Usage

getPredictionPerformanceTable(
  connectionHandler,
  schema,
  plpTablePrefix = "plp_",
  databaseTable = "database_meta_data",
  table = "attrition",
  modelDesignIds = NULL,
  performanceIds = NULL,
  evaluations = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

plpTablePrefix

The prefix used for the patient level prediction results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

table

The table to extract (covariate_summary, attrition, prediction_distribution, threshold_summary, calibration_summary, evaluation_statistics or demographic_summary )

modelDesignIds

(optional) restrict to the input modelDesignIds

performanceIds

(optional) restrict to the input performanceIds

evaluations

(optional) restrict to the type of evaluation (e.g., 'Test'/'Train'/'CV'/'Validation')

Details

Specify the connectionHandler, the resultDatabaseSettings, the table of interest and (optionally) a performanceId to filter to

Value

Returns a data.frame with the specified table

See Also

Other Prediction: getFullPredictionPerformances(), getPredictionAggregateTopPredictors(), getPredictionCohorts(), getPredictionCovariates(), getPredictionDiagnosticTable(), getPredictionDiagnostics(), getPredictionHyperParamSearch(), getPredictionIntercept(), getPredictionLift(), getPredictionModelDesigns(), getPredictionOutcomes(), getPredictionPerformances(), getPredictionTargets(), getPredictionTopPredictors()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

attrition <- getPredictionPerformanceTable(
  connectionHandler = connectionHandler, 
  schema = 'main',
  table = 'attrition'
)


Extract the model performances

Description

This function extracts the model performances

Usage

getPredictionPerformances(
  connectionHandler,
  schema,
  plpTablePrefix = "plp_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  databaseTablePrefix = "",
  modelDesignId = NULL,
  developmentDatabaseId = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

plpTablePrefix

The prefix used for the patient level prediction results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

databaseTablePrefix

A prefix to the database table, either ” or 'plp_'

modelDesignId

The identifier for a model design to restrict results to

developmentDatabaseId

The identifier for the development database to restrict results to

Details

Specify the connectionHandler, the resultDatabaseSettings and (optionally) a modelDesignId and/or developmentDatabaseId to restrict models to

Value

Returns a data.frame with the columns:

See Also

Other Prediction: getFullPredictionPerformances(), getPredictionAggregateTopPredictors(), getPredictionCohorts(), getPredictionCovariates(), getPredictionDiagnosticTable(), getPredictionDiagnostics(), getPredictionHyperParamSearch(), getPredictionIntercept(), getPredictionLift(), getPredictionModelDesigns(), getPredictionOutcomes(), getPredictionPerformanceTable(), getPredictionTargets(), getPredictionTopPredictors()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

perf <- getPredictionPerformances(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


A function to extarct the targets found in prediction

Description

A function to extarct the targets found in prediction

Usage

getPredictionTargets(
  connectionHandler,
  schema,
  plpTablePrefix = "plp_",
  cgTablePrefix = "cg_"
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

plpTablePrefix

The prefix used for the patient level prediction results tables

cgTablePrefix

The prefix used for the cohort generator results tables

Details

Specify the connectionHandler, the schema and the prefixes

Value

A data.frame with the prediction target cohort ids and names.

See Also

Other Prediction: getFullPredictionPerformances(), getPredictionAggregateTopPredictors(), getPredictionCohorts(), getPredictionCovariates(), getPredictionDiagnosticTable(), getPredictionDiagnostics(), getPredictionHyperParamSearch(), getPredictionIntercept(), getPredictionLift(), getPredictionModelDesigns(), getPredictionOutcomes(), getPredictionPerformanceTable(), getPredictionPerformances(), getPredictionTopPredictors()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cohorts <- getPredictionTargets(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the top N predictors per model

Description

This function extracts the top N predictors per model from the prediction results tables

Usage

getPredictionTopPredictors(
  connectionHandler,
  schema,
  plpTablePrefix = "plp_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  outcomeIds = NULL,
  numberPredictors = 100
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

plpTablePrefix

The prefix used for the patient level prediction results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The database table name

targetIds

A vector of integers corresponding to the target cohort IDs

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

numberPredictors

the number of predictors per model to return

Details

Specify the connectionHandler, the resultDatabaseSettings and (optionally) any targetIds or outcomeIds to restrict models to

Value

Returns a data.frame with the columns:

See Also

Other Prediction: getFullPredictionPerformances(), getPredictionAggregateTopPredictors(), getPredictionCohorts(), getPredictionCovariates(), getPredictionDiagnosticTable(), getPredictionDiagnostics(), getPredictionHyperParamSearch(), getPredictionIntercept(), getPredictionLift(), getPredictionModelDesigns(), getPredictionOutcomes(), getPredictionPerformanceTable(), getPredictionPerformances(), getPredictionTargets()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

topPreds <- getPredictionTopPredictors(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetIds = 1,
  outcomeIds = 3
)


Extract the self controlled case series (sccs) diagostic results

Description

This function extracts the sccs diagnostics that examine whether the analyses were sufficiently powered and checks for different types of bias.

Usage

getSccsDiagnosticsData(
  connectionHandler,
  schema,
  sccsTablePrefix = "sccs_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  outcomeIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

sccsTablePrefix

The prefix used for the cohort generator results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetIds

A vector of integers corresponding to the target cohort IDs

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs

Value

Returns a data.frame with the columns:

See Also

Other Estimation: getCMEstimation(), getCmDiagnosticsData(), getCmMetaEstimation(), getCmNegativeControlEstimates(), getCmOutcomes(), getCmPropensityModel(), getCmTable(), getCmTargets(), getSccsEstimation(), getSccsMetaEstimation(), getSccsModel(), getSccsNegativeControlEstimates(), getSccsOutcomes(), getSccsTable(), getSccsTargets(), getSccsTimeToEvent(), plotCmEstimates(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

sccsDiag <- getSccsDiagnosticsData(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetIds = 1,
  outcomeIds = 3
)


Extract the self controlled case series (sccs) results

Description

This function extracts the single database sccs estimates

Usage

getSccsEstimation(
  connectionHandler,
  schema,
  sccsTablePrefix = "sccs_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  outcomeIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

sccsTablePrefix

The prefix used for the cohort generator results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetIds

A vector of integers corresponding to the target cohort IDs

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs

Value

Returns a data.frame with the columns:

See Also

Other Estimation: getCMEstimation(), getCmDiagnosticsData(), getCmMetaEstimation(), getCmNegativeControlEstimates(), getCmOutcomes(), getCmPropensityModel(), getCmTable(), getCmTargets(), getSccsDiagnosticsData(), getSccsMetaEstimation(), getSccsModel(), getSccsNegativeControlEstimates(), getSccsOutcomes(), getSccsTable(), getSccsTargets(), getSccsTimeToEvent(), plotCmEstimates(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

sccsEst <- getSccsEstimation(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetIds = 1,
  outcomeIds = 3
)


Extract the self controlled case series (sccs) meta analysis results

Description

This function extracts any meta analysis estimation results for sccs.

Usage

getSccsMetaEstimation(
  connectionHandler,
  schema,
  sccsTablePrefix = "sccs_",
  cgTablePrefix = "cg_",
  esTablePrefix = "es_",
  targetIds = NULL,
  outcomeIds = NULL,
  includeOneSidedP = TRUE
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

sccsTablePrefix

The prefix used for the cohort generator results tables

cgTablePrefix

The prefix used for the cohort generator results tables

esTablePrefix

The prefix used for the evidence synthesis results tables

targetIds

A vector of integers corresponding to the target cohort IDs

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

includeOneSidedP

This lets you extract from older results that do not have the one sided p by setting this to FALSE

Details

Specify the connectionHandler, the schema and the targetoutcome cohort IDs

Value

Returns a data.frame with the columns:

#'

See Also

Other Estimation: getCMEstimation(), getCmDiagnosticsData(), getCmMetaEstimation(), getCmNegativeControlEstimates(), getCmOutcomes(), getCmPropensityModel(), getCmTable(), getCmTargets(), getSccsDiagnosticsData(), getSccsEstimation(), getSccsModel(), getSccsNegativeControlEstimates(), getSccsOutcomes(), getSccsTable(), getSccsTargets(), getSccsTimeToEvent(), plotCmEstimates(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

sccsMeta <- getSccsMetaEstimation(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetIds = 1,
  outcomeIds = 3
)


Extract the SCCS model table

Description

This function extracts the sccs model table.

Usage

getSccsModel(
  connectionHandler,
  schema,
  sccsTablePrefix = "sccs_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  exposureOutcomeSetIds = NULL,
  indicationIds = NULL,
  outcomeIds = NULL,
  databaseIds = NULL,
  analysisIds = NULL,
  targetIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

sccsTablePrefix

The prefix used for the cohort generator results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

exposureOutcomeSetIds

the exposureOutcomeIds to restrict to

indicationIds

The indications that the target was nested to

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

databaseIds

the database IDs to restrict to

analysisIds

the analysis IDs to restrict to

targetIds

A vector of integers corresponding to the target cohort IDs

Details

Specify the connectionHandler, the schema and optionally the target/outcome/analysis/database IDs

Value

Returns a data.frame with the SCCS model table

See Also

Other Estimation: getCMEstimation(), getCmDiagnosticsData(), getCmMetaEstimation(), getCmNegativeControlEstimates(), getCmOutcomes(), getCmPropensityModel(), getCmTable(), getCmTargets(), getSccsDiagnosticsData(), getSccsEstimation(), getSccsMetaEstimation(), getSccsNegativeControlEstimates(), getSccsOutcomes(), getSccsTable(), getSccsTargets(), getSccsTimeToEvent(), plotCmEstimates(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

sccsModels <- getSccsModel(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the SCCS negative controls

Description

This function extracts the sccs negative controls.

Usage

getSccsNegativeControlEstimates(
  connectionHandler,
  schema,
  sccsTablePrefix = "sccs_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  databaseIds = NULL,
  exposuresOutcomeSetIds = NULL,
  indicationIds = NULL,
  outcomeIds = NULL,
  targetIds = NULL,
  analysisIds = NULL,
  covariateIds = NULL,
  covariateAnalysisIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

sccsTablePrefix

The prefix used for the cohort generator results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

databaseIds

the database IDs to restrict to

exposuresOutcomeSetIds

the exposureOutcomeIds to restrict to

indicationIds

The indications that the target was nested to

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

targetIds

A vector of integers corresponding to the target cohort IDs

analysisIds

the analysis IDs to restrict to

covariateIds

the covariate IDs to restrict to

covariateAnalysisIds

the covariate analysis IDs to restrict to

Details

Specify the connectionHandler, the schema and optionally the target/outcome/analysis/database IDs

Value

Returns a data.frame with the SCCS negative controls

See Also

Other Estimation: getCMEstimation(), getCmDiagnosticsData(), getCmMetaEstimation(), getCmNegativeControlEstimates(), getCmOutcomes(), getCmPropensityModel(), getCmTable(), getCmTargets(), getSccsDiagnosticsData(), getSccsEstimation(), getSccsMetaEstimation(), getSccsModel(), getSccsOutcomes(), getSccsTable(), getSccsTargets(), getSccsTimeToEvent(), plotCmEstimates(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

sccsNcs <- getSccsNegativeControlEstimates(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


A function to extract the outcomes found in self controlled case series

Description

A function to extract the outcomes found in self controlled case series

Usage

getSccsOutcomes(
  connectionHandler,
  schema,
  sccsTablePrefix = "sccs_",
  cgTablePrefix = "cg_",
  targetId = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

sccsTablePrefix

The prefix used for the cohort generator results tables

cgTablePrefix

The prefix used for the cohort generator results tables

targetId

An integer corresponding to the target cohort ID

Details

Specify the connectionHandler, the schema and the prefixes

Value

A data.frame with the self controlled case series outcome ids and names.

See Also

Other Estimation: getCMEstimation(), getCmDiagnosticsData(), getCmMetaEstimation(), getCmNegativeControlEstimates(), getCmOutcomes(), getCmPropensityModel(), getCmTable(), getCmTargets(), getSccsDiagnosticsData(), getSccsEstimation(), getSccsMetaEstimation(), getSccsModel(), getSccsNegativeControlEstimates(), getSccsTable(), getSccsTargets(), getSccsTimeToEvent(), plotCmEstimates(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

outcomes <- getSccsOutcomes(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the SCCS table specified

Description

This function extracts the specific cohort method table.

Usage

getSccsTable(
  connectionHandler,
  schema,
  table = c("attrition", "time_trend", "event_dep_observation", "age_spanning",
    "calendar_time_spanning", "spline")[1],
  sccsTablePrefix = "sccs_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  indicationIds = NULL,
  outcomeIds = NULL,
  analysisIds = NULL,
  databaseIds = NULL,
  exposureOutcomeIds = NULL,
  covariateIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

table

The result table to extract

sccsTablePrefix

The prefix used for the cohort generator results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

indicationIds

The indications that the target was nested to

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

analysisIds

the analysis IDs to restrict to

databaseIds

the database IDs to restrict to

exposureOutcomeIds

the exposureOutcomeIds to restrict to

covariateIds

the covariateIds to restrict to

Details

Specify the connectionHandler, the schema and optionally the target/outcome/analysis/database IDs

Value

Returns a data.frame with the cohort method requested table

See Also

Other Estimation: getCMEstimation(), getCmDiagnosticsData(), getCmMetaEstimation(), getCmNegativeControlEstimates(), getCmOutcomes(), getCmPropensityModel(), getCmTable(), getCmTargets(), getSccsDiagnosticsData(), getSccsEstimation(), getSccsMetaEstimation(), getSccsModel(), getSccsNegativeControlEstimates(), getSccsOutcomes(), getSccsTargets(), getSccsTimeToEvent(), plotCmEstimates(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

sccsTable <- getSccsTable(
  connectionHandler = connectionHandler, 
  schema = 'main',
  table = 'attrition'
)


A function to extract the targets found in self controlled case series

Description

A function to extract the targets found in self controlled case series

Usage

getSccsTargets(
  connectionHandler,
  schema,
  sccsTablePrefix = "sccs_",
  cgTablePrefix = "cg_"
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

sccsTablePrefix

The prefix used for the cohort generator results tables

cgTablePrefix

The prefix used for the cohort generator results tables

Details

Specify the connectionHandler, the schema and the prefixes

Value

A data.frame with the self controlled case series target cohort ids and names.

See Also

Other Estimation: getCMEstimation(), getCmDiagnosticsData(), getCmMetaEstimation(), getCmNegativeControlEstimates(), getCmOutcomes(), getCmPropensityModel(), getCmTable(), getCmTargets(), getSccsDiagnosticsData(), getSccsEstimation(), getSccsMetaEstimation(), getSccsModel(), getSccsNegativeControlEstimates(), getSccsOutcomes(), getSccsTable(), getSccsTimeToEvent(), plotCmEstimates(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cohorts <- getSccsTargets(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the SCCS time-to-event

Description

This function extracts the SCCS time-to-event.

Usage

getSccsTimeToEvent(
  connectionHandler,
  schema,
  sccsTablePrefix = "sccs_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  databaseIds = NULL,
  exposuresOutcomeSetIds = NULL,
  indicationIds = NULL,
  outcomeIds = NULL,
  targetIds = NULL,
  analysisIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

sccsTablePrefix

The prefix used for the cohort generator results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

databaseIds

the database IDs to restrict to

exposuresOutcomeSetIds

the exposureOutcomeIds to restrict to

indicationIds

The indications that the target was nested to

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

targetIds

A vector of integers corresponding to the target cohort IDs

analysisIds

the analysis IDs to restrict to

Details

Specify the connectionHandler, the schema and optionally the target/outcome/analysis/database IDs

Value

Returns a data.frame with the SCCS time-to-event

See Also

Other Estimation: getCMEstimation(), getCmDiagnosticsData(), getCmMetaEstimation(), getCmNegativeControlEstimates(), getCmOutcomes(), getCmPropensityModel(), getCmTable(), getCmTargets(), getSccsDiagnosticsData(), getSccsEstimation(), getSccsMetaEstimation(), getSccsModel(), getSccsNegativeControlEstimates(), getSccsOutcomes(), getSccsTable(), getSccsTargets(), plotCmEstimates(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

getSccsTimeToEvent <- getSccsNegativeControlEstimates(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract aggregate statistics of binary feature analysis IDs of interest for targets (ignoring excluding people with prior outcome)

Description

This function extracts the feature extraction results for targets corresponding to specified target but does not exclude any patients with the outcome during the outcome washout (so it agnostic to the outcome of interest).

Usage

getTargetBinaryFeatures(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetId = NULL,
  databaseIds = NULL,
  analysisIds = NULL,
  conceptIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetId

An integer corresponding to the target cohort ID

databaseIds

(optional) A vector of database ids to restrict to

analysisIds

(optional) The feature extraction analysis ID of interest (e.g., 201 is condition)

conceptIds

(optional) The feature extraction concept ID of interest to restrict to

Details

Specify the connectionHandler, the schema and the target cohort IDs

Value

Returns a data.frame with the columns:

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

tbf <- getTargetBinaryFeatures (
connectionHandler = connectionHandler, 
schema = 'main',
targetId = 1
)


Extract aggregate statistics of continuous feature analysis IDs of interest for targets

Description

This function extracts the continuous feature extraction results for targets corresponding to specified target cohorts.

Usage

getTargetContinuousFeatures(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  analysisIds = NULL,
  databaseIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetIds

A vector of integers corresponding to the target cohort IDs

analysisIds

The feature extraction analysis ID of interest (e.g., 201 is condition)

databaseIds

(Optional) A vector of database IDs to restrict to

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs

Value

Returns a data.frame with the columns:

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTimeToEvent(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

tcf <- getTargetContinuousFeatures(
connectionHandler = connectionHandler, 
schema = 'main'
)


Extract the target cohorts and where they are used in the analyses.

Description

This function extracts the target cohorts, the number of subjects/entries and where the cohort was used.

Usage

getTargetTable(
  connectionHandler,
  schema,
  cgTablePrefix = "cg_",
  cTablePrefix = "c_",
  ciTablePrefix = "ci_",
  cmTablePrefix = "cm_",
  sccsTablePrefix = "sccs_",
  plpTablePrefix = "plp_",
  databaseTable = "database_meta_data",
  getIncidenceInclusion = TRUE,
  getCharacterizationInclusion = TRUE,
  getPredictionInclusion = TRUE,
  getCohortMethodInclusion = TRUE,
  getSccsInclusion = TRUE,
  printTimes = FALSE
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cgTablePrefix

The prefix used for the cohort generator results tables

cTablePrefix

The prefix used for the characterization results tables

ciTablePrefix

The prefix used for the cohort incidence results tables

cmTablePrefix

The prefix used for the cohort method results tables

sccsTablePrefix

The prefix used for the cohort generator results tables

plpTablePrefix

The prefix used for the patient level prediction results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

getIncidenceInclusion

Whether to check useage of the cohort in incidence

getCharacterizationInclusion

Whether to check useage of the cohort in characterization

getPredictionInclusion

Whether to check useage of the cohort in prediction

getCohortMethodInclusion

Whether to check useage of the cohort in cohort method

getSccsInclusion

Whether to check useage of the cohort in SCCS

printTimes

Whether to print how long each query took

Details

Specify the connectionHandler, the schema and the table prefixes

Value

Returns a data.frame with the columns:

See Also

Other helper: addTarColumn(), formatBinaryCovariateName(), getExampleConnectionDetails(), getOutcomeTable(), kableDark(), printReactable(), removeSpaces()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

targetTable <- getTargetTable(
  connectionHandler = connectionHandler, 
  schema = 'main'
)


Extract the time to event result

Description

This function extracts all time to event results across databases for specified target and outcome cohorts.

Usage

getTimeToEvent(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  outcomeIds = NULL
)

Arguments

connectionHandler

A connection handler that connects to the database and extracts sql queries. Create a connection handler via 'ResultModelManager::ConnectionHandler$new()'.

schema

The result database schema (e.g., 'main' for sqlite)

cTablePrefix

The prefix used for the characterization results tables

cgTablePrefix

The prefix used for the cohort generator results tables

databaseTable

The name of the table with the database details (default 'database_meta_data')

targetIds

A vector of integers corresponding to the target cohort IDs

outcomeIds

A vector of integers corresponding to the outcome cohort IDs

Details

Specify the connectionHandler, the schema and the target/outcome cohort IDs

Value

Returns a data.frame with the columns:

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), plotAgeDistributions(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

tte <- getTimeToEvent(
connectionHandler = connectionHandler, 
schema = 'main'
)
 

output a nicely formatted html table

Description

This returns a html table with the input data

Usage

kableDark(data, caption = NULL, position = NULL)

Arguments

data

A data.frame containing data of interest to show via a table

caption

A caption for the table

position

The position for the table if used within a quarto document. This is the "real" or say floating position for the latex table environment. The kable only puts tables in a table environment when a caption is provided. That is also the reason why your tables will be floating around if you specify captions for your table. Possible choices are h (here), t (top, default), b (bottom) and p (on a dedicated page).

Details

Input the data that you want to be shown via a dark html table

Value

An object of class 'knitr_kable' that will show the data via a nice html table

See Also

Other helper: addTarColumn(), formatBinaryCovariateName(), getExampleConnectionDetails(), getOutcomeTable(), getTargetTable(), printReactable(), removeSpaces()

Examples

kableDark(
data = data.frame(a=1,b=4), 
caption = 'A made up table to demonstrate this function',
position = 'h'
)


Plots the age distributions using the binary age groups

Description

Creates bar charts for the target and case age groups.

Usage

plotAgeDistributions(
  ageData,
  riskWindowStart = "1",
  riskWindowEnd = "365",
  startAnchor = "cohort start",
  endAnchor = "cohort start"
)

Arguments

ageData

The age data extracted using 'getCharacterizationDemographics(type = 'age')'

riskWindowStart

The time at risk window start

riskWindowEnd

The time at risk window end

startAnchor

The anchor for the time at risk start

endAnchor

The anchor for the time at risk end

Details

Input the data returned from 'getCharacterizationDemographics(type = 'age')' and the time-at-risk

Value

Returns a ggplot with the distributions

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotSexDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

ageData <- getCharacterizationDemographics(
connectionHandler = connectionHandler, 
schema = 'main',
targetId = 1, 
outcomeId = 3, 
type = 'age'
)

plotAgeDistributions(ageData = ageData)


Plots the cohort method results for one analysis

Description

Creates nice cohort method plots

Usage

plotCmEstimates(
  cmData,
  cmMeta = NULL,
  targetName,
  comparatorName,
  selectedAnalysisId
)

Arguments

cmData

The cohort method data

cmMeta

(optional) The cohort method evidence synthesis data

targetName

A friendly name for the target cohort

comparatorName

A friendly name for the comparator cohort

selectedAnalysisId

The analysis ID of interest to plot

Details

Input the cohort method data

Value

Returns a ggplot with the estimates

See Also

Other Estimation: getCMEstimation(), getCmDiagnosticsData(), getCmMetaEstimation(), getCmNegativeControlEstimates(), getCmOutcomes(), getCmPropensityModel(), getCmTable(), getCmTargets(), getSccsDiagnosticsData(), getSccsEstimation(), getSccsMetaEstimation(), getSccsModel(), getSccsNegativeControlEstimates(), getSccsOutcomes(), getSccsTable(), getSccsTargets(), getSccsTimeToEvent(), plotSccsEstimates()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cmEst <- getCMEstimation(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetIds = 1,
  outcomeIds = 3
)
plotCmEstimates(
  cmData = cmEst, 
  cmMeta = NULL, 
  targetName = 'target', 
  comparatorName = 'comp', 
  selectedAnalysisId = 1
)


Plots the self controlled case series results for one analysis

Description

Creates nice self controlled case series plots

Usage

plotSccsEstimates(sccsData, sccsMeta = NULL, targetName, selectedAnalysisId)

Arguments

sccsData

The self controlled case series data

sccsMeta

(optional) The self controlled case seriesd evidence synthesis data

targetName

A friendly name for the target cohort

selectedAnalysisId

The analysis ID of interest to plot

Details

Input the self controlled case series data

Value

Returns a ggplot with the estimates

See Also

Other Estimation: getCMEstimation(), getCmDiagnosticsData(), getCmMetaEstimation(), getCmNegativeControlEstimates(), getCmOutcomes(), getCmPropensityModel(), getCmTable(), getCmTargets(), getSccsDiagnosticsData(), getSccsEstimation(), getSccsMetaEstimation(), getSccsModel(), getSccsNegativeControlEstimates(), getSccsOutcomes(), getSccsTable(), getSccsTargets(), getSccsTimeToEvent(), plotCmEstimates()

Examples


conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

sccsEst <- getSccsEstimation(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetIds = 1,
  outcomeIds = 3
)
plotSccsEstimates(
  sccsData = sccsEst, 
  sccsMeta = NULL, 
  targetName = 'target', 
  selectedAnalysisId = 1
)


Plots the sex distributions using the sex features

Description

Creates bar charts for the target and case sex.

Usage

plotSexDistributions(
  sexData,
  riskWindowStart = "1",
  riskWindowEnd = "365",
  startAnchor = "cohort start",
  endAnchor = "cohort start"
)

Arguments

sexData

The sex data extracted using 'getCharacterizationDemographics(type = 'sex')'

riskWindowStart

The time at risk window start

riskWindowEnd

The time at risk window end

startAnchor

The anchor for the time at risk start

endAnchor

The anchor for the time at risk end

Details

Input the data returned from 'getCharacterizationDemographics(type = 'sex')' and the time-at-risk

Value

Returns a ggplot with the distributions

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotAgeDistributions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

sexData <- getCharacterizationDemographics(
  connectionHandler = connectionHandler, 
  schema = 'main',
  targetId = 1, 
  outcomeId = 3, 
  type = 'sex'
)
plotSexDistributions(sexData = sexData)


prints a reactable in a quarto document

Description

This function lets you print a reactable in a quarto document

Usage

printReactable(
  data,
  columns = NULL,
  groupBy = NULL,
  defaultPageSize = 20,
  highlight = TRUE,
  striped = TRUE,
  searchable = TRUE,
  filterable = TRUE
)

Arguments

data

The data for the table

columns

The formating for the columns

groupBy

A column or columns to group the table by

defaultPageSize

The number of rows in the table

highlight

whether to highlight the row of interest

striped

whether the rows change color to give a striped appearance

searchable

whether you can search in the table

filterable

whether you can filter the table

Details

Input the values for reactable::reactable

Value

Nothing but the html code for the table is printed (to be used in a quarto document)

See Also

Other helper: addTarColumn(), formatBinaryCovariateName(), getExampleConnectionDetails(), getOutcomeTable(), getTargetTable(), kableDark(), removeSpaces()

Examples

printReactable(
data = data.frame(a=1,b=4)
)


Extract the cohort parents and children cohorts (cohorts derieved from the parent cohort)

Description

This function lets you split the cohort data.frame into the parents and the children per parent.

Usage

processCohorts(cohort)

Arguments

cohort

The data.frame extracted using 'getCohortDefinitions()'

Details

Finds the parent cohorts and children cohorts

Value

Returns a list containing parents: a named vector of all the parent cohorts and cohortList: a list the same length as the parent vector with the first element containing all the children of the first parent cohort, the second element containing the children of the second parent, etc.

See Also

Other Cohorts: getCohortCounts(), getCohortDefinitions(), getCohortInclusionRules(), getCohortInclusionStats(), getCohortInclusionSummary(), getCohortMeta(), getCohortSubsetDefinitions()

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

cohortDef <- getCohortDefinitions(
  connectionHandler = connectionHandler, 
  schema = 'main'
)

parents <- processCohorts(cohortDef)


removeSpaces

Description

Removes spaces and replaces with under scroll

Usage

removeSpaces(x)

Arguments

x

A string

Details

Removes spaces and replaces with under scroll

Value

A string without spaces

See Also

Other helper: addTarColumn(), formatBinaryCovariateName(), getExampleConnectionDetails(), getOutcomeTable(), getTargetTable(), kableDark(), printReactable()

Examples

removeSpaces(' made up.   string')