ComeçarComece de graça

Exploring the data

One of the first things to do with new datasets is to plot it prior to analysis. During this exercise, you will plot the data using ggplot2 and create a publication quality figure. This will help you to see the data.

This data examines if two different drugs change the amount of sleep individuals get. The response variable of interest is the amount of extra sleep a patient gets. The predictor variable is the drug group. The ID of each patient allows us to do a repeated measures analysis. This is a random-effect intercept and corresponds to the baseline effect of giving a person a sleeping drug. We do not care how much an individuals sleeps in this case, only the change in sleep of the groups.

The data.frame sleep contains these variables.

Este exercício faz parte do curso

Hierarchical and Mixed Effects Models in R

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Plot the raw data
ggplot(data = ___, aes(x = ___, y = ___)) +
	geom_point()
Editar e executar o código