ComeçarComece de graça

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 exercício faz parte do curso

Practicing Statistics Interview Questions in R

Ver curso

Exercício interativo prático

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

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

# Subset the second group
___ <- ___[sleep$group == ___]
Editar e executar o código