selectSubjectsToInclude: Select subjects to include

Description Usage Arguments Details Value References

View source: R/SelectSubjects.R

Description

Select subjects to include

Usage

1
2
3
4
5
6
7
8
9
selectSubjectsToInclude(
  caseCrossoverData,
  outcomeId,
  firstOutcomeOnly = TRUE,
  washoutPeriod = 180,
  matchingCriteria = NULL,
  minAge = NULL,
  maxAge = NULL
)

Arguments

caseCrossoverData

An object of type caseCrossoverData as generated using the getDbCaseCrossoverData 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.

matchingCriteria

If provided, a case-time-control analysis will be performed and controls will be matched based on these criteria.

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

Subject to include in the study are selected for a specific outcome, optionally filtering using a washout period, restricting to first occurrences of the outcome only, and restricting on age. If matching criteria are provided controls will be selected for each case. These controls will be used to adjust for time trends in exposure, turning the analysis into a case-time-control analysis (Suissa, 1995).

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

observationPeriodStartDate

The observation period start date

References

Suissa S (1995) The case-time-control design. Epidemiology; 6:248-253.


OHDSI/CaseCrossover documentation built on Nov. 21, 2020, 7:03 a.m.