Assignment 2: hierarchical models

Students
Name Id
Ploni Almoni 123489589
John Smith 923352302

Summary

In this assignment we explore hierarchical models for analysis of data consisting of multiple related groups. The assignment is based on the class material:

  1. Hierarchical models
  2. Hierarchical models, cont.

The assignment consists of two problems. Solve the problems in either Jupyter or Pluto notebook. In addition to computations, solutions must include graphical visualization and numerical characterization of the posterior.

Problem 1: warp breaks

Julia provides to R datasets via package RDatasets. We will use the warpbreaks dataset for this problem. You can load the dataset into data frame df as follows:

Infer the probability distribution of warp breaks for each of two wool types. Compare the results under separate and hierarchical models. Conduct two studies:

  1. Ignore warp tension and compare wool types based on all experiments.
  2. Account for warp tension in both the hierarchical model and the separate model.

Problem 2. City of Norfolk employee salaries

City of Norfolk provides access to employee salary data. Analyze the salary distributions

  1. by department;
  2. by department and employee status.

Compare the analysis under separate and hierarchical models. A small number of groups are very different from the rest, how do you propose to handle the difference in the hierarchical model?