LoslegenKostenlos loslegen

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.

Diese Übung ist Teil des Kurses

Hierarchical and Mixed Effects Models in R

Kurs anzeigen

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Plot the raw data
ggplot(data = ___, aes(x = ___, y = ___)) +
	geom_point()
Code bearbeiten und ausführen