Constructs an CohortPrevalenceAnalysis object with the specified settings.

createCohortPrevalenceAnalysis(
  analysisId,
  analysisTag = NULL,
  prevalentCohort,
  periodOfInterest,
  prevalenceType,
  minimumObservationLength = 0L,
  useOnlyFirstObservationPeriod = FALSE,
  multiplier = 100000L,
  strata = NULL,
  demographicConstraints = createDemographicConstraints(),
  populationCohort = NULL,
  outputTypes = "prevalence",
  drugConceptSets = NULL
)

Arguments

analysisId

Unique integer analysisId to identify the analysis (required).

prevalentCohort

A TargetCohort object specifying the cohort of interest (required).

periodOfInterest

A PeriodOfInterest object (required).

prevalenceType

A PrevalenceType object (required).

useOnlyFirstObservationPeriod

Logical: TRUE to restrict analysis to the first observation period (optional).

multiplier

Integer specifying prevalence multiplier (optional).

strata

Character string. Must be one, or some of: "age", "gender", "race" (optional).

demographicConstraints

a DemoConstraint object specifying the constraints of the population.

populationCohort

A PopulationCohort object specifying the population of interest on which to compute prevalence.

outputTypes

Character vector specifying which output types to generate. Defaults to "prevalence". Can include "incidence" and/or "drugs" for simultaneous generation using shared base tables. Warning: The "drugs" output type is experimental and should be used with caution. Results may be subject to future changes.

drugConceptSets

Optional list of Capr ConceptSetItems. Required if "drugs" is in outputTypes, otherwise ignored.

minimumObservationLength:

Integer specifying minimum observation length (optional).

Value

A CohortPrevalenceAnalysis R6 object.