As we discussed, hypothesis testing provides a structured way to make decisions based on data. Think of it like a fork in the road: based on the evidence from our sample, do we stick with a default assumption, or do we have enough reason to believe an alternative claim is true? The very first step in this process is to clearly state these two competing possibilities: the null hypothesis and the alternative hypothesis.
The Null Hypothesis (H0)
The null hypothesis, often denoted as H0, represents the default position or the status quo. It's typically a statement of "no effect," "no difference," or "no change." It's the assumption we hold initially, before looking at the evidence from our sample data. In many research scenarios, the null hypothesis is the statement that the researcher is actually trying to disprove.
Mathematically, the null hypothesis almost always involves some form of equality (=, ≤, or ≥).
Here are a few examples of null hypotheses:
- Website Design: A company tests a new website layout. The null hypothesis might be that the average time spent on the site by users is the same for the new layout as for the old layout. If μnew is the average time for the new layout and μold is the average time for the old layout, we can write this as:
H0:μnew=μold
or equivalently:
H0:μnew−μold=0
- Algorithm Performance: We develop a new machine learning algorithm for predicting house prices. The null hypothesis could be that our new algorithm's average prediction error is not better than (i.e., is greater than or equal to) the existing algorithm's error. If Enew is the average error of the new algorithm and Eold is the average error of the old one, this could be:
H0:Enew≥Eold
- Manufacturing Quality: A factory produces bolts that are supposed to have a mean diameter of 10mm. The null hypothesis for quality control could be that the production process is meeting this specification:
H0:μ=10mm
The null hypothesis is the baseline we compare our sample evidence against.
The Alternative Hypothesis (H1 or Ha)
The alternative hypothesis, denoted as H1 or sometimes Ha, is the statement that contradicts the null hypothesis. It represents what we might suspect or hope to be true instead of the null hypothesis. It's often the claim that the researcher is trying to find evidence for.
The alternative hypothesis typically involves an inequality sign (=, <, or >). It must be mutually exclusive with the null hypothesis, meaning H0 and H1 cannot both be true simultaneously.
Let's look at the alternative hypotheses corresponding to the examples above:
- Website Design: If the null was H0:μnew=μold, the alternative could be that the average times are simply different (either higher or lower):
H1:μnew=μold
Alternatively, if we specifically hypothesized that the new design would increase user engagement, the alternative hypothesis would state that direction:
H1:μnew>μold
- Algorithm Performance: If the null was H0:Enew≥Eold, the alternative hypothesis (what we hope to demonstrate) is that the new algorithm has a lower average error:
H1:Enew<Eold
- Manufacturing Quality: If the null was H0:μ=10mm, the alternative hypothesis might be that the process is not meeting the specification (the mean diameter is different from 10mm):
H1:μ=10mm
One-Tailed vs. Two-Tailed Tests
Notice how the form of the alternative hypothesis (H1) dictates the nature of the test:
- Two-Tailed Test: When H1 uses a "not equal to" sign (=), we are interested in detecting a difference in either direction (e.g., μnew could be greater or less than μold). This is called a two-tailed test.
- One-Tailed Test: When H1 uses a "greater than" (>) or "less than" (<) sign, we are interested in detecting a difference in only one specific direction. This is called a one-tailed test (specifically, a right-tailed test for > and a left-tailed test for <).
The choice between a one-tailed and two-tailed test depends entirely on the question you are trying to answer before you look at the data. Are you only interested if the new website design performs better, or would you also want to know if it performs worse? If you care about detecting a difference in a specific direction, use a one-tailed test. If you care about detecting any difference, use a two-tailed test.
Setting the Stage for Decision Making
Formulating the null (H0) and alternative (H1) hypotheses is the essential first step in hypothesis testing. These two statements define the precise claim we are evaluating and the potential alternative we are considering. They set the stage for the next steps, where we will use our sample data and probability rules to decide whether we have enough evidence to reject the null hypothesis (H0) in favor of the alternative (H1). We'll explore how to make that decision, often using something called a p-value, in the following sections.