Skip to contents

plot_jags_dens() takes a list output from run_mod() to create density plots for each chain run in the mcmc estimation. Defaults will produce every combination of antigen/antibody, parameters, and stratifications, unless otherwise specified. Antigen/antibody combinations and stratifications will vary by analysis. The antibody dynamic curve includes the following parameters:

  • y0 = baseline antibody concentration

  • y1 = peak antibody concentration

  • t1 = time to peak

  • r = shape parameter

  • alpha = decay rate

Usage

plot_jags_dens(
  data,
  iso = unique(data$Iso_type),
  param = unique(data$Parameter),
  strat = unique(data$Stratification)
)

Arguments

data

A list outputted from run_mod().

iso

Specify character string to produce plots of only a specific antigen/antibody combination, entered with quotes. Default outputs all antigen/antibody combinations.

param

Specify character string to produce plots of only a specific parameter, entered with quotes. Options include:

  • alpha = posterior estimate of decay rate

  • r = posterior estimate of shape parameter

  • t1 = posterior estimate of time to peak

  • y0 = posterior estimate of baseline antibody concentration

  • y1 = posterior estimate of peak antibody concentration

strat

Specify character string to produce plots of specific stratification entered in quotes.

Value

A base::list() of ggplot2::ggplot() objects producing density plots for all the specified input.

Author

Sam Schildhauer

Examples


data <- serodynamics::nepal_sees_jags_output

# Specifying isotype and stratification for traceplot.
plot_jags_dens(
               data = data,
               iso = "HlyE_IgA",
               strat = "typhi")
#> $typhi
#> $typhi$HlyE_IgA

#> 
#>