Session Ready
Exercise

Posterior inference for multivariate regression

The 10,000 iteration RJAGS simulation output, rail_sim_2, is in your workspace along with a data frame of the Markov chain output:

> head(rail_chains_2, 2)
         a b.1.      b.2.        c         s
1 49.76954    0 -12.62112 4.999202 111.02247
2 30.22211    0  -3.16221 4.853491  98.11892 

You will use these 10,000 unique sets of parameter values to summarize the posterior mean trend in the relationships between trail volume, weekday status, and hightemp.

Instructions
100 XP

Construct a scatterplot of volume by hightemp.

  • Use color to distinguish between weekdays & weekends.
  • Superimpose a red line that represents the posterior mean trend of the linear relationship between volume and hightemp for weekends: m = a + c Z
  • Superimpose a turquoise3 line that represents the posterior mean trend of the linear relationship between volume and hightemp for weekdays: m = (a + b.2.) + c Z