#set document(title: "9.6 Difference Between Means", author: "OpenStax") #set page(width: 8.5in, height: auto, margin: 1in) #import "@preview/cetz:0.5.2" #set text(font: ("STIX Two Text", "Libertinus Serif", "New Computer Modern"), size: 10.5pt, lang: "en") #show math.equation: set text(font: ("STIX Two Math", "New Computer Modern Math")) #set par(justify: true, leading: 0.62em, spacing: 0.9em) #set enum(spacing: 1.1em) // room between list items so tall inline fractions don't collide #set list(spacing: 1.1em) #set table(stroke: 0.5pt + rgb("#c7ccd3")) #let BLUE = rgb("#183B6F") // brand navy — section bars + example/solution labels (white on navy 11.09:1) #let ORANGE = rgb("#A94509") // brand primary-700 — AA-safe deep orange for TEXT (5.93:1 on white; raw brand #F37021 is 2.94:1 and must never carry text) #let RED = rgb("#DC2626") // brand error-600 #let GREEN = rgb("#059669") // brand success-600 (decoration only; small green text uses green-text #007942) #show heading.where(level: 1): it => block(width: 100%, above: 0pt, below: 16pt, fill: gradient.linear(BLUE, rgb("#2C5AA0")), inset: (x: 14pt, y: 12pt), radius: 3pt, text(fill: white, weight: "bold", size: 19pt, it.body)) #show heading.where(level: 2): it => block(width: 100%, above: 18pt, below: 10pt, fill: BLUE, inset: (x: 10pt, y: 6pt), radius: 2pt, text(fill: white, weight: "bold", size: 12pt, it.body)) #show heading.where(level: 3): it => text(fill: ORANGE, weight: "bold", size: 12.5pt, it.body) #show heading.where(level: 4): it => text(fill: BLUE, weight: "bold", size: 10.5pt, it.body) #let examplebox(label, title, body) = block(width: 100%, breakable: true, fill: rgb("#EFF1F5"), stroke: 0.5pt + rgb("#CFDDF0"), radius: 4pt, inset: 10pt, above: 12pt, below: 12pt)[ #block(below: 6pt)[#box(fill: BLUE, inset: (x: 6pt, y: 2pt), radius: 2pt, text(fill: white, weight: "bold", size: 8.5pt, label)) #h(0.4em) #strong[#title]] #body] // rail = decorative left rule (raw brand token); labelcolor = AA-safe label text shade #let notebox(label, rail, labelcolor, tint, body) = block(width: 100%, breakable: true, fill: tint, stroke: (left: 3pt + rail), inset: (left: 10pt, rest: 8pt), radius: (right: 4pt), above: 11pt, below: 11pt)[ #text(fill: labelcolor, weight: "bold", size: 7.5pt, tracking: 0.5pt)[#upper(label)] #linebreak() #body] #let solutionbox(body) = block(above: 4pt, below: 8pt)[ #text(fill: BLUE, weight: "bold", size: 8.5pt)[Solution] #linebreak() #body] #let figph(msg) = block(width: 100%, height: 60pt, fill: rgb("#f6f7f9"), stroke: (paint: rgb("#c7ccd3"), dash: "dashed"), radius: 4pt, inset: 10pt)[ #align(center + horizon, text(fill: rgb("#889"), style: "italic", size: 9pt, msg))] // Standardize inlined figure sizes: measure the natural CeTZ canvas, then scale to a // consistent envelope (aspect-aware; see build_typst.py FIG_* constants). Unlike the // print preamble, dimensions are FLOORED: in an editor a user can trim a figure to a // degenerate 1-D shape (a bare line), and w/h or tw/w would then divide by zero. #let _STD_W = 3.5 #let _WIDE_W = 5.6 #let _MAX_H = 3.4 #let _ASPECT_WIDE = 2.2 #let _UPSCALE_MAX = 1.15 #let stdfig(body) = context { let m = measure(body) let w = calc.max(m.width / 1in, 0.01) let h = calc.max(m.height / 1in, 0.01) let tw = if w / h > _ASPECT_WIDE { _WIDE_W } else { _STD_W } let s = calc.min(tw / w, _MAX_H / h, _UPSCALE_MAX) align(center, box(scale(x: s * 100%, y: s * 100%, reflow: true, body))) } #show figure: set block(breakable: false) #set figure(gap: 8pt) #show figure.caption: set text(size: 8.5pt, fill: rgb("#555")) == 9.6#h(0.6em)Difference Between Means #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Prerequisites] Sampling Distributions, Sampling Distribution of the Mean, Variance Sum Law I #linebreak() #linebreak() ] #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Learning Objectives] + State the mean and variance of the sampling distribution of the difference between means + Compute the standard error of the difference between means + Compute the probability of a difference between means being above a specified value ] Statistical analyses are very often concerned with the difference between means. A typical example is an experiment designed to compare the mean of a control group with the mean of an experimental group. Inferential statistics used in the analysis of this type of experiment depend on the sampling distribution of the difference between means. The sampling distribution of the difference between means can be thought of as the distribution that would result if we repeated the following three steps over and over again: (1) sample n#sub[1] scores from Population 1 and n#sub[2] scores from Population 2, (2) compute the means of the two samples (M#sub[1] and M#sub[2]), and (3) compute the difference between means, M#sub[1] - M#sub[2]. The distribution of the differences between means is the sampling distribution of the difference between means. As you might expect, the mean of the sampling distribution of the difference between means is: #math.equation(block: true, alt: "μ sub M sub 1 minus M sub 2 equals μ sub 1 minus μ sub 2")[$μ_(M_(1) − M_(2)) = μ_(1) − μ_(2)$] which says that the mean of the distribution of differences between sample means is equal to the difference between population means. For example, say that the mean test score of all 12-year-olds in a population is 34 and the mean of 10-year-olds is 25. If numerous samples were taken from each age group and the mean difference computed each time, the mean of these numerous differences between sample means would be 34 - 25 = 9. From the variance sum law, we know that: #math.equation(block: true, alt: "σ sub M sub 1 minus M sub 2 squared equals σ sub M sub 1 squared plus σ sub M sub 2 squared")[$σ_(M_(1) − M_(2))^(2) = σ_(M_(1))^(2) + σ_(M_(2))^(2)$] which says that the variance of the sampling distribution of the difference between means is equal to the variance of the sampling distribution of the mean for Population 1 plus the variance of the sampling distribution of the mean for Population 2. Recall the formula for the variance of the sampling distribution of the mean: #math.equation(block: true, alt: "σ sub M squared equals the fraction σ squared over N")[$σ_(M)^(2) = frac(σ^(2), N)$] Since we have two populations and two samples sizes, we need to distinguish between the two variances and sample sizes. We do this by using the subscripts 1 and 2. Using this convention, we can write the formula for the variance of the sampling distribution of the difference between means as: #math.equation(block: true, alt: "σ sub M sub 1 minus M sub 2 squared equals the fraction σ sub 1 squared over n sub 1 plus the fraction σ sub 2 squared over n sub 2")[$σ_(M_(1) − M_(2))^(2) = frac(σ_(1)^(2), n_(1)) + frac(σ_(2)^(2), n_(2))$] Since the standard error of a sampling distribution is the standard deviation of the sampling distribution, the standard error of the difference between means is: #math.equation(block: true, alt: "σ sub M sub 1 minus M sub 2 equals the square root of the fraction σ sub 1 squared over n sub 1 plus the fraction σ sub 2 squared over n sub 2")[$σ_(M_(1) − M_(2)) = sqrt(frac(σ_(1)^(2), n_(1)) + frac(σ_(2)^(2), n_(2)))$] Just to review the notation, the symbol on the left contains a sigma (σ), which means it is a standard deviation. The subscripts M#sub[1] - M#sub[2] indicate that it is the standard deviation of the sampling distribution of M#sub[1] - M#sub[2]. Now let's look at an application of this formula. Assume there are two species of green beings on Mars. The mean height of Species 1 is 32 while the mean height of Species 2 is 22. The variances of the two species are 60 and 70, respectively and the heights of both species are normally distributed. You randomly sample 10 members of Species 1 and 14 members of Species 2. What is the probability that the mean of the 10 members of Species 1 will exceed the mean of the 14 members of Species 2 by 5 or more? Without doing any calculations, you probably know that the probability is pretty high since the difference in population means is 10. But what exactly is the probability? First, let's determine the sampling distribution of the difference between means. Using the formulas above, the mean is #math.equation(block: true, alt: "μ sub M sub 1 minus M sub 2 equals 32 minus 22 equals 10")[$μ_(M_(1) − M_(2)) = 32 − 22 = 10$] The standard error is: #math.equation(block: true, alt: "σ sub M sub 1 minus M sub 2 equals the square root of the fraction 60 over 10 plus the fraction 70 over 14 equals 3.317")[$σ_(M_(1) − M_(2)) = sqrt(frac(60, 10) + frac(70, 14)) = 3.317$] The sampling distribution is shown in Figure 1. Notice that it is normally distributed with a mean of 10 and a standard deviation of 3.317. The area above 5 is shaded blue. #figure(figph[Normal curve on an axis running -3.3 to 23.3, centered at 10 — the sampling distribution of the difference between two means, with a standard deviation of 3.317. Everything above 5 is shaded blue, covering most of the distribution.], alt: "Normal curve on an axis running -3.3 to 23.3, centered at 10 — the sampling distribution of the difference between two means, with a standard deviation of 3.317. Everything above 5 is shaded blue, covering most of the distribution.", caption: [Figure 1. The sampling distribution of the difference between means.]) The last step is to determine the area that is shaded blue. Using either a Z table or the normal calculator, the area can be determined to be 0.934. Thus the probability that the mean of the sample from Species 1 will exceed the mean of the sample from Species 2 by 5 or more is 0.934. As shown below, the formula for the standard error of the difference between means is much simpler if the sample sizes and the population variances are equal. When the variances and samples sizes are the same, there is no need to use the subscripts 1 and 2 to differentiate these terms. #math.equation(block: true, alt: "σ sub M sub 1 minus M sub 2 equals the square root of the fraction σ sub 1 squared over n sub 1 plus the fraction σ sub 2 squared over n sub 2 equals the square root of the fraction σ squared over n plus the fraction σ squared over n equals the square root of the fraction 2 σ squared over n")[$σ_(M_(1) − M_(2)) = sqrt(frac(σ_(1)^(2), n_(1)) + frac(σ_(2)^(2), n_(2))) = sqrt(frac(σ^(2), n) + frac(σ^(2), n)) = sqrt(frac(2 σ^(2), n))$] This simplified version of the formula can be used for the following problem: The mean height of 15-year-old boys (in cm) is 175 and the variance is 64. For girls, the mean is 165 and the variance is 64. If eight boys and eight girls were sampled, what is the probability that the mean height of the sample of girls would be higher than the mean height of the sample of boys? In other words, what is the probability that the mean height of girls minus the mean height of boys is greater than 0? As before, the problem can be solved in terms of the sampling distribution of the difference between means (girls - boys). The mean of the distribution is 165 - 175 = -10. The standard deviation of the distribution is: #math.equation(block: true, alt: "σ sub M sub 1 minus M sub 2 equals the square root of the fraction 2 σ squared over n equals the square root of the fraction open parenthesis 2 close parenthesis open parenthesis 64 close parenthesis over 8 equals 4")[$σ_(M_(1) − M_(2)) = sqrt(frac(2 σ^(2), n)) = sqrt(frac(( 2 ) ( 64 ), 8)) = 4$] A graph of the distribution is shown in Figure 2. It is clear that it is unlikely that the mean height for girls would be higher than the mean height for boys since in the population boys are quite a bit taller. Nonetheless it is not inconceivable that the girls' mean could be higher than the boys' mean. #figure(figph[Normal curve on an axis from -26 to 6, centered at -10 — the sampling distribution of the difference between the girls' and boys' mean heights. Only the thin sliver above 0 is shaded blue: boys are on average considerably taller, but it is not inconceivable for a sample of girls to have the higher mean.], alt: "Normal curve on an axis from -26 to 6, centered at -10 — the sampling distribution of the difference between the girls' and boys' mean heights. Only the thin sliver above 0 is shaded blue: boys are on average considerably taller, but it is not inconceivable for a sample of girls to have the higher mean.", caption: [Figure 2. Sampling distribution of the difference between mean heights.]) A difference between means of 0 or higher is a difference of 10/4 = 2.5 standard deviations above the mean of -10. The probability of a score 2.5 or more standard deviations above the mean is 0.0062.