View source: R/plot_seropositive.R
seroprevalence.fit | R Documentation |
Plot the mean and credible interval of the posterior of the seroprevalence, given an object of the class FOIfit
. See function seroprevalence
for plotting the seroprevalence from the data.
The function returns graphical objects that can be further modified.
seroprevalence.fit(
FOIfit,
individual_samples = 0,
age_class = 10,
YLIM = 1,
...
)
FOIfit |
The |
individual_samples |
Integer. Number of individual samples to be plotted additionally to the mean and the credible interval of the force of infection. The |
age_class |
Integer. Length of the age groups (in years). Used if |
YLIM |
Upper limit of the y-axis. Default = 1. The lower limit is set to 0. |
show_data |
Boolean. If |
A list of ggplot2
objects.
Nathanael Hoze nathanael.hoze@gmail.com
data <- simulate_SeroData( max_age = 50, epidemic_years = c(1976,1992), foi = c(0.2,0.3))
model <- FOImodel(type='outbreak', background=TRUE, K = 2)
Fit <- fit(model = model, data = data)
# plot the fraction of seropositive, with 2 individual samples
p <- seroprevalence.fit(Fit, individual_samples = 2,YLIM=0.2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.