computeMdrr: Compute minimal detectable relative risk (MDRR)

View source: R/Mdrr.R

computeMdrrR Documentation

Compute minimal detectable relative risk (MDRR)

Description

computeMdrr computes the minimal detectable relative risk (MDRR) for drug-outcome pairs using a standard approach that stratifies by age and gender (Armstrong 1987).

Usage

computeMdrr(
  connectionDetails,
  oracleTempSchema = NULL,
  tempEmulationSchema = getOption("sqlRenderTempEmulationSchema"),
  cdmDatabaseSchema,
  exposureOutcomePairs,
  exposureDatabaseSchema = cdmDatabaseSchema,
  exposureTable = "drug_era",
  outcomeDatabaseSchema = cdmDatabaseSchema,
  outcomeTable = "condition_era",
  cdmVersion = "5"
)

Arguments

connectionDetails

An R object of type ConnectionDetails created using the function createConnectionDetails in the DatabaseConnector package.

oracleTempSchema

DEPRECATED: use 'tempEmulationSchema' instead.

tempEmulationSchema

Some database platforms like Oracle and Impala do not truly support temp tables. To emulate temp tables, provide a schema with write privileges where temp tables can be created.

cdmDatabaseSchema

Name of database schema that contains OMOP CDM and vocabulary.

exposureOutcomePairs

A data frame with at least two columns:

  • "exposureId" or "targetId" containing the drug_concept_ID or cohort_definition_id of the exposure variable

  • "outcomeId" containing the condition_concept_ID or cohort_definition_id of the outcome variable

exposureDatabaseSchema

The name of the database schema that is the location where the exposure data used to define the exposure cohorts is available. If exposureTable = DRUG_ERA, exposureDatabaseSchema is not used by assumed to be cdmSchema. Requires read permissions to this database.

exposureTable

The tablename that contains the exposure cohorts. If exposureTable <> DRUG_ERA, then expectation is exposureTable has format of COHORT table: COHORT_DEFINITION_ID, SUBJECT_ID, COHORT_START_DATE, COHORT_END_DATE.

outcomeDatabaseSchema

The name of the database schema that is the location where the data used to define the outcome cohorts is available. If exposureTable = CONDITION_ERA, exposureDatabaseSchema is not used by assumed to be cdmSchema. Requires read permissions to this database.

outcomeTable

The tablename that contains the outcome cohorts. If outcomeTable <> CONDITION_OCCURRENCE, then expectation is outcomeTable has format of COHORT table: COHORT_DEFINITION_ID, SUBJECT_ID, COHORT_START_DATE, COHORT_END_DATE.

cdmVersion

Define the OMOP CDM version used: currently support "4" and "5".

Value

A data frame containing the MDRRs for the given exposure-outcome pairs.

References

Armstrong B. A simple estimator of minimum detectable relative risk, sample size, or power in cohort studies. American journal of epidemiology. 1987; 126: 356-8.

Examples

## Not run: 
connectionDetails <- createConnectionDetails(
  dbms = "sql server",
  server = "RNDUSRDHIT07.jnj.com"
)
exposureOutcomePairs <- data.frame(
  exposureId = c(767410, 1314924, 907879),
  outcomeId = c(444382, 79106, 138825)
)
mdrrs <- computeMdrr(connectionDetails,
  "cdm_truven_mdcr",
  exposureOutcomePairs,
  outcomeTable = "condition_era"
)

## End(Not run)

OHDSI/MethodEvaluation documentation built on July 3, 2023, 1:25 p.m.