R/ppc_table.R

Defines functions ppc_table

Documented in ppc_table

#' Tabulate results of posterior predictive check
#'
#' Create a table of p-values using the results of the posterior predictive
#' checks
#'
#' @param ppc_results output from \code{\link{check_model}}
#'
#' @return matrix of p values
#'
#' @export
ppc_table <- function(ppc_results) {

    ppc_tab <- lapply(ppc_results, function(x) `$`(x, 'pvals'))
    ppc_tab <- do.call(rbind, ppc_tab)

    colnames(ppc_tab) <- get_host_names()

    ppc_tab

}
philpatton/cowbird documentation built on March 2, 2023, 3:05 a.m.