R/print.R

Defines functions print.bartcs

#' @exportS3Method
print.bartcs <- function(x, ...) {
  cat(
    "`bartcs` fit by `", x$model, "_bart()`",
    "\n\n", sep = ""
  )

  mat <- do.call("rbind", x$mcmc_list[, 1:3])
  df <- data.frame(
    mu = apply(mat, 2, mean),
    ci = t(apply(mat, 2, stats::quantile, c(0.025, 0.975)))
  )
  colnames(df) <- c("mean", "2.5%", "97.5%")
  print(df)
}

Try the bartcs package in your browser

Any scripts or data that you put into this service are public.

bartcs documentation built on June 22, 2024, 6:48 p.m.