StudySmarter - The all-in-one study app.

4.8 • +11k Ratings

More than 3 Million Downloads

Free

Suggested languages for you:

Americas

Europe

Confidence Interval for the Difference of Two Means

- Calculus
- Absolute Maxima and Minima
- Absolute and Conditional Convergence
- Accumulation Function
- Accumulation Problems
- Algebraic Functions
- Alternating Series
- Antiderivatives
- Application of Derivatives
- Approximating Areas
- Arc Length of a Curve
- Area Between Two Curves
- Arithmetic Series
- Average Value of a Function
- Calculus of Parametric Curves
- Candidate Test
- Combining Differentiation Rules
- Combining Functions
- Continuity
- Continuity Over an Interval
- Convergence Tests
- Cost and Revenue
- Density and Center of Mass
- Derivative Functions
- Derivative of Exponential Function
- Derivative of Inverse Function
- Derivative of Logarithmic Functions
- Derivative of Trigonometric Functions
- Derivatives
- Derivatives and Continuity
- Derivatives and the Shape of a Graph
- Derivatives of Inverse Trigonometric Functions
- Derivatives of Polar Functions
- Derivatives of Sec, Csc and Cot
- Derivatives of Sin, Cos and Tan
- Determining Volumes by Slicing
- Direction Fields
- Disk Method
- Divergence Test
- Eliminating the Parameter
- Euler's Method
- Evaluating a Definite Integral
- Evaluation Theorem
- Exponential Functions
- Finding Limits
- Finding Limits of Specific Functions
- First Derivative Test
- Function Transformations
- General Solution of Differential Equation
- Geometric Series
- Growth Rate of Functions
- Higher-Order Derivatives
- Hydrostatic Pressure
- Hyperbolic Functions
- Implicit Differentiation Tangent Line
- Implicit Relations
- Improper Integrals
- Indefinite Integral
- Indeterminate Forms
- Initial Value Problem Differential Equations
- Integral Test
- Integrals of Exponential Functions
- Integrals of Motion
- Integrating Even and Odd Functions
- Integration Formula
- Integration Tables
- Integration Using Long Division
- Integration of Logarithmic Functions
- Integration using Inverse Trigonometric Functions
- Intermediate Value Theorem
- Inverse Trigonometric Functions
- Jump Discontinuity
- Lagrange Error Bound
- Limit Laws
- Limit of Vector Valued Function
- Limit of a Sequence
- Limits
- Limits at Infinity
- Limits at Infinity and Asymptotes
- Limits of a Function
- Linear Approximations and Differentials
- Linear Differential Equation
- Linear Functions
- Logarithmic Differentiation
- Logarithmic Functions
- Logistic Differential Equation
- Maclaurin Series
- Manipulating Functions
- Maxima and Minima
- Maxima and Minima Problems
- Mean Value Theorem for Integrals
- Models for Population Growth
- Motion Along a Line
- Motion in Space
- Natural Logarithmic Function
- Net Change Theorem
- Newton's Method
- Nonhomogeneous Differential Equation
- One-Sided Limits
- Optimization Problems
- P Series
- Particle Model Motion
- Particular Solutions to Differential Equations
- Polar Coordinates
- Polar Coordinates Functions
- Polar Curves
- Population Change
- Power Series
- Radius of Convergence
- Ratio Test
- Removable Discontinuity
- Riemann Sum
- Rolle's Theorem
- Root Test
- Second Derivative Test
- Separable Equations
- Separation of Variables
- Simpson's Rule
- Solid of Revolution
- Solutions to Differential Equations
- Surface Area of Revolution
- Symmetry of Functions
- Tangent Lines
- Taylor Polynomials
- Taylor Series
- Techniques of Integration
- The Fundamental Theorem of Calculus
- The Mean Value Theorem
- The Power Rule
- The Squeeze Theorem
- The Trapezoidal Rule
- Theorems of Continuity
- Trigonometric Substitution
- Vector Valued Function
- Vectors in Calculus
- Vectors in Space
- Washer Method
- Decision Maths
- Geometry
- 2 Dimensional Figures
- 3 Dimensional Vectors
- 3-Dimensional Figures
- Altitude
- Angles in Circles
- Arc Measures
- Area and Volume
- Area of Circles
- Area of Circular Sector
- Area of Parallelograms
- Area of Plane Figures
- Area of Rectangles
- Area of Regular Polygons
- Area of Rhombus
- Area of Trapezoid
- Area of a Kite
- Composition
- Congruence Transformations
- Congruent Triangles
- Convexity in Polygons
- Coordinate Systems
- Dilations
- Distance and Midpoints
- Equation of Circles
- Equilateral Triangles
- Figures
- Fundamentals of Geometry
- Geometric Inequalities
- Geometric Mean
- Geometric Probability
- Glide Reflections
- HL ASA and AAS
- Identity Map
- Inscribed Angles
- Isometry
- Isosceles Triangles
- Law of Cosines
- Law of Sines
- Linear Measure and Precision
- Median
- Parallel Lines Theorem
- Parallelograms
- Perpendicular Bisector
- Plane Geometry
- Polygons
- Projections
- Properties of Chords
- Proportionality Theorems
- Pythagoras Theorem
- Rectangle
- Reflection in Geometry
- Regular Polygon
- Rhombuses
- Right Triangles
- Rotations
- SSS and SAS
- Segment Length
- Similarity
- Similarity Transformations
- Special quadrilaterals
- Squares
- Surface Area of Cone
- Surface Area of Cylinder
- Surface Area of Prism
- Surface Area of Sphere
- Surface Area of a Solid
- Surface of Pyramids
- Symmetry
- Translations
- Trapezoids
- Triangle Inequalities
- Triangles
- Using Similar Polygons
- Vector Addition
- Vector Product
- Volume of Cone
- Volume of Cylinder
- Volume of Pyramid
- Volume of Solid
- Volume of Sphere
- Volume of prisms
- Mechanics Maths
- Acceleration and Time
- Acceleration and Velocity
- Angular Speed
- Assumptions
- Calculus Kinematics
- Coefficient of Friction
- Connected Particles
- Conservation of Mechanical Energy
- Constant Acceleration
- Constant Acceleration Equations
- Converting Units
- Elastic Strings and Springs
- Force as a Vector
- Kinematics
- Newton's First Law
- Newton's Law of Gravitation
- Newton's Second Law
- Newton's Third Law
- Power
- Projectiles
- Pulleys
- Resolving Forces
- Statics and Dynamics
- Tension in Strings
- Variable Acceleration
- Work Done by a Constant Force
- Probability and Statistics
- Bar Graphs
- Basic Probability
- Charts and Diagrams
- Conditional Probabilities
- Continuous and Discrete Data
- Frequency, Frequency Tables and Levels of Measurement
- Independent Events Probability
- Line Graphs
- Mean Median and Mode
- Mutually Exclusive Probabilities
- Probability Rules
- Probability of Combined Events
- Quartiles and Interquartile Range
- Systematic Listing
- Pure Maths
- ASA Theorem
- Absolute Value Equations and Inequalities
- Addition and Subtraction of Rational Expressions
- Addition, Subtraction, Multiplication and Division
- Algebra
- Algebraic Fractions
- Algebraic Notation
- Algebraic Representation
- Analyzing Graphs of Polynomials
- Angle Measure
- Angles
- Angles in Polygons
- Approximation and Estimation
- Area and Circumference of a Circle
- Area and Perimeter of Quadrilaterals
- Area of Triangles
- Argand Diagram
- Arithmetic Sequences
- Average Rate of Change
- Bijective Functions
- Binomial Expansion
- Binomial Theorem
- Chain Rule
- Circle Theorems
- Circles
- Circles Maths
- Combination of Functions
- Combinatorics
- Common Factors
- Common Multiples
- Completing the Square
- Completing the Squares
- Complex Numbers
- Composite Functions
- Composition of Functions
- Compound Interest
- Compound Units
- Conic Sections
- Construction and Loci
- Converting Metrics
- Convexity and Concavity
- Coordinate Geometry
- Coordinates in Four Quadrants
- Cubic Function Graph
- Cubic Polynomial Graphs
- Data transformations
- De Moivre's Theorem
- Deductive Reasoning
- Definite Integrals
- Deriving Equations
- Determinant of Inverse Matrix
- Determinants
- Differential Equations
- Differentiation
- Differentiation Rules
- Differentiation from First Principles
- Differentiation of Hyperbolic Functions
- Direct and Inverse proportions
- Disjoint and Overlapping Events
- Disproof by Counterexample
- Distance from a Point to a Line
- Divisibility Tests
- Double Angle and Half Angle Formulas
- Drawing Conclusions from Examples
- Ellipse
- Equation of Line in 3D
- Equation of a Perpendicular Bisector
- Equation of a circle
- Equations
- Equations and Identities
- Equations and Inequalities
- Estimation in Real Life
- Euclidean Algorithm
- Evaluating and Graphing Polynomials
- Even Functions
- Exponential Form of Complex Numbers
- Exponential Rules
- Exponentials and Logarithms
- Expression Math
- Expressions and Formulas
- Faces Edges and Vertices
- Factorials
- Factoring Polynomials
- Factoring Quadratic Equations
- Factorising expressions
- Factors
- Finding Maxima and Minima Using Derivatives
- Finding Rational Zeros
- Finding the Area
- Forms of Quadratic Functions
- Fractional Powers
- Fractional Ratio
- Fractions
- Fractions and Decimals
- Fractions and Factors
- Fractions in Expressions and Equations
- Fractions, Decimals and Percentages
- Function Basics
- Functional Analysis
- Functions
- Fundamental Counting Principle
- Fundamental Theorem of Algebra
- Generating Terms of a Sequence
- Geometric Sequence
- Gradient and Intercept
- Graphical Representation
- Graphing Rational Functions
- Graphing Trigonometric Functions
- Graphs
- Graphs and Differentiation
- Graphs of Common Functions
- Graphs of Exponents and Logarithms
- Graphs of Trigonometric Functions
- Greatest Common Divisor
- Growth and Decay
- Growth of Functions
- Highest Common Factor
- Hyperbolas
- Imaginary Unit and Polar Bijection
- Implicit differentiation
- Inductive Reasoning
- Inequalities Maths
- Infinite geometric series
- Injective functions
- Instantaneous Rate of Change
- Integers
- Integrating Polynomials
- Integrating Trig Functions
- Integrating e^x and 1/x
- Integration
- Integration Using Partial Fractions
- Integration by Parts
- Integration by Substitution
- Integration of Hyperbolic Functions
- Interest
- Inverse Hyperbolic Functions
- Inverse Matrices
- Inverse and Joint Variation
- Inverse functions
- Iterative Methods
- Law of Cosines in Algebra
- Law of Sines in Algebra
- Laws of Logs
- Limits of Accuracy
- Linear Expressions
- Linear Systems
- Linear Transformations of Matrices
- Location of Roots
- Logarithm Base
- Logic
- Lower and Upper Bounds
- Lowest Common Denominator
- Lowest Common Multiple
- Math formula
- Matrices
- Matrix Addition and Subtraction
- Matrix Determinant
- Matrix Multiplication
- Metric and Imperial Units
- Misleading Graphs
- Mixed Expressions
- Modulus Functions
- Modulus and Phase
- Multiples of Pi
- Multiplication and Division of Fractions
- Multiplicative Relationship
- Multiplying and Dividing Rational Expressions
- Natural Logarithm
- Natural Numbers
- Notation
- Number
- Number Line
- Number Systems
- Numerical Methods
- Odd functions
- Open Sentences and Identities
- Operation with Complex Numbers
- Operations with Decimals
- Operations with Matrices
- Operations with Polynomials
- Order of Operations
- Parabola
- Parallel Lines
- Parametric Differentiation
- Parametric Equations
- Parametric Integration
- Partial Fractions
- Pascal's Triangle
- Percentage
- Percentage Increase and Decrease
- Percentage as fraction or decimals
- Perimeter of a Triangle
- Permutations and Combinations
- Perpendicular Lines
- Points Lines and Planes
- Polynomial Graphs
- Polynomials
- Powers Roots And Radicals
- Powers and Exponents
- Powers and Roots
- Prime Factorization
- Prime Numbers
- Problem-solving Models and Strategies
- Product Rule
- Proof
- Proof and Mathematical Induction
- Proof by Contradiction
- Proof by Deduction
- Proof by Exhaustion
- Proof by Induction
- Properties of Exponents
- Proportion
- Proving an Identity
- Pythagorean Identities
- Quadratic Equations
- Quadratic Function Graphs
- Quadratic Graphs
- Quadratic functions
- Quadrilaterals
- Quotient Rule
- Radians
- Radical Functions
- Rates of Change
- Ratio
- Ratio Fractions
- Rational Exponents
- Rational Expressions
- Rational Functions
- Rational Numbers and Fractions
- Ratios as Fractions
- Real Numbers
- Reciprocal Graphs
- Recurrence Relation
- Recursion and Special Sequences
- Remainder and Factor Theorems
- Representation of Complex Numbers
- Rewriting Formulas and Equations
- Roots of Complex Numbers
- Roots of Polynomials
- Roots of Unity
- Rounding
- SAS Theorem
- SSS Theorem
- Scalar Triple Product
- Scale Drawings and Maps
- Scale Factors
- Scientific Notation
- Second Order Recurrence Relation
- Sector of a Circle
- Segment of a Circle
- Sequences
- Sequences and Series
- Series Maths
- Sets Math
- Similar Triangles
- Similar and Congruent Shapes
- Simple Interest
- Simplifying Fractions
- Simplifying Radicals
- Simultaneous Equations
- Sine and Cosine Rules
- Small Angle Approximation
- Solving Linear Equations
- Solving Linear Systems
- Solving Quadratic Equations
- Solving Radical Inequalities
- Solving Rational Equations
- Solving Simultaneous Equations Using Matrices
- Solving Systems of Inequalities
- Solving Trigonometric Equations
- Solving and Graphing Quadratic Equations
- Solving and Graphing Quadratic Inequalities
- Special Products
- Standard Form
- Standard Integrals
- Standard Unit
- Straight Line Graphs
- Substraction and addition of fractions
- Sum and Difference of Angles Formulas
- Sum of Natural Numbers
- Surds
- Surjective functions
- Tables and Graphs
- Tangent of a Circle
- The Quadratic Formula and the Discriminant
- Transformations
- Transformations of Graphs
- Translations of Trigonometric Functions
- Triangle Rules
- Triangle trigonometry
- Trigonometric Functions
- Trigonometric Functions of General Angles
- Trigonometric Identities
- Trigonometric Ratios
- Trigonometry
- Turning Points
- Types of Functions
- Types of Numbers
- Types of Triangles
- Unit Circle
- Units
- Variables in Algebra
- Vectors
- Verifying Trigonometric Identities
- Writing Equations
- Writing Linear Equations
- Statistics
- Bias in Experiments
- Binomial Distribution
- Binomial Hypothesis Test
- Bivariate Data
- Box Plots
- Categorical Data
- Categorical Variables
- Central Limit Theorem
- Chi Square Test for Goodness of Fit
- Chi Square Test for Homogeneity
- Chi Square Test for Independence
- Chi-Square Distribution
- Combining Random Variables
- Comparing Data
- Comparing Two Means Hypothesis Testing
- Conditional Probability
- Conducting a Study
- Conducting a Survey
- Conducting an Experiment
- Confidence Interval for Population Mean
- Confidence Interval for Population Proportion
- Confidence Interval for Slope of Regression Line
- Confidence Interval for the Difference of Two Means
- Confidence Intervals
- Correlation Math
- Cumulative Distribution Function
- Cumulative Frequency
- Data Analysis
- Data Interpretation
- Degrees of Freedom
- Discrete Random Variable
- Distributions
- Dot Plot
- Empirical Rule
- Errors in Hypothesis Testing
- Estimator Bias
- Events (Probability)
- Frequency Polygons
- Generalization and Conclusions
- Geometric Distribution
- Histograms
- Hypothesis Test for Correlation
- Hypothesis Test for Regression Slope
- Hypothesis Test of Two Population Proportions
- Hypothesis Testing
- Inference for Distributions of Categorical Data
- Inferences in Statistics
- Large Data Set
- Least Squares Linear Regression
- Linear Interpolation
- Linear Regression
- Measures of Central Tendency
- Methods of Data Collection
- Normal Distribution
- Normal Distribution Hypothesis Test
- Normal Distribution Percentile
- Paired T-Test
- Point Estimation
- Probability
- Probability Calculations
- Probability Density Function
- Probability Distribution
- Probability Generating Function
- Quantitative Variables
- Quartiles
- Random Variables
- Randomized Block Design
- Residual Sum of Squares
- Residuals
- Sample Mean
- Sample Proportion
- Sampling
- Sampling Distribution
- Scatter Graphs
- Single Variable Data
- Skewness
- Spearman's Rank Correlation Coefficient
- Standard Deviation
- Standard Error
- Standard Normal Distribution
- Statistical Graphs
- Statistical Measures
- Stem and Leaf Graph
- Sum of Independent Random Variables
- Survey Bias
- T-distribution
- Transforming Random Variables
- Tree Diagram
- Two Categorical Variables
- Two Quantitative Variables
- Type I Error
- Type II Error
- Types of Data in Statistics
- Variance for Binomial Distribution
- Venn Diagrams

