Skip to contents

Generate example subset of the OMOP CDM for estimating incidence and prevalence

Usage

mockIncidencePrevalenceRef(
  personTable = NULL,
  observationPeriodTable = NULL,
  targetCohortTable = NULL,
  outcomeTable = NULL,
  sampleSize = 1,
  outPre = 1,
  seed = 444,
  ageBeta = NULL,
  genderBeta = NULL,
  intercept = NULL,
  earliestDateOfBirth = NULL,
  latestDateOfBirth = NULL,
  earliestObservationStartDate = NULL,
  latestObservationStartDate = NULL,
  minDaysToObservationEnd = NULL,
  maxDaysToObservationEnd = NULL,
  minOutcomeDays = 1,
  maxOutcomeDays = 10,
  maxOutcomes = 1
)

Arguments

personTable

A tibble in the format of the person table.

observationPeriodTable

A tibble in the format of the observation period table.

targetCohortTable

A tibble in the format of a cohort table which can be used for stratification

outcomeTable

A tibble in the format of a cohort table which can be used for outcomes

sampleSize

The number of unique patients.

outPre

The fraction of patients with an event.

seed

The seed for simulating the data set. Use the same seed to get same data set.

ageBeta

The beta for the standardised age in a logistic regression outcome model.

genderBeta

The beta for the gender flag in a logistic regression outcome model.

intercept

The beta for the intercept in a logistic regression outcome model.

earliestDateOfBirth

The earliest date of birth of a patient in person table.

latestDateOfBirth

The latest date of birth of a patient in person table.

earliestObservationStartDate

The earliest observation start date for patient format.

latestObservationStartDate

The latest observation start date for patient format.

minDaysToObservationEnd

The minimum number of days of the observational integer.

maxDaysToObservationEnd

The maximum number of days of the observation period integer.

minOutcomeDays

The minimum number of days of the outcome period default set to 1.

maxOutcomeDays

The maximum number of days of the outcome period default set to 10.

maxOutcomes

The maximum possible number of outcomes per person can have default set to 1.

Value

A cdm reference to a duckdb database with mock data.

Examples

# \donttest{
cdm <- mockIncidencePrevalenceRef(sampleSize = 100)
cdm
#> 
#> ── # OMOP CDM reference (duckdb) of mock ───────────────────────────────────────
#>omop tables: person, observation_period
#>cohort tables: target, outcome
#>achilles tables: -
#>other tables: -
# }