# How to Write Null and Alternative Hypotheses

## Definitions of Null and Alternative Hypotheses

A null hypothesis is a prediction of no difference between groups or no relationship between variables. In contrast, an alternative hypothesis states there is a difference between groups or a relationship between variables.

Often, we use H0 to represent the null hypothesis, whereas H1 represents the alternative hypothesis.

## Hypotheses for Correlation

Correlation is a measure of the relationship between two variables, X and Y. Suppose that you would like to test whether the temperature is correlated with ice cream consumption. You can write the null and alternative hypotheses as follows for the correlation test.

• H0: Temperature and ice cream consumption are not correlated.
• H1: Temperature and ice cream consumption are correlated.

## Hypotheses for Simple Regression

Simple linear regression has only one X variable. For instance, you would like to predict how age impacts saving. Age is the X (i.e., independent variable) and saving is the Y (i.e., dependent variable).

Y = β0+ β1X = β0+ β1Aage

The null hypothesis and alternative hypothesis can be written as follows.

• H0: 𝛽₁ = 0.
• H1: 𝛽₁ ≠ 0.

## Hypotheses for Multiple Regression

Multiple linear regression has more than one X variable. For instance, you would like to predict how the combination of age and gender impacts saving.

Typically, there are two ways that you can write null and alternative hypotheses for multiple linear regression, namely a single independent variable case and the whole model case.

Y = β0+ β1X + β2X= β0+ β1Aage + β2Gender

### Hypotheses for a Single Variable

You can just choose either of them, either 𝛽₁ or 𝛽2 as the focus of the hypotheses.

• H0: 𝛽₁ = 0.
• H1: 𝛽₁ ≠ 0.

### Hypotheses for the Whole Model

For the whole model, it gets a bit complicated. Let’s start with the null hypothesis, where you can say both 𝛽₁ and 𝛽2 are equal to zero. However, the opposite of that is not that neither 𝛽₁ nor 𝛽2 is equal to zero, but rather at least one of them is unequal to zero. The following is the formula format of the hypothesis.

• H0: 𝛽₁ = 𝛽2 = 0.
• H1: At least one of them, 𝛽₁or 𝛽2 ≠ 0.

## Hypotheses for Mean Comparisons

For t-test or ANOVA, the independent variable (i.e., X) is a category. In this case, hypotheses statements are about the comparison between different independent levels.

### Hypotheses for 2 Groups (t-test)

When comparing two groups, you can use a t-test. For instance, if you compare how different font colors (blue vs. black) can impact how long consumers use your App.

The null hypothesis states that blue and black font colors do not differ in terms of how long consumers use the App. In contrast, the alternative hypothesis will state the opposite. You can write the null and alternative hypotheses as follows.

H0: Meanblue = Meanblack (or, Meanblue – Meanblack =0).

H1: Meanblue ≠ Meanblack (or, Meanblue – Meanblack ≠ 0).

### Hypotheses for 2 or more Groups (ANOVA)

When comparing more than 2 groups, you need to use ANOVA. For instance, you want to test how 3 different font colors (blue vs. gray vs. black) can impact how long consumers use an App.

In this case, the null hypothesis states that blue, gray, and black font colors do not differ in terms of how long consumers use the App. In contrast, the alternative hypothesis will state that at least one pair of them is not equal. This uses similar logic as the one in the multiple linear regression. You can write the null and alternative hypotheses for ANOVA as follows.

• H0: Meanblue = Meangray = Meanblack.
• H1: At least one pair of Meanblue, Meangray, and Meanblack is not equal.