Is it true that the average price of a cup of coffee is different depending on the size of the city you live in? It certainly seems reasonable that the average price for a cup of coffee would be more in a large city compared to a small one, but how do you tell if that is really true? Confidence intervals for the difference of two means are the way to go to really be sure of your answer. So solve your coffee woes by reading further!

If you were only interested in the average coffee price in one city you could do a confidence interval for a population mean. In that case, in order to do a proper confidence interval you would need that:

Either the sample size is large enough (\(n \ge 30\)) or the population distribution is approximately normal.

The sample is random or it is reasonable to assume it is representative of the larger population.

If you know the population standard deviation, \(\sigma\), the confidence interval is given by

\[ \bar{x} \pm (z \text{ critical value})\left(\frac{\sigma}{\sqrt{n}}\right)\]

where \(\bar{x}\) is the sample mean.

But here you have two different cities and you want to compare the average coffee price, so how do you construct the confidence interval? Let's start by listing some of the notation used going forward.

First the population notation:

Population \(1\) | Population \(2\) | |

Population Mean | \( \mu_1\) | \( \mu_2\) |

Population Standard Deviation | \(\sigma_1\) | \(\sigma_2\) |

And now for the samples:

Sample from Population \(1\) | Sample from Population \(2\) | |

Sample Size | \(n_1\) | \(n_2\) |

