Exploring NY hate data
The State of New York reports the number of hate crimes committed against people in each county. During this case study, you will examine and see if the number of hates crimes are changing through time. These exercises serve two purposes. First, they demonstrate how generalized mixed-effect regressions (glmer()
) can be used for repeated measures in R. Second, they provide another example of using mixed-effect models for statistical inference.
Give the different population sizes of New York counties, you can reasonably assume the need for random-effect intercepts a priori. However, do you need random-effect slopes? Plot the data to see if trends appear to vary by county. Additionally, plotting the data will help you see what is going on.
This exercise is part of the course
Hierarchical and Mixed Effects Models in R
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Plot the TotalIncidents of hate crimes in NY by Year, grouped by County
ggplot(data = ___, aes(x = ___, y = ___, group = ___)) +
___