Skip to contents

This function extracts the specified covariates for the specified targets

Usage

getBinaryTargetBaseline(
  connectionHandler,
  schema,
  cTablePrefix = "c_",
  cgTablePrefix = "cg_",
  databaseTable = "database_meta_data",
  targetIds = NULL,
  analysisIds = NULL,
  covariateIds = NULL,
  conceptIds = 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 analysisIds of the covariate to restrict results to

covariateIds

The covariateIds to restict results to

conceptIds

The conceptIds of the covariate to restrict results to

databaseIds

The databaseIds of the covariate to restrict results to

Value

Returns a data.frame with the columns:

  • databaseName the name of the database

  • databaseId the unique identifier of the database

  • targetName the target cohort name

  • targetId the target cohort unique identifier

  • minPriorObservation the

  • limitToFirstINDays the

  • covariateName the

  • covariateId the

  • analysisId the

  • sumValue the

  • averageValue the

Details

Specify the connectionHandler, the schema and the target cohort IDs

Examples

conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)
#> Connecting using SQLite driver

btb <- getBinaryTargetBaseline(
connectionHandler = connectionHandler, 
schema = 'main', 
targetIds = 1
)