Sample Mean | \(\bar{x}_1\) | \(\bar{x}_2\) |

Sample Standard Deviation | \(s_1\) | \(s_2\) |

Then the conditions for constructing a confidence interval for the difference of two means are:

The samples are independent.

Either the sample size is large enough (\(n_1 \ge 30\) and \(n_2 \ge 30\)) or the population distribution is approximately normal.

The samples are random or it is reasonable to assume that the samples are representative of the larger population.

These conditions don't change even if you don't know the population standard deviations.

Because the samples are independent and random, you know that

\[ \mu_{\bar{x}_1 - \bar{x}_2} = \mu_1 - \mu_2\]

and that

\[ \sigma_{x_1 - x_2} = \sqrt{\frac{\sigma_1^2}{n_1} + \frac{\sigma_2^2}{n_2} }.\]

Then the confidence interval for the difference in the two population means is

\[\bar{x}_1 - \bar{x}_2 \pm (z \text{ critical value})\sqrt{\frac{\sigma_1^2}{n_1} +\frac{\sigma_2^2}{n_2} } .\]

In general you aren't going to know what the population standard deviations are, but let's look at an example illustrating the use of the formulas.

You do a survey of \(40\) small town coffee shops and \(49\) big city coffee shops, and find that the mean price of a large cup of coffee is \(\$3.75\) and in the big cities it is \(\$ 4.50\). You also know that the population standard deviation in small towns is \(1.20\), and in big cities the population standard deviation of \(0.98\).

