ttest for means with equal variancesexamples
Two sample ttest for means with unknown but equal variances
In this tutorial we will discuss some numerical examples on two sample ttest for difference between two population means when the population variances are unknown but equal.
ttest calculator for two means
The $t$test calculator for testing two population means makes it easy to calculate the test statistic, $t$ critical value and the $p$value given the sample information, level of significance and the type of alternative hypothesis (i.e. lefttailed, righttailed or twotailed.)
t test Calculator for two means  

Sample 1  Sample 2  
Mean  
Standard Deviation  
Sample Size  
Variances  Equal  Unequal 
Level of Significance ($\alpha$)  
Tail  Left tailed Right tailed Two tailed 

Results  
Standard Error of Diff. of Means:  
Test Statistics t:  
Degrees of Freedom:  
tcritical value(s):  
pvalue:  
How to use $t$test calculator for testing two means?
Step 1 – Enter the sample mean for first sample $\overline{X}_1$ and second sample $\overline{X}_2$
Step 2 – Enter the sample standard deviations for first sample $s_1$ and second sample $s_2$
Step 3 – Enter the sample size for first sample $n_1$ and second sample $n_2$
Step 4 – Select whether variances are equal or unequal
Step 5 – Enter the level of significance $\alpha$
Step 6 – Select the alternative hypothesis (lefttailed / righttailed / twotailed)
Step 7 – Click on "Calculate" button to get the result
Independent sample $t$test Example 1
A high school language course is given in two sections, each using a different teaching method. The first section has $21$ students, and the grades in that section have a mean of $82.6$ and a standard deviation of $8.6$. In the second section, with $43$ students, the mean of the grades is $85.2$, with a standard deviation of $7.9$. At $\alpha = 0.05$, test the hypothesis that the method used in second section is more effective. (Assume equal variances)
Solution
Given that the sample size $n_1 = 21$, $n_2 = 43$, sample mean $\overline{x}_1= 82.6$, $\overline{x}_2= 85.2$, sample standard deviation $s_1 = 8.6$ and $s_2 = 7.9$.
Step 1 State the hypothesis testing problem
The hypothesis testing problem is
$H_0 : \mu_1 = \mu_2$ (i.e., Methods used in both the sections are equally effective) against $H_1 : \mu_1 < \mu_2$ ($\textit{lefttailed}$) (i.e., Method used in second section is more effective that the method used in first section).
Step 2 Define test statistic
The test statistic is
$$ \begin{aligned} t& =\frac{(\overline{x}_1 \overline{x}_1)(\mu_1  \mu_2)}{sp\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}} \end{aligned} $$
where the pooled standard deviation is
$$ \begin{aligned} s_p & = \sqrt{\frac{(n_11)s_1^2 +(n_21)s_2^2}{n_1+n_22}}\\ & = \sqrt{\frac{(211)8.6^2 +(431)7.9^2}{21+432}}\\ & = 8.1324. \end{aligned} $$
Step 3 Specify the level of significance
The significance level is $\alpha = 0.05$.
Step 4 Determine the critical value
As the alternative hypothesis is $\textit{lefttailed}$, the critical value of $t$ using $\alpha = 0.05$ and degrees of freedom $n_1+n_22=21+432=62$ $\text{is}$ $\text{1.67}$.
The rejection region (i.e. critical region) is $\text{t < 1.67}$.
Step 5 Computation
The test statistic under the null hypothesis is
$$ \begin{aligned} t&=\frac{(\overline{x}_1 \overline{x}_1)(\mu_1\mu_2)}{sp\sqrt{\big(\frac{1}{n_1}+\frac{1}{n_2}\big)}}\\ &= \frac{(82.685.2)0}{8.1324\sqrt{\big(\frac{1}{21}+\frac{1}{43}\big)}}\\ &= 1.2009 \end{aligned} $$
Step 6 Decision (Traditional approach)
The rejection region (i.e. critical region) is $\text{t < 1.67}$.
The test statistic is $t =1.2009$ which falls $\text{outside}$ the critical region, we $\textit{fail to reject}$ the null hypothesis.
OR
Step 6 Decision ($p$value approach)
The test is $\textit{lefttailed}$ test, so pvalue is the area to the $\textit{left}$ of the test statistic ($t=1.2009$). That is pvalue = $P(t\leq 1.2009 ) = 0.1172$.
The pvalue is $0.1172$ which is $\textit{greater than}$ the significance level of $\alpha = 0.05$, we $\textit{fail to reject}$ the null hypothesis.
Independent sample $t$test Example 2
Eight culture of bacterium are split in half. Of half is tested using a standard antibiotic and the other half is tested using a new antibiotic. The time taken to kill the bacterium are given in the following table. Use an appropriate hypothesis test to assess our belief that the new antibiotic is quicker than the standard antibiotic. Use $\alpha = 0.01$.
Bacterium Culture  1  2  3  4  5  6  7  8 

