Significance testing: one-sided versus two-sided
An important consideration when doing hypothesis testing is whether to do a one-sided or a two-sided test. Consider the example that we are working with a significance level (\(\alpha\)) of 0.05. In the case we are doing a one-sided hypothesis test, we would only focus on one side of the distribution (either the right or the left side). Our entire cumulative probability of 0.05 would then be allocated to only this side. So what does this mean in practice? In practice this means that our rejection region starts at a probability of 0.95 when our alternative hypothesis tests whether a given value is greater than a population value. Alternatively, our rejection regions starts at a probability of 0.05 when our alternative hypothesis tests whether a given value is smaller than a population value. Let's consider what this means visually:
In the above visualization, we have taken as an example the sampling distribution of the beard length of samples of 40 scandinavian hipsters. The mean here is 25 and the standard error is 0.55 round(3.5 / sqrt(40), 2)
. The red area is considered the rejection region when we are doing a one-sided hypothesis where the alternative hypothesis checks whether the population mean of the beard length of scandinavian hipsters is larger than 25 millimeters.
This exercise is part of the course
Basic Statistics
Exercise instructions
- The visualization mentions the value 25.90. This is the starting value of the rejection region. Consider our example mentioned above with a mean beard length of 25 and a standard error of 0.55. Reproduce the value of 25.90 using the
qnorm()
function and assign it to the variablecut_off
. Make sure to round every value in this exercise to two digits. - Print the value of cut_off to the console
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# calculate the value of cut_off
# print the value of cut_off to the console