Construct a \(99\%\) confidence interval for the difference of their two means, and draw conclusions from it.

**Solution:**

It helps to lay out the information you have. Call the small city Population \(1\) and the large city Population \(2\). Then you know that

\[ \begin{array}{lll} & n_1 = 40 & \bar{x}_1 = 3.75 & \sigma_1 = 1.20 \\ & n_2 = 49 & \bar{x}_2 = 4.50 & \sigma_2 = 0.98 . \end{array}\]

You know that the \(z\) critical value for a \(99\%\) confidence interval is \(2.58\). Then calculating the confidence interval for the difference in the means,

\[\begin{align} & \bar{x}_1 - \bar{x}_2 \pm (z \text{ critical value})\sqrt{\frac{\sigma_1^2}{n_1} +\frac{\sigma_2^2}{n_2} } \\ & \qquad = 3.75-4.50 \pm 2.58 \sqrt{\frac{(1.20)^2}{40} +\frac{(0.98)^2}{49} } \\ & \qquad = -0.75 \pm 2.58\sqrt{0.036 + 0.0196} \\ & \qquad \approx -0.75 \pm 0.61 \\ & \qquad = (-1.36, -0.14) .\end{align}\]

Now what can you conclude from this? First, you can conclude that the method used to construct this interval estimate is successful in capturing the actual difference in the population means about \(99\%\) of the time.

