Create settings for temporal covariates based on other cohorts

createCohortBasedTemporalCovariateSettings(
  analysisId,
  covariateCohortDatabaseSchema = NULL,
  covariateCohortTable = NULL,
  covariateCohorts,
  valueType = "binary",
  temporalStartDays = -365:-1,
  temporalEndDays = -365:-1,
  includedCovariateIds = c(),
  warnOnAnalysisIdOverlap = TRUE
)

Arguments

analysisId

A unique identifier for this analysis.

covariateCohortDatabaseSchema

The database schema where the cohorts used to define the covariates can be found. If set to NULL, the database schema will be guessed, for example using the same one as for the main cohorts.

covariateCohortTable

The table where the cohorts used to define the covariates can be found. If set to NULL, the table will be guessed, for example using the same one as for the main cohorts.

covariateCohorts

A data frame with at least two columns: 'cohortId' and 'cohortName'. The cohort ID should correspond to the cohort_definition_id of the cohort to use for creating a covariate.

valueType

Either 'binary' or 'count'. When valueType = 'count', the covariate value will be the number of times the cohort was observed in the window.

temporalStartDays

A list of integers representing the start of a time period, relative to the index date. 0 indicates the index date, -1 indicates the day before the index date, etc. The start day is included in the time period.

temporalEndDays

A list of integers representing the end of a time period, relative to the index date. 0 indicates the index date, -1 indicates the day before the index date, etc. The end day is included in the time period.

includedCovariateIds

A list of covariate IDs that should be restricted to.

warnOnAnalysisIdOverlap

Warn if the provided `analysisId` overlaps with any predefined analysis as available in the `createTemporalCovariateSettings()` function.

Value

An object of type covariateSettings, to be used in other functions.

Details

Creates an object specifying temporal covariates to be constructed based on the presence of other cohorts.