if (FALSE) { # require("rstanarm", quietly = TRUE)
library(bayestestR)
posterior <- rnorm(1000)
ci(posterior, method = "ETI")
ci(posterior, method = "HDI")
df <- data.frame(replicate(4, rnorm(100)))
ci(df, method = "ETI", ci = c(0.80, 0.89, 0.95))
ci(df, method = "HDI", ci = c(0.80, 0.89, 0.95))
model <- suppressWarnings(
stan_glm(mpg ~ wt, data = mtcars, chains = 2, iter = 200, refresh = 0)
)
ci(model, method = "ETI", ci = c(0.80, 0.89))
ci(model, method = "HDI", ci = c(0.80, 0.89))
}
if (FALSE) { # require("BayesFactor", quietly = TRUE)
bf <- ttestBF(x = rnorm(100, 1, 1))
ci(bf, method = "ETI")
ci(bf, method = "HDI")
}
if (FALSE) { # require("emmeans", quietly = TRUE) && require("rstanarm", quietly = TRUE)
model <- emtrends(model, ~1, "wt", data = mtcars)
ci(model, method = "ETI")
ci(model, method = "HDI")
}
Run the code above in your browser using DataLab