More importantly, you can conclude with \(99\%\) confidence that the actual difference in the mean price of a large cup of coffee is between \(-\$1.36\) and \(-\$0.14\). Because both endpoints of the confidence interval are negative, you can estimate that the mean price of a large cup of coffee is between \(\$0.14\) and \(\$1.36\) lower in a small town than it is in a big city.

Notice that in the previous example both ends of the confidence interval were negative. What happens if one end is negative and one end is positive? That implies that \(0\) is inside the confidence interval, so in other words it would be plausible that there was no difference in the two means.

If you don't know the population standard deviations, but you do know that your samples are independent (meaning that choosing a member of the first population doesn't affect your choice for a member of the second population), then you can calculate the confidence interval using the formula:

\[\bar{x}_1 - \bar{x}_2 \pm (t \text{ critical value})\sqrt{\frac{s_1^2}{n_1} +\frac{s_2^2}{n_2} } ,\]

where the degree of freedom for the \(t\) critical value is calculated by

\[df = \frac{(V_1 + V_2)^2}{\dfrac{V_1^2}{n_1-1} + \dfrac{V_2^2}{n_2-1} },\]

and

\[ V_1 = \frac{s_1^2}{n_1}, \quad V_2 = \frac{s_2^2}{n_2} .\]

This is the same way you would calculate the degree of freedom for a two sample \(t\)-test.

