Learn R Programming

OhdsiReportGenerator (version 2.0.2)

plotAgeDistributions: Plots the age distributions using the binary age groups

Description

Creates bar charts for the target and case age groups.

Usage

plotAgeDistributions(
  ageData,
  riskWindowStart = "1",
  riskWindowEnd = "365",
  startAnchor = "cohort start",
  endAnchor = "cohort start"
)

Value

Returns a ggplot with the distributions

Arguments

ageData

The age data extracted using 'getCharacterizationDemographics(type = 'age')'

riskWindowStart

The time at risk window start

riskWindowEnd

The time at risk window end

startAnchor

The anchor for the time at risk start

endAnchor

The anchor for the time at risk end

Details

Input the data returned from 'getCharacterizationDemographics(type = 'age')' and the time-at-risk

See Also

Other Characterization: getBinaryCaseSeries(), getBinaryRiskFactors(), getCaseBinaryFeatures(), getCaseContinuousFeatures(), getCaseCounts(), getCaseTargetBinaryFeatures(), getCaseTargetCounts(), getCharacterizationCohortBinary(), getCharacterizationCohortContinuous(), getCharacterizationDemographics(), getCharacterizationOutcomes(), getCharacterizationTargets(), getContinuousCaseSeries(), getContinuousRiskFactors(), getDechallengeRechallenge(), getDechallengeRechallengeFails(), getIncidenceOutcomes(), getIncidenceRates(), getIncidenceTargets(), getTargetBinaryFeatures(), getTargetContinuousFeatures(), getTimeToEvent(), plotSexDistributions()

Examples

Run this code
conDet <- getExampleConnectionDetails()

connectionHandler <- ResultModelManager::ConnectionHandler$new(conDet)

ageData <- getCharacterizationDemographics(
connectionHandler = connectionHandler, 
schema = 'main',
targetId = 1, 
outcomeId = 3, 
type = 'age'
)

plotAgeDistributions(ageData = ageData)

Run the code above in your browser using DataLab