plot.vacalibration: Plot CSMF from a vacalibration object

View source: R/notcore_utils.r

plot.vacalibrationR Documentation

Plot CSMF from a vacalibration object

Description

Plot CSMF from a vacalibration object

Usage

## S3 method for class 'vacalibration'
plot(
  x,
  type = c("errorbar", "bar", "compare")[1],
  algorithm = NULL,
  uncalibrated = FALSE,
  top = 10,
  title = "Top CSMF Distribution",
  xlab = "Causes",
  ylab = "CSMF",
  horiz = TRUE,
  angle = 60,
  fill = "lightblue",
  fill_uncalibrated = "lightpink",
  err_width = 0.4,
  err_size = 0.6,
  point_size = 2,
  border = "black",
  bw = TRUE,
  plot_it = TRUE,
  ...
)

Arguments

x

Fitted "vacalibration" objects

type

An indicator of the type of chart to plot. "errorbar" for line plots of only the error bars on single population; "bar" for bar chart with error bars on single population; "compare" for line charts on multiple calibrated algorithms.

algorithm

Name or vector of names of algorithm(s) which limits the output to those specific results

uncalibrated

Logical (TRUE/FALSE) indicator for including the uncalibrated CSMF in the plots (not valid with type is set to "compare").

top

The number of top causes (in the calibrated CSMF) to plot. If results from multiple algorithms are included in the fitted "vacalibration" object and type is set to "compare", it will plot the union of the top causes in all algorithms.

title

Title of the plot.

xlab

Labels for the causes.

ylab

Labels for the CSMF values.

horiz

Logical indicator indicating if the bars are plotted horizontally.

angle

Angle of rotation for the texts on x axis when horiz is set to FALSE

fill

The color to fill the bars when type is set to "bar".

fill_uncalibrated

The color to fill the bars for the uncalibrated CSMFs when type is set to "bar".

err_width

Size of the error bars.

err_size

Thickness of the error bar lines.

point_size

Size of the points.

border

The color to color the borders of bars when type is set to "bar".

bw

Logical indicator for setting the theme of the plots to be black and white.

plot_it

Logical (TRUE/FALSE) indicating if the first plot should be rendered.

...

Not used.

Value

A list of plots for each algorithms included in the fitted "vacalibration" object.

Examples

## Not run: 
data(NeonatesVA5)
fit_insilico <- codeVA(NeonatesVA5)
insilico_prep <- prepCalibration(fit_insilico)
calib_insilico = vacalibration::vacalibration(va_data = insilico_prep,
                                              age_group = "neonate",
                                              country = "Mozambique")

fit_interva <- codeVA(NeonatesVA5, model = "InterVA", version = "5", write = FALSE)
interva_prep <- prepCalibration(fit_interva)
calib_interva = vacalibration::vacalibration(va_data = interva_prep,
                                             age_group = "neonate",
                                             country = "Mozambique")
                                             
two_fits <- prepCalibration(fit_insilico, fit_interva)
calib_ensemble = vacalibration::vacalibration(va_data = two_fits,
                                              age_group = "neonate",
                                              country = "Mozambique")
plot(calib_ensemble)

## End(Not run)

openVA documentation built on Nov. 5, 2025, 5:20 p.m.