Let's look at an example of applying these formulas and drawing conclusions.

You do a survey of \(40\) small town coffee shops and \(49\) big city coffee shops, and find that the mean price of a large cup of coffee is \(\$3.75\) and in the big cities it is \(\$ 4.50\). You also know that the *sample* standard deviation in small towns is \(1.00\), and in big cities the *sample* standard deviation of \(0.70\).

Construct a \(99\%\) confidence interval for the difference of their two means, and draw conclusions from it.

**Solution:**

First finding \(V_1\) and \(V_2\),

\[ \begin{align} V_1 &= \frac{s_1^2}{n_1} \\ &= \frac{1^2}{40} \\ &= 0.025 \end{align} \]

and

\[ \begin{align} V_2 &= \frac{s_2^2}{n_2} \\ &= \frac{0.70^2}{49} \\ &= 0.01, \end{align} \]

so

\[\begin{align} df &= \frac{(V_1 + V_2)^2}{\dfrac{V_1^2}{n_1-1} + \dfrac{V_2^2}{n_2-1} } \\ &= \frac{(0.025 + 0.01 )^2}{\dfrac{0.025^2}{40-1} + \dfrac{0.01^2}{49-1} } \\ &=\frac{0.001225}{\dfrac{0.000625}{39} + \dfrac{0.0001}{48} } \\ &\approx 67.6 . \end{align}\]

Most \(t\)-tables will not have \(df = 68\) in them, however a calculator will give you the appropriate \(t\)-critical value of \(2.65\).

Then calculating the confidence interval for the difference in the two population means,

\[\begin{align} \bar{x}_1 - \bar{x}_2 & \pm (t \text{ critical value})\sqrt{\frac{s_1^2}{n_1} +\frac{s_2^2}{n_2} } \\ &\quad = 3.75-4.50 \pm (2.65)\sqrt{\frac{1^2}{40} +\frac{0.75^2}{49} } \\ &\quad \approx -0.75 \pm 0.51 \\ &\quad = (-1.26, -0.24). \end{align}\]

So you can conclude with \(99\%\) confidence that the actual difference in the mean price of a large cup of coffee is between \(-\$1.26\) and \(-\$0.24\). Because both endpoints of the confidence interval are negative, you can estimate that the mean price of a large cup of coffee is between \(\$0.24\) and \(\$1.26\) lower in a small town than it is in a big city.

How is the margin of error different from the confidence interval?

The margin of error is actually defined as half of the width of the confidence interval. So in the case of the difference between two means where you don't know the population standard deviations, the margin of error is given by

\[ \text{margin of error } = (t \text{ critical value})\sqrt{\frac{s_1^2}{n_1} +\frac{s_2^2}{n_2} }. \]

