One sided vs. Two-sided tests
Recall in the first exercise that we tested to see if the mean of the guinea pigs' teeth in ToothGrowth
was not equal to 18 micrometers. That was an example of a two-sided t-test: we wanted to see if the mean of len
is some other number on either side of 18.
We can also conduct a one-sided t-test, explicitly checking to see if the mean is less than or greater than 18. Whether to use a one- or two-sided test usually follows from your research question. Does an intervention cause longer tooth growth? One-sided, greater than. Does a drug cause the test group to lose more weight? One-sided, less than. Is there a difference in mean test scores between two groups of students? Two-sided test.
The ToothGrowth
data has been loaded for you.
This exercise is part of the course
Experimental Design in R
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Less than
t.test(x = ___,
alternative = ___,
mu = ___)