selectControls: Select controls

View source: R/SelectControls.R

selectControlsR Documentation

Select controls

Description

Select controls

Usage

selectControls(
  caseData,
  outcomeId,
  firstOutcomeOnly = TRUE,
  washoutPeriod = 180,
  controlSelectionCriteria = createMatchingCriteria(),
  minAge = NULL,
  maxAge = NULL
)

Arguments

caseData

An object of type caseData as generated using the getDbCaseData function.

outcomeId

The outcome ID of the cases for which we need to pick controls.

firstOutcomeOnly

Use the first outcome per person?

washoutPeriod

Minimum required numbers of days of observation for inclusion as either case or control.

controlSelectionCriteria

Either a matchingCriteria object as generated using the createMatchingCriteria function, or a samplingCriteria object as generated using the createSamplingCriteria function.

minAge

Minimum age at which patient time will be included in the analysis. Note that information prior to the min age is still used to determine exposure status after the minimum age (e.g. when a prescription was started just prior to reaching the minimum age). Also, outcomes occurring before the minimum age is reached will be considered as prior outcomes when using first outcomes only. Age should be specified in years, but non-integer values are allowed. If not specified, no age restriction will be applied.

maxAge

Maximum age at which patient time will be included in the analysis. Age should be specified in years, but non-integer values are allowed. If not specified, no age restriction will be applied.

Details

Select controls either by individually matching controls to each case, or by random sampling controls from the (nested) population.

Value

A data frame with these columns:

personId

The person ID

indexDate

The index date

isCase

Is the person a case or a control?

stratumId

The ID linking cases and controls in a matched set (only available when matching)


OHDSI/CaseControl documentation built on July 15, 2022, 6:33 a.m.