outcomeSurvivalPlot: Plot the outcome incidence over time

View source: R/Plotting.R

outcomeSurvivalPlotR Documentation

Plot the outcome incidence over time

Description

Plot the outcome incidence over time

Usage

outcomeSurvivalPlot(
  plpData,
  outcomeId,
  populationSettings = createStudyPopulationSettings(binary = TRUE, includeAllOutcomes =
    TRUE, firstExposureOnly = FALSE, washoutPeriod = 0, removeSubjectsWithPriorOutcome =
    TRUE, priorOutcomeLookback = 99999, requireTimeAtRisk = FALSE, riskWindowStart = 1,
    startAnchor = "cohort start", riskWindowEnd = 3650, endAnchor = "cohort start"),
  riskTable = TRUE,
  confInt = TRUE,
  yLabel = "Fraction of those who are outcome free in target population"
)

Arguments

plpData

The plpData object returned by running getPlpData()

outcomeId

The cohort id corresponding to the outcome

populationSettings

The population settings created using createStudyPopulationSettings

riskTable

(binary) Whether to include a table at the bottom of the plot showing the number of people at risk over time

confInt

(binary) Whether to include a confidence interval

yLabel

(string) The label for the y-axis

Details

This creates a survival plot that can be used to pick a suitable time-at-risk period

Value

A ggsurvplot object

Examples


data("simulationProfile")
plpData <- simulatePlpData(simulationProfile, n=1000)
plotObject <- outcomeSurvivalPlot(plpData, outcomeId = 3)
print(plotObject)


OHDSI/PatientLevelPrediction documentation built on Feb. 14, 2025, 9:44 a.m.