plot.incubate_fit: Plot a fitted delay-model object of class 'incubate_fit'

View source: R/S3_integration.R

plot.incubate_fitR Documentation

Plot a fitted delay-model object of class incubate_fit

Description

The fitted delay-model is plotted together with a Kaplan-Meier survival curve. Optionally, a fit of a second delay-model can be added. When given, we do some preliminary checks that the two models do fit together.

Usage

## S3 method for class 'incubate_fit'
plot(x, y, title, subtitle, xlim, ...)

Arguments

x

a fitted delay-model

y

optionally, a second fitted delay-model

title

character. Optionally, provide a title to the plot.

subtitle

character. Optionally, provide a subtitle to the plot. By default the coefficients are shown.

xlim

numeric. Optionally, limits for the x-axis (time). If unspecified starts from 0 to last observation.

...

further arguments. Not in use here (it is required for generic plot function)

Details

This function requires the ggplot2-package to be installed.

Examples

# fit a delay-weibull model to serial interval times from historic measles outbreak data:
fm <- delay_model(survival::Surv(measles_sailer$serialInterval, measles_sailer$status),
                  distribution = "weibull", method = "MLEw")
plot(fm,
     title = "Serial interval times of measles",
     subtitle = "Delay-Weibull model fit using weighted MLE (MLEw)")


incubate documentation built on Nov. 22, 2026, 1:07 a.m.