brms_SummaryTable: Summarize brms-fit objects

Description Usage Arguments Details Value See Also Examples

View source: R/brms_SummaryTable.R

Description

Returns a summary table of model output from the brms package. Requires the brms package.

Usage

1
2
3
brms_SummaryTable(model, formatOptions = list(digits = 2, nsmall = 2),
  round = 2, astrology = FALSE, hype = FALSE, panderize = FALSE,
  justify = NULL, seed = 1234, ...)

Arguments

model

A brmsfit object

formatOptions

A named list(!) of options to pass to the format function

round

See round

astrology

Put asterisks next to effects whose credible interval does not contain 0

hype

Run one-sided hypothesis tests of whether effect is greater (less) than 0 if positive (negative)

panderize

Create a markdown summary table. Requires the pander package

justify

Additional argument to pass to pander

seed

Seed for hypothesis tests

...

Additional arguments to pass to summary.brmsfit

Details

This function creates a data.frame summary object for a brms package model object. As of now it only does so for the fixed effects part of the model. It will star 'significant' effects, add results from one-sided hypothesis tests, and allow additional formating options.

For hype = TRUE, the returned object contains a column indicating the posterior probability under the hypothesis against its alternative as noted in the hypothesis function of the brms package. Both the evidence ratio and probability are produced. Note that for effects near zero, the probability can be < .5 due to the posterior samples not being perfectly symmetric.

Value

A data.frame, or Pandoc markdown table if panderize=T.

See Also

summary.brmsfit hypothesis print.stanfit format round

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 

## Probit regression using the binomial family
library(brms)
n <- sample(1:10, 100, TRUE)  # number of trials
success <- rbinom(100, size = n, prob = 0.4)
x <- rnorm(100)
d <- data.frame(n, success, x)
fit4 <- brm(success | trials(n) ~ x, data=d, family = binomial("probit"))
summary(fit4)

library(lazerhawk)
brms_SummaryTable(fit4)
brms_SummaryTable(fit4, formatOptions=list(digits=5, nmsall=5))
brms_SummaryTable(fit4, astrology=TRUE, hype=TRUE)
brms_SummaryTable(fit4, astrology=TRUE, hype=TRUE, panderize=TRUE, justify='lrrrrclr')

## End(Not run)

mclark--/lazerhawk documentation built on July 17, 2018, 3:11 a.m.