Skip to contents

Plot the log-likelihood curve for the incidence rate estimate

Usage

# S3 method for class 'seroincidence'
autoplot(object, log_x = FALSE, ...)

Arguments

object

a seroincidence object (from est.incidence())

log_x

should the x-axis be on a logarithmic scale (TRUE) or linear scale (FALSE, default)?

...

unused

Examples


library(dplyr)
library(ggplot2)

xs_data <- load_pop_data("https://osf.io/download//n6cp3/")

curve <- load_curve_params("https://osf.io/download/rtw5k/") %>%
  filter(antigen_iso %in% c("HlyE_IgA", "HlyE_IgG")) %>%
  slice(1:100, .by = antigen_iso) # Reduce dataset for the purposes of this example

noise <- load_noise_params("https://osf.io/download//hqy4v/")

est1 <- est.incidence(
  pop_data = xs_data %>% filter(Country == "Pakistan"),
  curve_param = curve,
  noise_param = noise %>% filter(Country == "Pakistan"),
  antigen_isos = c("HlyE_IgG", "HlyE_IgA"),
  build_graph = TRUE
)

# Plot the log-likelihood curve
autoplot(est1)