Learn R Programming

OhdsiReportGenerator (version 2.0.2)

getIncidenceRates: 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
)

Value

Returns a data.frame with the columns:

  • databaseName the name of the database

  • databaseId the unique id of the database

  • targetName the target cohort name

  • targetId the target cohort unique identifier

  • outcomeName the outcome name

  • outcomeId the outcome unique identifier

  • (tar the friendly time-at-risk string)

  • cleanWindow clean windown around outcome

  • subgroupName name for the result subgroup

  • ageGroupName name for the result age group

  • genderName name for the result gender group

  • startYear name for the result start year

  • tarStartWith time at risk start reference

  • tarStartOffset time at risk start offset from reference

  • tarEndWith time at risk end reference

  • tarEndOffset time at risk end offset from reference

  • personsAtRiskPe persons at risk per event

  • personsAtRisk persons at risk

  • personDaysPe person days per event

  • personDays person days

  • personOutcomesPe person outcome per event

  • personOutcomes persons outcome

  • outcomesPe number of outcome per event

  • outcomes number of outcome

  • incidenceProportionP100p incidence proportion per 100 persons

  • incidenceRateP100py incidence rate per 100 person years

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

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

Run this code
conDet <- getExampleConnectionDetails()

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

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

Run the code above in your browser using DataLab