On the other hand, if you do know the population standard deviations the margin of error is

\[ \text{margin of error } = (z \text{ critical value})\sqrt{\frac{\sigma_1^2}{n_1} +\frac{\sigma_2^2}{n_2} } . \]

In either case it is just half the width of the confidence interval.

Being able to use the formula is certainly one part of making a confidence interval. Just as important is being able to use the information the formula gives you to draw conclusions. In fact most statistical software will take data you give it and do the calculations for you!

When looking at the confidence interval for the difference between two means, there are three things that can happen:

Both endpoints of the interval are negative.

Both endpoints of the interval are positive.

One endpoint is negative and one is positive.

You have already seen an example of a conclusion made when both endpoints are negative, so let's take a look at an example of the conclusion you can draw in each of the other two cases.

Suppose you have a new medical treatment, and you want to look at the mean days to recovery of people who get the treatment versus people who don't get the treatment. People were randomly assigned to either the treatment group or a placebo group. Define

- Population \(1\) - people who get the treatment; and
- Population \(2\) - people who get a placebo.

Suppose the \(90\%\) confidence interval for the difference in the two means, \(\bar{x}_1 - \bar{x}_2 \) is \( (14.7, 23.1)\). What conclusion can you draw about whether or not the treatment versus the placebo?

**Solution:**

Here both of the endpoints of the confidence interval are positive. This means you think \(\mu_1 - \mu_2 > 0\), or in other words that the mean time to recovery for people who got the medical treatment is larger than the mean time to recovery for people who got the placebo, and in fact the recovery time for people who get the medical treatment is longer by at least \(14\) days. Unfortunately this would imply that the new medical treatment does not help people recover faster.

Next, the case when one endpoint is negative and one is positive.

Let's use exactly the same setup as in the previous example. So

- Population \(1\) - people who get the treatment; and
- Population \(2\) - people who get a placebo.

Suppose the \(90\%\) confidence interval for the difference in the two means, \(\bar{x}_1 - \bar{x}_2 \) is \( (-3.4, 4.3)\). What conclusion can you draw about whether or not the treatment versus the placebo?

**Solution:**

Here zero is included in the confidence interval. That implies that it is plausible that \(\mu_1\) and \(\mu_2\) are the same. In other words, it is plausible that the new medical treatment was no more or less effective than the placebo. So you can say that while the new medical treatment probably didn't help, it also probably wasn't any worse than the placebo.

It is always helpful to see another example.

Let's look at something that you might mistake for a difference between two means problem at first.

It is common for students in a class to be given a pre-test, then learn the material, then do an actual test. This is to (hopefully) measure how much students are learning in the class. Is this actually a case where you would construct a confidence interval for the difference between the two population means?

**Solution:**

Remember that one of the conditions to construct a confidence interval for the difference of two means is that your samples are independent. In this example, a student who takes the pre-test automatically is put in the group to take the actual test. These samples are definitely **not** independent!

So while it looks like a difference of two means question, in fact you will need to look at the people in the class and the difference in their test scores and do a confidence interval for a population mean.

Just because there is the word "difference" there doesn't imply you have to do a confidence interval for the difference between two means. These are considered **matched paired samples**, and a standard confidence interval for a population mean is the way to tackle this problem.

Next let's look at an example where the samples are independent.

Suppose that you want to know if the color of the coffee mug impacts how people think about the flavor. You get \(24\) people and assign them randomly to one of two treatment groups; either a white coffee mug or an orange coffee mug.

Both groups were given exactly the same coffee and asked to rate the flavor on a scale of \(0\) to \(100\). The results are in the table below.

Sample | Sample size | Mean quality rating | Sample standard deviation |

Sample 1: white coffee mug | \(n_1 = 12\) | \(\bar{x}_1 = 50.35\) | \(s_1 = 20.17\) |

Sample 2: orange coffee mug | \(n_2 = 12\) | \(\bar{x}_2= 61.48\) | \(s_2 = 16.69\) |

Can you conclude that the color of the mug makes a difference in the mean quality rating of the coffee?

**Solution:**

First let's check to be sure that all of the conditions to construct a confidence interval for the difference of two means are satisfied. The samples are certainly independent and randomly selected, however the sample size is less than \(30\). That means you will need to assume that the distributions of the two quality ratings are approximately normal. It isn't unreasonable to assume that, but it will need to be mentioned when you make a conclusion.

