## Notice

## Two Sample t-Test for Difference of the Population Means (Equal Variances)

### When can this test be used?

- There are two samples from two populations. (The samples can be different sizes.)
- The two samples are
**independent**. - Both populations are normally distributed or both sample sizes are large enough that the means are normally distributed.

(A rule of thumb is that the sample size is large enough if*n*≥ 15.) - Both population standard deviations,
and*σ*_{x}*σ*_{y}, are**unknown**, but are assumed to be equal.

### Notation

Population | Data | Mean | Standard Deviation | Sample Size | Sample Mean | Sample Standard Deviation |

1 | x_{i} |
μ_{x} |
σ_{x} |
n |
x |
s_{x} |

2 | y_{i} |
μ_{y} |
σ_{y} |
m |
y |
s_{y} |

### How is this test used?

- State the hypotheses:

*H*_{0}:*μ*_{x}−*μ*_{y}=*D*

*H*_{A}:*μ*_{x}−*μ*_{y}≠*D*or*H*_{A}:*μ*_{x}−*μ*_{y}>*D*or*H*_{A}:*μ*_{x}−*μ*_{y}<*D*

The hypothesized difference in the means is*D*.

Usually, the hypothesized difference is*D*= 0. In this case the hypotheses simplify to:

*H*_{0}:*μ*_{x}=*μ*_{y}

*H*_{A}:*μ*_{x}≠*μ*_{y}or*H*_{A}:*μ*_{x}>*μ*_{y}or*H*_{A}:*μ*_{x}<*μ*_{y} - Pick a significance level,
*α*. - Compute the test statistic:

*t*= ((*x*−*y*) −*D*)/(√(*s*^{2}_{p}⎛⎝(1)/(*n*) + (1)/(*m*)⎞⎠)) = (difference in sample means − hypothesized difference in population means )/(√((pooled variance estimate)⎛⎝(1)/(sample 1 size ) + (1)/(sample 2 size)⎞⎠))

where.*s*^{2}_{p}= ((*n*− 1)*s*^{2}_{x}+ (*m*− 1)*s*^{2}_{y})/(*n*+*m*− 2) - Find the degrees of freedom:

*df*=*n*+*m*− 2

The degrees of freedom is the sum of the sample sizes minus 2. - Find the p-value:

The p-value depends on which alternative hypothesis is being used. The p-value is the probability or the area in the tail(s) of the t distribution with*n*+*m*− 2 degrees of freedom.

If*H*_{A}:*μ*_{x}−*μ*_{y}>*D*, p-value =*P*(*T*≥*t*)

If*H*_{A}:*μ*_{x}−*μ*_{y}<*D*, p-value =*P*(*T*≤*t*)

If*H*_{A}:*μ*_{x}−*μ*_{y}≠*D*, p-value =*P*(*T*≤ − |*t*| or*T*≥ |*t*|) or 2*P*(*T*≥ |*t*|)

- State the conclusion:

Once the p-value is known, compare it to*α*, the significance level.

If the p-value is smaller than*α*, the observed outcome wasn’t very likely given that the null hypothesis is true. So reject the null hypothesis in favor of the alternative hypothesis.

If the p-value is greater than*α*then the observed outcome was likely enough that it is reasonable to assume that the null hypothesis

p − value < α |
reject H_{0} |

p − value > α |
fail to reject H_{0} |

\endcenter