Standard Antibiotic  23.6  27.9  22.9  21.8  25.8  30.7  26.5  25.4 
New Antibiotic  22.5  25.6  24.0  20.4  26.0  26.6  26.4  22.1 
Solution
Given that the sample size $n_1 = 8$, $n_2 = 8$, sample mean $\overline{x}_1= 25.575$, $\overline{x}_2= 24.2$, sample standard deviation $s_1 = 2.876$ and $s_2 = 2.317$.
Step 1 State the hypothesis testing problem
The hypothesis testing problem is
$H_0 : \mu_1 = \mu_2$ against $H_1 : \mu_1 > \mu_2$ ($\textit{righttailed}$)
Step 2 Define test statistic
The test statistic is
$$ \begin{aligned} t& =\frac{(\overline{x}_1 \overline{x}_1)(\mu_1  \mu_2)}{sp\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}} \end{aligned} $$
where the pooled standard deviation is
$$ \begin{aligned} s_p & = \sqrt{\frac{(n_11)s_1^2 +(n_21)s_2^2}{n_1+n_22}}\\ & = \sqrt{\frac{(81)2.8764^2 +(81)2.317^2}{8+82}}\\ & = 2.6117. \end{aligned} $$
Step 3 Specify the level of significance
The significance level is $\alpha = 0.01$.
Step 4 Determine the critical value
As the alternative hypothesis is $\textit{righttailed}$, the critical value of $t$ using $\alpha = 0.01$ and degrees of freedom $n_1+n_22=8+82=14$ $\text{is}$ $\text{2.624}$.
The rejection region (i.e. critical region) is $\text{t > 2.624}$.
Step 5 Computation
The test statistic under the null hypothesis is
$$ \begin{aligned} t&=\frac{(\overline{x}_1 \overline{x}_1)(\mu_1\mu_2)}{sp\sqrt{\big(\frac{1}{n_1}+\frac{1}{n_2}\big)}}\\ &= \frac{(25.57524.2)0}{2.6117\sqrt{\big(\frac{1}{8}+\frac{1}{8}\big)}}\\ &= 1.053 \end{aligned} $$
Step 6 Decision (Traditional approach)
The rejection region (i.e. critical region) is $\text{t > 2.624}$.
The test statistic is $t =1.053$ which falls $\text{outside}$ the critical region, we $\textit{fail to reject}$ the null hypothesis.
OR
Step 6 Decision ($p$value approach)
The test is $\textit{righttailed}$ test, so pvalue is the area to the $\textit{right}$ of the test statistic ($t=1.053$). That is pvalue = $P(t\geq 1.053 ) = 0.1551$.
The pvalue is $0.1551$ which is $\textit{greater than}$ the significance level of $\alpha = 0.01$, we $\textit{fail to reject}$ the null hypothesis.
Independent sample $t$test Example 3
A rope company produces ropes on two production lines. The tensile strength is an important measure of quality. A test of randomly selected ropes yields the following results:
Summary  Rope 1  Rope 2 

Mean Tensile Strength  7087 kg  7200 kg 
SD  425kg  415kg 
Sample size  25  20 
The company assumes the populations of rope tensile strengths are approximately normal with equal variances. The company suspects there is a difference in the mean values of the populations. Conduct an appropriate hypothesis test at the 0.05 significance level.
Solution
Given that the sample size $n_1 = 25$, $n_2 = 20$, sample mean $\overline{x}_1= 7087$, $\overline{x}_2= 7200$, sample standard deviation $s_1 = 425$ and $s_2 = 415$.
Step 1 State the hypothesis testing problem
The hypothesis testing problem is
$H_0 : \mu_1 = \mu_2$ against $H_1 : \mu_1 \neq \mu_2$ ($\textit{twotailed}$)
Step 2 Define test statistic
The test statistic is
$$ \begin{aligned} t& =\frac{(\overline{x}_1 \overline{x}_1)(\mu_1  \mu_2)}{sp\sqrt{\frac{1}{n_1}+\frac{1}{n_2}}} \end{aligned} $$
where the pooled standard deviation is
$$ \begin{aligned} s_p & = \sqrt{\frac{(n_11)s_1^2 +(n_21)s_2^2}{n_1+n_22}}\\ & = \sqrt{\frac{(251)425^2 +(201)415^2}{25+202}}\\ & = 420.6107. \end{aligned} $$
Step 3 Specify the level of significance
The significance level is $\alpha = 0.05$.
Step 4 Determine the critical value
As the alternative hypothesis is $\textit{twotailed}$, the critical value of $t$ using $\alpha = 0.05$ and degrees of freedom $n_1+n_22=25+202=43$ $\text{are}$ $\text{2.017 and 2.017}$.
The rejection region (i.e. critical region) is $\text{t < 2.017 or t > 2.017}$.
Step 5 Computation
The test statistic under the null hypothesis is
$$ \begin{aligned} t&=\frac{(\overline{x}_1 \overline{x}_1)(\mu_1\mu_2)}{sp\sqrt{\big(\frac{1}{n_1}+\frac{1}{n_2}\big)}}\\ &= \frac{(70877200)0}{420.6107\sqrt{\big(\frac{1}{25}+\frac{1}{20}\big)}}\\ &= 0.8955 \end{aligned} $$
Step 6 Decision (Traditional approach)
The rejection region (i.e. critical region) is $\text{t < 2.017 or t > 2.017}$.
The test statistic is $t =0.8955$ which falls $\text{outside}$ the critical region, we $\textit{fail to reject}$ the null hypothesis.
OR
Step 6 Decision ($p$value approach)
The test is $\textit{twotailed}$ test, so pvalue is the area to the $\textit{extreme}$ of the test statistic ($t=0.8955$). That is pvalue = $2*P(t\geq 0.8955 ) = 0.3755$.
The pvalue is $0.3755$ which is $\textit{greater than}$ the significance level of $\alpha = 0.05$, we $\textit{fail to reject}$ the null hypothesis.
Endnote
In this tutorial, you learned the about how to solve numerical examples on $t$test for testing two population means with unknown and equal variances. You also learned about the step by step procedure to apply $t$test for testing two population means and how to use $t$test calculator for testing two population means to get the value of test statistic, pvalue, and tcritical value.
To learn more about other hypothesis testing problems, hypothesis testing calculators and step by step procedure, please refer to the following tutorials:
Let me know in the comments if you have any questions on $t$test calculator for two means (equal variances) with examples and your thought on this article.