Skip to contents

This method visualizes outlier detection results for immunization indicators at subnational levels. The output plot depends on the selection_type:

  • 'region': Plots percent of non-outliers by year and region.

  • 'vaccine': Plots average non-outlier rate by year across all vaccines.

  • 'heat_map': Shows either a heatmap of all indicators (if indicator = NULL) or a single indicator by year and region.

Usage

# S3 method for class 'cd_outlier'
plot(
  x,
  selection_type = c("region", "vaccine", "heat_map"),
  indicator = NULL,
  ...
)

Arguments

x

A cd_outlier object containing pre-processed outlier data.

selection_type

One of "region", "vaccine", or "heat_map":

  • "region": Non-outlier rates for each region over time.

  • "vaccine": Average non-outlier rates for each vaccine over time.

  • "heat_map": Tile plot of indicators or a specific one.

indicator

Optional. One of the supported indicators ("opv1", "penta3", etc.) to visualize in the plot. If NULL and selection_type = "heat_map", all indicators will be shown.

...

Reserved for future use.

Value

A ggplot or plotly object depending on the selection type.

Details

  • Outliers are identified using the Hampel X84 method and summarized by indicator.

  • Region and vaccine plots show % non-outliers using a diverging gradient scale.

  • Heatmaps display the raw *_outlier5std values directly.

Examples

if (FALSE) { # \dontrun{
  # Region-level summary
  plot(outlier_data, selection_type = "region", indicator = "penta3")

  # Heatmap of all indicators
  plot(outlier_data, selection_type = "heat_map")

  # Heatmap of one indicator
  plot(outlier_data, selection_type = "heat_map", indicator = "bcg")
} # }