Learn R Programming

rprev (version 0.2.3)

plot.incidence: Visualise disease incidence.

Description

Plots a comparison between the smoothed daily incidence function and actual incidence.

Usage

"plot"(x, level = 0.95, ...)

Arguments

x
An incidence object.
level
The desired confidence interval width.
...
Arguments passed to plot.

Value

An object of class ggplot.

Details

This function generates a plot from the cumulative incidence object. The incidence rate per year of the registry is shown in red. Mean incidence rate is shown as a solid blue line, with the confidence interval shown in dashed blue lines. The smooth fitted to the cumulative incidence data is shown in green.

See Also

Other incidence functions: incidence_age_distribution, incidence, mean_incidence_rate, raw_incidence, test_incidence_fit, yearly_incidence

Examples

Run this code
data(prevsim)

## Not run: 
# inc <- incidence(prevsim$entrydate, population_size=1e6, start = "2004-01-30", num_reg_years = 9)
# 
# plot(inc)
# ## End(Not run)

Run the code above in your browser using DataLab