if (FALSE) { # require("rstanarm")
# \donttest{
# Rstanarm ----------------------
# Simple regressions
model <- rstanarm::stan_glm(Sepal.Length ~ Species,
data = iris, chains = 2, refresh = 0
)
bayesian_as_frequentist(model)
model <- rstanarm::stan_glm(vs ~ mpg,
family = "binomial",
data = mtcars, chains = 2, refresh = 0
)
bayesian_as_frequentist(model)
# Mixed models
model <- rstanarm::stan_glmer(
Sepal.Length ~ Petal.Length + (1 | Species),
data = iris, chains = 2, refresh = 0
)
bayesian_as_frequentist(model)
model <- rstanarm::stan_glmer(vs ~ mpg + (1 | cyl),
family = "binomial",
data = mtcars, chains = 2, refresh = 0
)
bayesian_as_frequentist(model)
# }
}
Run the code above in your browser using DataLab