Exercise

Random-effect slopes

In the previous exercise, you estimated random-effect intercepts for each state. This allowed you to account for each state having its own intercept. During this exercise, you will estimate a random-effect slope for each state. For example, perhaps the log\(_{10}\)(total population of each county), LogTotalPop, changes the birth rate of a county AND varies by state.

Recall from the video, a random-effect slope may be estimated for each group using (slope | group) syntax with lmer().

During this exercise, fit a mixed-effects model estimating the effect of the mother's average age while accounting for state and total population as random-effects.

How do the outputs from this model compare to the previous model you built?

Instructions 1/2

undefined XP
    1
    2
  • Build the model from the previous exercise with AverageAgeofMother as a fixed-effect and State a random-effect.
  • Build the previous model, adding LogTotalPop as a random-effects slope.
  • Look at the tidy() output for each model.