1. Learn
  2. /
  3. Courses
  4. /
  5. Hierarchical and Mixed Effects Models in R

Exercise

Displaying chlamydia results

In the previous exercise, you fit a GLMER to the Illinois chlamydia data. During this exercise, we will go over some methods for displaying the results. You could use these methods to get summaries of the model for a client or document you are writing describing your results. However, I encourage you to learn how to manipulate and explore model outputs on your own to create your own methods for displaying results. Developing your own unique methods can help you stand out as a data scientist!

Here is what you will do:

  1. Examine the model estimates.
  2. Plot the data with and fit a glm to each age class. Although not exactly the same as the glmer() outputs, this approximation helps to display the results in a visually easy to understand method.

Instructions

100 XP
  • Extract out the fixed-effect estimates from model_out using fixef().
  • Extract out the random-effect estimates from model_out using ranef().
  • Run the code to plot the data using ggplot2 methods.