plotEventToCalendarTime: Plot the ratio of observed to expected events over calendar...

View source: R/Plots.R

plotEventToCalendarTimeR Documentation

Plot the ratio of observed to expected events over calendar time.

Description

Plot the ratio of observed to expected events over calendar time.

Usage

plotEventToCalendarTime(
  studyPopulation,
  sccsModel = NULL,
  title = NULL,
  fileName = NULL
)

Arguments

studyPopulation

An object created using the createStudyPopulation() function.

sccsModel

Optional: A fitted SCCS model as created using fitSccsModel(). If the model contains splines for seasonality and or calendar time a panel will be added with outcome counts adjusted for these splines.

title

Optional: the main title for the plot

fileName

Name of the file where the plot should be saved, for example 'plot.png'. See the function ggplot2::ggsave() for supported file formats.

Details

Plot the ratio of observed to expected events over calendar time. The expected count expected rate considers which persons were observed during that month, and if specified in the model, the adjustment for season and calendar time.

Value

A ggplot object. Use the ggplot2::ggsave() function to save to file in a different format.


OHDSI/SelfControlledCaseSeries documentation built on Sept. 7, 2024, 8:24 a.m.