summary.seroincidence.by {serocalculator} | R Documentation |
Summary Method for "seroincidence.by"
Objects
Description
Calculate seroincidence from output of the seroincidence calculator
est.incidence.by()
.
Usage
## S3 method for class 'seroincidence.by'
summary(
object,
confidence_level = 0.95,
showDeviance = TRUE,
showConvergence = TRUE,
...
)
Arguments
object |
A dataframe containing output of function |
confidence_level |
desired confidence interval coverage probability |
showDeviance |
Logical flag ( |
showConvergence |
Logical flag ( |
... |
Additional arguments affecting the summary produced. |
Value
A summary.seroincidence.by
object, which is a tibble::tibble, with the following columns:
-
incidence.rate
maximum likelihood estimate oflambda
(seroincidence) -
CI.lwr
lower confidence bound for lambda -
CI.upr
upper confidence bound for lambda -
Deviance
(included ifshowDeviance = TRUE
) Negative log likelihood (NLL) at estimated (maximum likelihood)lambda
)-
nlm.convergence.code
(included ifshowConvergence = TRUE
) Convergence information returned bystats::nlm()
The object also has the following metadata (accessible throughbase::attr()
):
-
-
antigen_isos
Character vector with names of input antigen isotypes used inest.incidence.by()
-
Strata
Character with names of strata used inest.incidence.by()
Examples
library(dplyr)
xs_data <- load_pop_data("https://osf.io/download//n6cp3/")%>%
clean_pop_data()
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/")
# estimate seroincidence#'
est2 <- est.incidence.by(
strata = c("catchment"),
pop_data = xs_data %>% filter(Country == "Pakistan"),
curve_params = curve,
noise_params = noise %>% filter(Country == "Pakistan"),
antigen_isos = c("HlyE_IgG", "HlyE_IgA"),
#num_cores = 8 # Allow for parallel processing to decrease run time
)
# calculate summary statistics for the seroincidence object
summary(est2)