summarise_samples: Create a tidy data frame of summarized posterior samples

Description Usage Arguments Value Examples

View source: R/tidy_summarise.R

Description

Create a tidy data frame of summarized posterior samples

Usage

1
2
summarise_samples(model, func = "mean", conf_level = 0.9,
  log_prob = FALSE)

Arguments

model

a stanfit object

func

the summary functions to evaluate, as a character vector

conf_level

the confidence levels to report confidence intervals in. Set as NULL to have no confidence intervals.

log_prob

whether to include the log probability values

Value

A data_frame where each row is one sample of one variable.

Examples

1
2
3
4
5
6
library(rstanarm)
library(ggplot2)
model <- stan_glm(hwy ~ displ, data = mpg,
                  chains = 1, iter = 200)
summarise_samples(model$stanfit, func = c("mean", "median"),
                  conf_level = c(0.5, 0.9))

wjones127/tidystan documentation built on May 28, 2017, 4:36 a.m.