# Defining a hypothesis and deciding on two- or one-sided test for a simple hypothesis test

i'm just doing question out of a book, so I will ask this question in relation to the context of the question because I think it's a good example of the general question.

If I want to test whether exams elevate blood pressure for students, should I use a one-sided test or two-sided test?

To me it seems I would use a one-sided test because I am asking whether the blood pressure is elevated.

$H_0: \theta = 0$
$H_1: \theta \gt 0$

where $\theta$ is the (blood pressure an hour before the exam minus blood pressure a week before the exam), or something like that.

However, although, I'm interested in whether exams raise blood pressure, my hypothesis (theoretically) could be totally way off the mark, and I could find that exams actually lower blood pressure.

So should I be taking account of unexpected results when deciding whether it is one-sided or two-sided, or should me initial research hypothesis be the driver of whether it is one-sided or two-sided test?

Thanks.

Various textbook authors take different approaches. Some of these approaches are useful in analyzing real-life experiments, and some are not. So without access to your book, there is no way to give a perfect answer to your question. It is possible to discuss a couple of examples so you can understand some of the issues involved.

You are correct that before you see the data, you will not know for sure whether the prospect of an upcoming exam would raise or lower students' blood pressures. It might depend on the course, the instructor's instructions for exam preparation, or the kind or level of the students. It might depend on whether systolic or diastolic blood pressure is used.

If a textbook question says, "...interested in whether exams raise blood pressure," that is usually a prompt to do a one-sided test. If it says, "...interested in whether exams change blood pressure," that is usually a prompt to do a two-sided test.

Fake paired data, as an example. It seems best to explore this issue by doing some t tests on data. Here are fake paired data on $n = 36$ students. The values x1 are the blood pressure a week before the exam; x2 are values just before the exam, and dif = x2 - x1. For example, the first student's blood pressure was 119 just before the exam, 128 a week before, for a difference of -9 (decrease).

x1
[1] 128  98 154 131 129 119 127 108 112 149 133 130 115 138 126 125 123 146
[19] 127  98 126 144 108 125 135 139 111 140 115 126 118 130 115 124 113 145
x2
[1] 119 106 155 142 132 124 120 110 110 157 128 130 122 143 129 126 115 153
[19] 125  98 134 148 103 129 130 137 114 137 114 127 120 131 116 130 117 151
dif
[1] -9  8  1 11  3  5 -7  2 -2  8 -5  0  7  5  3  1 -8  7
[19] -2  0  8  4 -5  4 -5 -2  3 -3 -1  1  2  1  1  6  4  6


Two-sided test. A paired t test is the same as a one-sample t test on the differences. Let's do a two-sided test $H_0: \mu_D = 0$ against $H_a: \mu_D \ne 0,$ using R. [The R statement t.test(x2, x1, pair=T) gives essentially the same output.]

t.test(dif)

One Sample t-test

data:  dif
t = 1.7724, df = 35, p-value = 0.08504
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
-0.2100593  3.0989482
sample estimates:
mean of x
1.444444


The P-value is $0.085 > 0.05$ so the null hypothesis is not rejected at the 5% level. The P-value is computed using Student's t distribution with $n-1 = 36$ degrees of freedom. It is twice the probability in the right-hand tail of the distribution beyond 1.7724.

(1 - pt(1.7724, 35))*2
[1] 0.08503329


In the figure below: the observed value of $T = 1.7724$ (solid red line); the P-value is the total area in both tails beyond the vertical red lines; the rejection region is outside the vertical black lines at critical values $\pm 2.0301.$

One-sided test. By contrast, if we do a one-sided paired t test, $H_0: \mu_D = 0$ against $H_a: \mu_D >0,$ we reject at the 5% level. Saying that we want to know whether blood pressures increased gives additional information. In effect, it says we are sure that any change will be an increase. (If the average difference $\bar D$ turns out to be negative, we are prepared to say that's due to random variation, but at least we have no evidence of increase.)

Let's look at the output from a one-sided test in R. [The R statement t.test(x2, x1, pair=T, alte="g") gives essentially the same output.]

t.test(dif, alte="g")

One Sample t-test

data:  dif
t = 1.7724, df = 35, p-value = 0.04252
alternative hypothesis: true mean is greater than 0
95 percent confidence interval:
0.06747136        Inf
sample estimates:
mean of x
1.444444


The P-value is $0.0425 < 0.05,$ so $H_0$ is (just barely) rejected at the 5% level of significance. The extra information provided by the one-sided alternative, happens to have made the difference between failing to reject and rejecting. The P-value is computed much as before, but for the one-sided test the probability in the tail is not doubled.

1 - pt(1.7742, 35)
[1] 0.04236511


In the figure below: the observed value of $T = 1.7724$ (solid red line); the P-value is the area under the curve to the right of that line; the rejection region is to the right of the vertical black line at the critical value $1.6896.$

This example shows that it is important to make the decision whether to do a one- or two-sided test before seeing the data. It is not really 'playing fair' to change from a two-sided to a one-sided test just to nudge the P-value from slightly above 5% to slightly below. Not even if you claim in retrospect, "Well, I really knew all the time that any difference has to be positive."

Note: For the one-sided test, if you were to make the mistake of using the wrong alternative direction alte="less" to request t.test(dif, alte="less"), then you would get the bogus P-value 0.9575. In a one-sided t test, a P-value greater than 1/2 always deserves a second look.

• Thanks for the comprehensive answer @BruceET. What does a researcher out in the field do? say in ecology or other science? For example, the question was framed as a one-sided test? but why did the author associate that scenario with the one-sided test? It seems the author is in agreement probably with the general public that we accept that if our blood pressure changes under stress, the change is likely to be upwards, and so it was a good example for a one-sided test. In real life it seems that the less we know about the data, the more likely it is that we should decide upon 2-sided test. – Bucephalus Sep 1 '18 at 6:45
• What you say makes sense. The difficulty with doing one-sided tests without good information (or intuition) is that sometimes things don't go in the direction one expects. For example, a plan to help people lose weight may be so strict as to be counterproductive: after black coffee and egg whites for breakfast and two teaspoons of tuna on a fiber cracker for lunch, a participant may not be able to resist a two-for-the-price-of-one sale on banana splits at the local ice cream store. Too many of those and participants will show a gain, not loss, in weight. – BruceET Sep 1 '18 at 7:15