library(bayestestR)
if (require("logspline")) {
x <- rnorm(1000)
describe_posterior(x, verbose = FALSE)
describe_posterior(x,
centrality = "all",
dispersion = TRUE,
test = "all",
verbose = FALSE
)
describe_posterior(x, ci = c(0.80, 0.90), verbose = FALSE)
df <- data.frame(replicate(4, rnorm(100)))
describe_posterior(df, verbose = FALSE)
describe_posterior(
df,
centrality = "all",
dispersion = TRUE,
test = "all",
verbose = FALSE
)
describe_posterior(df, ci = c(0.80, 0.90), verbose = FALSE)
df <- data.frame(replicate(4, rnorm(20)))
head(reshape_iterations(
describe_posterior(df, keep_iterations = TRUE, verbose = FALSE)
))
}
# \donttest{
# rstanarm models
# -----------------------------------------------
if (require("rstanarm") && require("emmeans")) {
model <- suppressWarnings(
stan_glm(mpg ~ wt + gear, data = mtcars, chains = 2, iter = 200, refresh = 0)
)
describe_posterior(model)
describe_posterior(model, centrality = "all", dispersion = TRUE, test = "all")
describe_posterior(model, ci = c(0.80, 0.90))
describe_posterior(model, rope_range = list(c(-10, 5), c(-0.2, 0.2), "default"))
# emmeans estimates
# -----------------------------------------------
describe_posterior(emtrends(model, ~1, "wt"))
}
# BayesFactor objects
# -----------------------------------------------
if (require("BayesFactor")) {
bf <- ttestBF(x = rnorm(100, 1, 1))
describe_posterior(bf)
describe_posterior(bf, centrality = "all", dispersion = TRUE, test = "all")
describe_posterior(bf, ci = c(0.80, 0.90))
}
# }
Run the code above in your browser using DataLab