Session Ready
Exercise

Compare with classical interval

In our example, if \(\bar y\) and \(se\) are the respective sample mean and standard error, then a standard 90 percent confidence interval for M is given by

$$ (\bar y - 1.645 \times se, \bar y + 1.645 \times se). $$

For my data, we have ybar = 275.9, and se = 6.32, so my confidence interval is given by

c(275.9 - 1.645 * 6.32, 275.9 + 1.645 * 6.32)

Recall that Kathy's posterior curve was normal with mean 271.35 and standard deviation 5.34.

Now you can compare the 90% confidence interval with Kathy's probability interval for M!

Instructions
100 XP
  • Compute a vector C_Interval containing the 90% confidence interval. This is the interval obtained by using the frequentist method.
  • Find the length of the confidence interval using the diff() function.
  • Define a vector Posterior with the mean and standard deviation of Kathy's posterior.
  • Use the normal_interval() function to display a 90% probability interval.
  • Use qnorm() to compute the 90% Bayesian probability interval. Assign the result to B_Interval.
  • Compute the length of the Bayesian interval using diff() once more.