## One Sample t test for mean

In this tutorial we will explain the six steps approach used in hypothesis testing to test hypothesis about the population mean when the population standard deviation is unknown.

## One sample t test for mean

Let $X_1, X_2, \cdots, X_n$ be a random sample from a normal population with mean $\mu$ and unknown variance $\sigma^2$. Let $\overline{x}=\frac{1}{n} \sum x_i$ be the sample mean and $s^2 =\frac{1}{n-1} \sum (x_i -\overline{x})^2$ be the sample variance.

## Assumptions

a. The population from which, the sample drawn is assumed as Normal distribution.

b. The population variance $\sigma^2$ is unknown.

## Step by Step Procedure

We wish to test the null hypothesis $H_0 : \mu = \mu_0$, where $\mu_0$ is the specified value of the population mean.

The standard error of mean is \begin{aligned} SE(\overline{x}) & = \frac{\sigma}{\sqrt{n}}=\frac{s}{\sqrt{n}} \end{aligned}

### Step 1 State the hypothesis testing problem

The hypothesis testing problem can be structured in any one of the three situations as follows:

Situation Hypothesis Testing Problem
Situation A $H_0: \mu=\mu_0$ against $H_a : \mu < \mu_0$ (Left-tailed)
Situation B $H_0: \mu=\mu_0$ against $H_a : \mu > \mu_0$ (Right-tailed)
Situation C $H_0: \mu=\mu_0$ against $H_a : \mu \neq \mu_0$ (Two-tailed)

### Step 2 Define the test statistic

The test statistic for testing above hypothesis is $$\begin{eqnarray*} t & =& \frac{\overline{x}-\mu}{SE(\overline{x})}\\ & = & \frac{\overline{x}-\mu_0}{s/\sqrt{n}} \end{eqnarray*}$$

The test statistic $t$ follows Students’ $t$ distribution with $n-1$ degrees of freedom.

### Step 4 Determine the critical values

For the specified value of $\alpha$ determine the critical region depending upon the alternative hypothesis.

• left-tailed alternative hypothesis: Find the $t$-critical value using \begin{aligned} P(t<-t_{\alpha,n-1}) & = \alpha. \end{aligned}
• right-tailed alternative hypothesis: $t_\alpha$. \begin{aligned} P(t>t_{\alpha, n-1}) & = \alpha. \end{aligned}
• two-tailed alternative hypothesis: $t_{\alpha/2}$. \begin{aligned} P(|t| > t_{\alpha/2,n-1}) &= \alpha. \end{aligned}

### Step 5 Computation

Compute the test statistic under the null hypothesis $H_0$ using equation \begin{aligned} t_{obs} & = \frac{\overline{x}-\mu_0}{s/\sqrt{n}} \end{aligned}

### Step 6 Decision (Traditional Approach)

Traditional approach is based on the critical value.

• For left-tailed alternative hypothesis: Reject $H_0$ if $t_{obs}\leq -t_{\alpha,n-1}$.
• right-tailed alternative hypothesis: Reject $H_0$ if $t_{obs}\geq t_{\alpha,n-1}$.
• two-tailed alternative hypothesis: Reject $H_0$ if $|t_{obs}|\geq t_{\alpha/2, n-1}$.

OR

### Step 6 Decision ($p$-value Approach)

It is based on the $p$-value.

Alternative Hypothesis Type of Hypothesis $p$-value
$H_a: \mu<\mu_0$ Left-tailed $p$-value $= P(t\leq t_{obs})$
$H_a: \mu>\mu_0$ Right-tailed $p$-value $= P(t\geq t_{obs})$
$H_a: \mu\neq \mu_0$ Two-tailed $p$-value $= 2P(t\geq t_{obs})$

If $p$-value is less than $\alpha$, then reject the null hypothesis $H_0$ at $\alpha$ level of significance, otherwise fail to reject $H_0$ at $\alpha$ level of significance.