createCaseControlData: Create case-control data

View source: R/CreateCaseControlData.R

createCaseControlDataR Documentation

Create case-control data

Description

Create case-control data

Usage

createCaseControlData(
  caseControlsExposure,
  exposureId,
  firstExposureOnly = FALSE,
  riskWindowStart = 0,
  riskWindowEnd = 0,
  exposureWashoutPeriod = 0
)

Arguments

caseControlsExposure

An object of type caseControlsExposure as created using the getDbExposureData function.

exposureId

The identifier of the exposure.

firstExposureOnly

Should only the first exposure per subject be included?

riskWindowStart

The start of the risk window (in days) relative to the index date. This number should be non-positive.

riskWindowEnd

The end of the risk window (in days) relative to the index date. This number should be non-positive.

exposureWashoutPeriod

Minimum required numbers of days of observation for inclusion of an exposure.

Details

For each case and control, assesses whether exposure takes place within the risk window. The output can be directly used in a conditional logistic regression.

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

exposed

Was the subject exposed during the risk window?


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