graph.loglik {serocalculator} | R Documentation |
Graph log-likelihood of data
Description
Graph log-likelihood of data
Usage
graph.loglik(
pop_data,
curve_params,
noise_params,
antigen_isos,
x = 10^seq(-3, 0, by = 0.1),
highlight_points = NULL,
highlight_point_names = "highlight_points",
log_x = FALSE,
previous_plot = NULL,
curve_label = paste(antigen_isos, collapse = " + "),
...
)
Arguments
pop_data |
a |
curve_params |
a
|
noise_params |
a
|
antigen_isos |
Character vector listing one or more antigen isotypes. Values must match |
x |
sequence of lambda values to graph |
highlight_points |
a possible highlighted value |
highlight_point_names |
labels for highlighted points |
log_x |
should the x-axis be on a logarithmic scale ( |
previous_plot |
if not NULL, the current data is added to the existing graph |
curve_label |
if not NULL, add a label for the curve |
... |
Arguments passed on to
|
Value
Examples
library(dplyr)
library(tibble)
# Load cross-sectional data
xs_data <- load_pop_data("https://osf.io/download//n6cp3/") %>%
clean_pop_data()
# Load curve parameters and subset for the purposes of this example
dmcmc <- load_curve_params("https://osf.io/download/rtw5k/") %>%
filter(antigen_iso %in% c("HlyE_IgA", "HlyE_IgG")) %>%
slice(1:100, .by = antigen_iso)
# Load noise parameters
cond <- tibble(
antigen_iso = c("HlyE_IgG", "HlyE_IgA"),
nu = c(0.5, 0.5), # Biologic noise (nu)
eps = c(0, 0), # M noise (eps)
y.low = c(1, 1), # Low cutoff (llod)
y.high = c(5e6, 5e6)) # High cutoff (y.high)
# Graph the log likelihood
lik_HlyE_IgA <- graph.loglik(
pop_data = xs_data,
curve_params = dmcmc,
noise_params = cond,
antigen_isos = "HlyE_IgA",
log_x = TRUE
)
lik_HlyE_IgA