Please provide a reproducible .Rmd script to address the scenario below and produces all of your analysis and plots. Some reminders:
For our final homework, you will be creating, running diagnostics, doing model selection, and predicting with Bayesian models. Because this Bayesian stuff is pretty new territory for us, we will be asking some familiar friends for help–the Palmer Penguins. Use our Review of linear models lab for modeling ideas, creating your priors, and expectations for model outputs.
Information the “penguins” data can be found here: https://allisonhorst.github.io/palmerpenguins/articles/intro.html
Using the ‘brms’ package and the Palmer Penguins dataset, create hierarchical Bayesian models to explain penguin body mass. These models should attempt to explain body mass for all species and sexes and islands in the dataset (i.e., don’t create separate models for the sexes, species, or islands). To complete this assignment, will need to do five main things:
# List of packages necessary to run this script:
require(librarian, quietly = TRUE)
shelf(tidyverse,
palmerpenguins,
here,
brms,
quiet = TRUE)
## package 'StanHeaders' successfully unpacked and MD5 sums checked
## package 'inline' successfully unpacked and MD5 sums checked
## package 'RcppParallel' successfully unpacked and MD5 sums checked
## package 'pkgbuild' successfully unpacked and MD5 sums checked
## package 'QuickJSR' successfully unpacked and MD5 sums checked
## package 'desc' successfully unpacked and MD5 sums checked
## package 'ggridges' successfully unpacked and MD5 sums checked
## package 'mvtnorm' successfully unpacked and MD5 sums checked
## package 'Brobdingnag' successfully unpacked and MD5 sums checked
## package 'rstan' successfully unpacked and MD5 sums checked
## package 'loo' successfully unpacked and MD5 sums checked
## package 'rstantools' successfully unpacked and MD5 sums checked
## package 'bayesplot' successfully unpacked and MD5 sums checked
## package 'bridgesampling' successfully unpacked and MD5 sums checked
## package 'future.apply' successfully unpacked and MD5 sums checked
## package 'nleqslv' successfully unpacked and MD5 sums checked
## package 'brms' successfully unpacked and MD5 sums checked