Skip to content

Commit

Permalink
examples
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jul 1, 2023
1 parent b133bf7 commit 8c3b60e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
13 changes: 6 additions & 7 deletions R/hdi.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,29 +83,28 @@
#'
#' posterior <- rnorm(1000)
#' hdi(posterior, ci = 0.89)
#' hdi(posterior, ci = c(.80, .90, .95))
#' hdi(posterior, ci = c(0.80, 0.90, 0.95))
#'
#' df <- data.frame(replicate(4, rnorm(100)))
#' hdi(df)
#' hdi(df, ci = c(.80, .90, .95))
#' bayestestR::hdi(iris[1:4])
#' bayestestR::hdi(iris[1:4], ci = c(0.80, 0.90, 0.95))
#' \dontrun{
#' library(rstanarm)
#' model <- stan_glm(mpg ~ wt + gear, data = mtcars, chains = 2, iter = 200, refresh = 0)
#' hdi(model)
#' hdi(model, ci = c(.80, .90, .95))
#' hdi(model, ci = c(0.80, 0.90, 0.95))
#'
#' library(emmeans)
#' hdi(emtrends(model, ~1, "wt", data = mtcars))
#'
#' library(brms)
#' model <- brms::brm(mpg ~ wt + cyl, data = mtcars)
#' hdi(model)
#' hdi(model, ci = c(.80, .90, .95))
#' hdi(model, ci = c(0.80, 0.90, 0.95))
#'
#' library(BayesFactor)
#' bf <- ttestBF(x = rnorm(100, 1, 1))
#' hdi(bf)
#' hdi(bf, ci = c(.80, .90, .95))
#' hdi(bf, ci = c(0.80, 0.90, 0.95))
#' }
#' @author Credits go to **ggdistribute** and [**HDInterval**](https://github.com/mikemeredith/HDInterval).
#'
Expand Down
13 changes: 6 additions & 7 deletions man/hdi.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8c3b60e

Please sign in to comment.