# Two Population Calculator

##### Confidence Interval
 $n_1$ = x̄₁ p̄₁ x̄₁p̄₁ = σ₁ s₁ = $n_2$ = x̄₂ = σ₂ =
$\text{Confidence Level:}$ %
 $\text{Equal Variance}$
Example 1Example 2
##### Hypothesis Testing
 $H_o$: μ₁ - μ₂ p₁ - p₂ $\mu_d$ ≥ ≤ = 0 $H_a$: μ₁ - μ₂$\mu_d$ < > ≠ $D_o$
 $n_1$ = $\bar{x}_1$$\bar{p}_1$ = σ₁ s₁ = $n_2$ = $\bar{x}_2$ = σ₂ =
 $\text{Level of Significance:}$ $\alpha$ = .10 .05 .01 ⋯
 $\text{Matched Samples}$
Example 1Example 2

When computing confidence intervals for two population means, we are interested in the difference between the population means ($\mu_1 - \mu_2$). A confidence interval is made up of two parts, the point estimate and the margin of error. The point estimate of the difference between two population means is simply the difference between two sample means ($\bar{x}_1 - \bar{x}_2$). The standard error of $\bar{x}_1 - \bar{x}_2$, which is used in computing the margin of error, is given by the formula below.

 Point Estimate Standard Error $\bar{x}_1 - \bar{x}_2$ $\sqrt{\dfrac{\sigma_1^2}{n_1}+\dfrac{\sigma_2^2}{n_2}}$

The formula for the margin of error depends on whether the population standard deviations ($\sigma_1$ and $\sigma_2$) are known or unknown. If the population standard deviations are known, then they are used in the formula. If they are unknown, then the sample standard deviations ($s_1$ and $s_2$)are used in their place. To change from $\sigma$ known to $\sigma$ unknown, click on $\boxed{σ}$ and select $\boxed{s}$ in the Two Population Calculator.

 $\sigma$ Known $\sigma$ Unknown Margin of Error $z_{\alpha/2} \sqrt{\dfrac{\sigma_1^2}{n_1}+\dfrac{\sigma_2^2}{{\color{Black}n_2}}}$ $t_{\alpha/2} \sqrt{\dfrac{s_1^2}{n_1}+\dfrac{s_2^2}{n_2}}$

While the formulas for the margin of error in the two population case are similar to those in the one population case, the formula for the degrees of freedom is quite a bit more complicated. Although this formula does seem intimidating at first sight, there is a shortcut to get the answer faster. Notice that the terms $\frac{s_1^2}{n_1}$ and $\frac{s_2^2}{n_2}$ each repeat twice. The terms are actually computed previously when finding the margin of error so they don't need to be calculated again.

 Degrees of Freedom $df = \frac{\left(\dfrac{s_1^2}{n_1}+\dfrac{s_2^2}{n_2}\right)^2}{\dfrac{1}{n_1-1}\left(\dfrac{s_1^2}{n_1}\right)^2 + \dfrac{1}{n_2-1}\left(\dfrac{s_2^2}{n_2}\right)^2}$

If the two population variances are assumed to be equal, an alternative formula for computing the degrees of freedom is used. It's simply df = n1 + n2 - 2. This is a simple extension of the formula for the one population case. In the one population case the degrees of freedom is given by df = n - 1. If we add up the degrees of freedom for the two samples we would get df = (n1 - 1) + (n2 - 1) = n1 + n2 - 2. This formula gives a pretty good approximation of the more complicated formula above.

Just like in hypothesis tests about a single population mean, there are lower-tail, upper-tail and two tailed tests. However, the null and alternative are slightly different. First of all, instead of having mu on the left side of the equality, we have $\mu_1 - \mu_2$. On the right side of the equality, we don't have $\mu_0$, the hypothesized value of the population mean. Instead we have $D_0$, the hypothesized difference between the population means. To switch from a lower tail test to an upper tail or two-tailed test, click on $\boxed{\geq}$ and select $\boxed{\leq}$ or $\boxed{=}$, respectively.

 Lower Tail Test Upper Tail Test $H_0 \colon \mu_1 - \mu_2 \geq D_0$ $H_0 \colon \mu_1 - \mu_2 \leq D_0$ $H_a \colon \mu_1 - \mu_2 < D_0$ $H_a \colon \mu_1 - \mu_2 > D_0$

Again, hypothesis testing for a single population mean is very similar to hypothesis testing for two population means. For a single population mean, the test statistics is the difference between mu and mu0 dividied by the standard error. For two population means, the test statistic is the difference between $\bar{x}_1 - \bar{x}_2$ and $D_0$ divided by the standard error. The procedure after computing the test statistic is identical to the one population case. That is, you proceed with the p-value approach or critical value approach in the same exact way.

 $\sigma$ Known $\sigma$ Unknown $z = \dfrac{(\bar{x}_1 - \bar{x}_2)-D_0}{\sqrt{\dfrac{\sigma_1^2}{n_1}+\dfrac{\sigma_2^2}{n_2}}}$ $t = \dfrac{(\bar{x}_1 - \bar{x}_2)-D_0}{\sqrt{\dfrac{s_1^2}{n_1}+\dfrac{s_2^2}{n_2}}}$

The calculator above computes confidence intervals and hypothesis tests for the difference between two population means. The simpler version of this is confidence intervals and hypothesis tests for a single population mean. For confidence intervals about a single population mean, visit the Confidence Interval Calculator. For hypothesis tests about a single population mean, visit the Hypothesis Testing Calculator.