I want to apologize for the assignment being submitted incomplete. I have been working on this for a bit and have gotten symptoms of a stomach virus in between finishing the coding portion of the assignment. I physically cannot do the assignment because I am in and out of the bathroom and/or I’m too distracted by pain currently. Thank you for understanding.

library("tidyverse")
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ ggplot2 3.4.0      ✔ purrr   1.0.1 
## ✔ tibble  3.1.8      ✔ dplyr   1.0.10
## ✔ tidyr   1.2.1      ✔ stringr 1.5.0 
## ✔ readr   2.1.3      ✔ forcats 0.5.2 
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
library("cmdstanr")
## This is cmdstanr version 0.5.3
## - CmdStanR documentation and vignettes: mc-stan.org/cmdstanr
## - Use set_cmdstan_path() to set the path to CmdStan
## - Use install_cmdstan() to install CmdStan
library("bayesplot")
## This is bayesplot version 1.10.0
## - Online documentation and vignettes at mc-stan.org/bayesplot
## - bayesplot theme set to bayesplot::theme_default()
##    * Does _not_ affect other ggplot2 plots
##    * See ?bayesplot_theme_set for details on theme setting
#model <- cmdstan_model("hw5.stan")

model_data <- list(n_1 = 10,
                  n_2 = 14,
                  x_1 = c(16.34, 6.31, 8.98, 4.35, 8.26, 5.95, 20.74, 8.46, 4.41, 3.46),
                  x_2 = c(21.61, 11.56, 14.4, 9.31, 13.66, 11.15, 25.67, 13.86, 9.38, 8.22, 21.28, 19.32, 18.78, 16.61))
exper <- model$sample(
  data = model_data, 
  iter_warmup = 1000,
  iter_sampling = 1000,
  chains = 4,
  parallel_chains = 4,
  refresh = 500)