View source: R/S3_integration.R
| plot.incubate_fit | R Documentation |
incubate_fitThe 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.
## S3 method for class 'incubate_fit'
plot(x, y, title, subtitle, xlim, ...)
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) |
This function requires the ggplot2-package to be installed.
# 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)")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.