R/summary.eiRegBayes.R

Defines functions summary.eiRegBayes

summary.eiRegBayes <- function(object, CI = 0.95, ...){
  coef <- apply(object$draws, c(1,2), mean)
  se <- apply(object$draws, c(1,2), sd)
  cc <- apply(object$draws, c(1,2), quantile, c((1-CI)/2, 1-(1-CI)/2))
  
  quants <- matrix(cc, nrow = prod(dim(coef)[1:2]), ncol = 2, byrow = TRUE)
  nidx <- apply(expand.grid(dimnames(coef)), 1, paste, collapse = ".")
  tab <- cbind(c(coef), c(se), quants)
  colnames(tab) <- c("Mean", "Std. Dev.", rownames(cc))                     
  rownames(tab) <- nidx
  
  out <- list(call = object$call, coef = tab, sims = dim(object$draws)[3])
  class(out) <- "eiRegBayesSum"
  out
}

Try the eiPack package in your browser

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

eiPack documentation built on March 7, 2023, 7:04 p.m.