НачатьНачать бесплатно

Plotting GLMs

Often, we want to "look" at our data and trends in our data. ggplot2 allows us to add trend lines to our plots. The default lines are created using a technique called local regression. However, we can specify that different models are used to create the lines, including GLMs.

During this exercise, we'll see how to plot a GLM with ggplot2.

Это упражнение является частью курса

Hierarchical and Mixed Effects Models in R

Посмотреть курс

Интерактивное практическое упражнение

Попробуйте выполнить это упражнение, дополнив этот пример кода.

# Plot the data using jittered points and the default stat_smooth
ggplot(data = df_long, aes(x = dose, y = mortality)) + 
	geom_jitter(height = 0.05, width = 0.1) +
	___(fill = 'pink', color = 'red') 
Редактировать и запускать код