ComenzarEmpieza gratis

Paired test

In the previous lesson, you've worked on the sleep dataset. The dataset contains data on the effect of two drugs on the increase in sleep hours.

In the case of this experiment, the data are pairs of measurements. The same people were tested with each of the drugs. If data contain pairs of measurements, you should use a paired test. It is worth keeping this distinction in mind during the interview.

To carry out a paired test, set the paired parameter of the t.test() function to TRUE.

The dataset is available as sleep in your environment. Recall that extra is the increase in the number of sleep hours, and group indicates which drug has been given.

Este ejercicio forma parte del curso

Practicing Statistics Interview Questions in R

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# Subset the first group
drug1 <- sleep$extra[___ == ___]

# Subset the second group
___ <- ___[sleep$group == ___]
Editar y ejecutar código