if (FALSE) {
if (require("ggplot2", quietly = TRUE)) {
# Generate some data and fit a simple model
input.df <- data.frame(x = cos(1:10))
input.df <- within(
input.df,
y <- 5 + 2 * x + rnorm(length(x), mean = 0, sd = 0.1)
)
fit <- bru(y ~ x, family = "gaussian", data = input.df)
summary(fit)
# Plot the posterior density of the model's x-effect
plot(fit, "x")
}
}
Run the code above in your browser using DataLab