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:
- Examine the model estimates.
- Plot the data with and fit a
glmto each age class. Although not exactly the same as theglmer()outputs, this approximation helps to display the results in a visually easy to understand method.
Bu egzersiz
Hierarchical and Mixed Effects Models in R
kursunun bir parçasıdırEgzersiz talimatları
- Extract out the fixed-effect estimates from
model_outusingfixef(). - Extract out the random-effect estimates from
model_outusingranef(). - Run the code to plot the data using
ggplot2methods.
Uygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
# Extract out fixed effects
___
# Extract out random effects
___
# Run code to see one method for plotting the data
ggplot(data = il_data_2,
aes(x = year, y = count, group = county)) +
geom_line() +
facet_grid(age ~ . ) +
stat_smooth(method = "glm",
method.args = list(family = "poisson"),
se = FALSE,
alpha = 0.5) +
theme_minimal()