Next you will need to calculate the degrees of freedom. Here

\[ \begin{align} V_1 &= \frac{s_1^2}{n_1} \\ &= \frac{(20.17)^2}{12} \\ & \approx 33.9, \end{align} \]

and

\[ \begin{align} V_2 &= \frac{s_2^2}{n_2} \\ &= \frac{(16.69)^2}{12} \\ &\approx 23.2, \end{align}\]

so

\[\begin{align} df &= \frac{(33.9 + 23.2)^2}{\dfrac{(33.9)^2}{12-1} + \dfrac{(23.2)^2}{12-1} } \\ &= \frac{3260.41}{\dfrac{1149.21}{11} + \dfrac{538.23}{11} } \\ &\approx 21.25 . \end{align}\]

A confidence level wasn't given, but a \(95\%\) level is common to use. So the \(t\)-critical value would be \(2.08\).

Then constructing the confidence interval,

\[ \begin{align} \bar{x}_1 - \bar{x}_2 &\pm (t \text{ critical value})\sqrt{\frac{s_1^2}{n_1} +\frac{s_2^2}{n_2} } \\ &\quad = 50.35 - 61.49 \pm 2.08\sqrt{\frac{(20.17)^2}{12} +\frac{(16.69)^2}{12} } \\ & \quad \approx -11.14 \pm 14.72 \\ &\quad = (-26.85, 4.67).\end{align}\]

So assuming that the distributions of the two quality ratings are approximately normal, you can conclude with \(95\%\) confidence that the actual difference in the mean rating is between \(-26.85\) and \(4.67\). Because zero is in the confidence interval it is plausible to conclude that there is no difference in the mean flavor scale rating between the white mug and the orange mug.

- The conditions for constructing a confidence interval for the difference of two means are:
The samples are independent.

Either the sample size is large enough (\(n_1 \ge 30\) and \(n_2 \ge 30\)) or the population distribution is approximately normal.

The samples are random or it is reasonable to assume that the samples are representative of the larger population.

If you know the population standard deviations, the formula for the confidence interval for the difference in the two means is

\[\bar{x}_1 - \bar{x}_2 \pm (z \text{ critical value})\sqrt{\frac{\sigma_1^2}{n_1} +\frac{\sigma_2^2}{n_2} } ,\]where \(\bar{x}_1\) is the mean for sample \(1\), \(\bar{x}_2\) is the mean for sample \(2\), \(\sigma_1 \) is the standard deviation for population \(1\), and \(\sigma_2\) is the standard deviation for population \(2\).

The degree of freedom for a confidence interval for the difference of two means is calculated by

\[df = \frac{(V_1 + V_2)^2}{\dfrac{V_1^2}{n_1-1} + \dfrac{V_2^2}{n_2-1} },\]

where \(n_1\) and \(n_2\) are the sample sizes, \(s_1\) and \(s_2\) are the sample standard deviations, and

\[ V_1 = \frac{s_1^2}{n_1}, \quad V_2 = \frac{s_2^2}{n_2} .\]

If you don't know the population standard deviation, the formula for the confidence interval for the difference in two means is

\[\bar{x}_1 - \bar{x}_2 \pm (t \text{ critical value})\sqrt{\frac{s_1^2}{n_1} +\frac{s_2^2}{n_2} } ,\]where \(n_1\) and \(n_2\) are the sample sizes, \(s_1\) and \(s_2\) are the sample standard deviations, and \(\bar{x_1}\) and \(\bar{x}_2\) are the sample means.

More about Confidence Interval for the Difference of Two Means

60%

of the users don't pass the Confidence Interval for the Difference of Two Means quiz! Will you pass the quiz?

Start QuizBe perfectly prepared on time with an individual plan.

Test your knowledge with gamified quizzes.

Create and find flashcards in record time.

Create beautiful notes faster than ever before.

Have all your study materials in one place.

Upload unlimited documents and save them online.

Identify your study strength and weaknesses.

Set individual study goals and earn points reaching them.

Stop procrastinating with our study reminders.

Earn points, unlock badges and level up while studying.

Create flashcards in notes completely automatically.

Create the most beautiful study materials using our templates.

Sign up to highlight and take notes. It’s 100% free.

Over 10 million students from across the world are already learning smarter.

Get Started for Free