#set document(title: "9.2 Paired Samples for Two Means", author: "Kathryn Kozak") #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.2#h(0.6em)Paired Samples for Two Means Are two populations the same? Is the average height of men taller than the average height of women? Is the mean weight less after a diet than before? You can compare populations by comparing their means. You take a sample from each population and compare the statistics. Anytime you compare two populations you need to know if the samples are independent or dependent. The formulas you use are different for different types of samples. If how you choose one sample has no effect on the way you choose the other sample, the two samples are #strong[independent]. The way to think about it is that in independent samples, the individuals from one sample are overall different from the individuals from the other sample. This will mean that sample one has no affect on sample two. The sample values from one sample are not related or paired with values from the other sample. If you choose the samples so that a measurement in one sample is paired with a measurement from the other sample, the samples are #strong[dependent]or #strong[matched]or #strong[paired]. (Often a before and after situation.) You want to make sure the there is a meaning for pairing data values from one sample with a specific data value from the other sample. One way to think about it is that in dependent samples, the individuals from one sample are the same individuals from the other sample, though there can be other reasons to pair values. This makes the sample values from each sample paired. #examplebox("Example 1")[independent or dependent samples][ Determine if the following are dependent or independent samples. + Randomly choose 5 men and 6 women and compare their heights. + Choose 10 men and weigh them. Give them a new wonder diet drug and later weigh them again. + Take 10 people and measure the strength of their dominant arm and their non-dominant arm. #solutionbox[ + Independent, since there is no reason that one value belongs to another. The individuals are not the same for both samples. The individuals are definitely different. A way to think about this is that the knowledge that a man is chosen in one sample does not give any information about any of the woman chosen in the other sample. + Dependent, since each person’s before weight can be matched with their after weight. The individuals are the same for both samples. A way to think about this is that the knowledge that a person weighs 400 pounds at the beginning will tell you something about their weight after the diet drug. + Dependent, since you can match the two arm strengths. The individuals are the same for both samples. So the knowledge of one person’s dominant arm strength will tell you something about the strength of their non-dominant arm. ] ] To analyze data when there are matched or paired samples, called dependent samples, you conduct a paired t-test. Since the samples are matched, you can find the difference between the values of the two random variables. === Hypothesis Test for Two Sample Paired #emph[t]-Test + State the random variables and the parameters in words. #linebreak() #math.equation(block: false, alt: "x sub 1")[$x_(1)$] = random variable 1 #linebreak() #math.equation(block: false, alt: "x sub 2")[$x_(2)$] = random variable 2 #linebreak() #math.equation(block: false, alt: "μ sub 1")[$μ_(1)$] = mean of random variable 1 #linebreak() #math.equation(block: false, alt: "μ sub 2")[$μ_(2)$] = mean of random variable 2 + State the null and alternative hypotheses and the level of significance The usual hypotheses would be #linebreak() #math.equation(block: false, alt: "H sub o : μ sub 1 equals μ sub 2 or H sub o : μ sub 1 minus μ sub 2 equals 0; H sub A : μ sub 1 less than μ sub 2 H sub A : μ sub 1 minus μ sub 2 less than 0; H sub A : μ sub 1 greater than μ sub 2 H sub A : μ sub 1 minus μ sub 2 greater than 0; H sub A : μ sub 1 not equal to μ sub 2 H sub A : μ sub 1 minus μ sub 2 not equal to 0")[$H_(o) : μ_(1) = μ_(2) " or " H_(o) : μ_(1) − μ_(2) = 0 \ H_(A) : μ_(1) < μ_(2) H_(A) : μ_(1) − μ_(2) < 0 \ H_(A) : μ_(1) > μ_(2) H_(A) : μ_(1) − μ_(2) > 0 \ H_(A) : μ_(1) ≠ μ_(2) H_(A) : μ_(1) − μ_(2) ≠ 0$] #linebreak() However, since you are finding the differences, then you can actually think of #math.equation(block: false, alt: "μ sub 1 minus μ sub 2 equals μ sub σ μ sub d equals")[$μ_(1) − μ_(2) = μ_(σ) μ_(d) =$] population mean value of the differences, #linebreak() So the hypotheses become #linebreak() #math.equation(block: false, alt: "H sub o : μ sub d equals 0; H sub 1 : μ sub d less than 0; H sub A : μ sub d greater than 0; H sub A : μ sub d not equal to 0")[$H_(o) : μ_(d) = 0 \ H_(1) : μ_(d) < 0 \ H_(A) : μ_(d) > 0 \ H_(A) : μ_(d) ≠ 0$] #linebreak() Also, state your #math.equation(block: false, alt: "α")[$α$] level here. + State and check the assumptions for the hypothesis test + A random sample of #emph[n] pairs is taken. + The population of the difference between random variables is normally distributed. In this case the population you are interested in has to do with the differences that you find. It does not matter if each random variable is normally distributed. It is only important if the differences you find are normally distributed. Just as before, the t-test is fairly robust to the assumption if the sample size is large. This means that if this assumption isn’t met, but your sample size is quite large (over 30), then the results of the t-test are valid. + Find the sample statistic, test statistic, and p-value #linebreak() Sample Statistic: #linebreak() Difference: #math.equation(block: false, alt: "d equals x sub 1 minus x sub 2")[$d = x_(1) − x_(2)$]for each pair #linebreak() Sample mean of the differences: #math.equation(block: false, alt: "d ― equals the fraction ∑ d over n")[$limits(d)^(―) = frac(∑ d, n)$] #linebreak() Standard deviation of the differences: #math.equation(block: false, alt: "s sub d equals the fraction ∑ open parenthesis d minus d ― close parenthesis squared over n minus 1")[$s_(d) = frac(∑ ( d − limits(d)^(―) )^(2), n − 1)$] #linebreak() Number of pairs: #emph[n] #linebreak() Test Statistic: #linebreak() #math.equation(block: false, alt: "t equals the fraction d ― minus μ sub d over the fraction s sub d over the square root of n")[$t = frac(limits(d)^(―) − μ_(d), frac(s_(d), sqrt(n)))$] #linebreak() with degrees of freedom = #emph[df] = #emph[n]- 1 p-value: #linebreak() On TI-83/84: Use tcdf ( lower limit, upper limit, #emph[df] ) On R: Use pt (#emph[t], #emph[df]) #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Note] #math.equation(block: false, alt: "μ sub d equals 0")[$μ_(d) = 0$] in most cases. ] #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Note] If #math.equation(block: false, alt: "H sub A : μ sub d less than 0")[$H_(A) : μ_(d) < 0$], then lower limit is #math.equation(block: false, alt: "minus 1 E 99")[$− 1 E 99$] and upper limit is your test statistic. If #math.equation(block: false, alt: "H sub A : μ sub d greater than 0")[$H_(A) : μ_(d) > 0$], then lower limit is your test statistic and the upper limit is #math.equation(block: false, alt: "1 E 99")[$1 E 99$]. If #math.equation(block: false, alt: "H sub A : μ sub d not equal to 0")[$H_(A) : μ_(d) ≠ 0$], then find the p-value for #math.equation(block: false, alt: "H sub A : μ sub d less than 0")[$H_(A) : μ_(d) < 0$], and multiply by 2.) ] #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Note] If #math.equation(block: false, alt: "H sub A : μ sub d less than 0")[$H_(A) : μ_(d) < 0$], use pt (#emph[t], #emph[df] ). If #math.equation(block: false, alt: "H sub A : μ sub d greater than 0")[$H_(A) : μ_(d) > 0$], use 1 - pt(#emph[t], #emph[df]). If #math.equation(block: false, alt: "H sub A : μ sub d not equal to 0")[$H_(A) : μ_(d) ≠ 0$], then find the p-value for #math.equation(block: false, alt: "H sub A : μ sub d less than 0")[$H_(A) : μ_(d) < 0$], and multiply by 2 ] + This is where you write reject #math.equation(block: false, alt: "H sub o")[$H_(o)$] or fail to reject #math.equation(block: false, alt: "H sub o")[$H_(o)$]. The rule is: if the p-value \< #math.equation(block: false, alt: "α")[$α$], then reject #math.equation(block: false, alt: "H sub o")[$H_(o)$]. If the p-value #math.equation(block: false, alt: "greater than or equal to α")[$≥ α$], then fail to reject #math.equation(block: false, alt: "H sub o")[$H_(o)$]. + This is where you interpret in real world terms the conclusion to the test. The conclusion for a hypothesis test is that you either have enough evidence to show #math.equation(block: false, alt: "H sub A")[$H_(A)$] is true, or you do not have enough evidence to show #math.equation(block: false, alt: "H sub A")[$H_(A)$] is true. === Confidence Interval for Difference in Means from Paired Samples (t-Interval) The confidence interval for the difference in means has the same random variables and means and the same assumptions as the hypothesis test for two paired samples. If you have already completed the hypothesis test, then you do not need to state them again. If you haven’t completed the hypothesis test, then state the random variables and means, and state and check the assumptions before completing the confidence interval step. + Find the sample statistic and confidence interval #linebreak() Sample Statistic: #linebreak() Difference: #emph[d] = #math.equation(block: false, alt: "x sub 1 minus x sub 2")[$x_(1) − x_(2)$] #linebreak() Sample mean of the differences: #math.equation(block: false, alt: "d ― equals the fraction ∑ d over n")[$limits(d)^(―) = frac(∑ d, n)$] #linebreak() Standard deviation of the differences: #math.equation(block: false, alt: "s sub d equals the fraction ∑ open parenthesis d minus d ― close parenthesis squared over n minus 1")[$s_(d) = frac(∑ ( d − limits(d)^(―) )^(2), n − 1)$] #linebreak() Number of pairs: #emph[n] #linebreak() Confidence Interval: #linebreak() The confidence interval estimate of the difference #math.equation(block: false, alt: "μ sub d equals μ sub 1 minus μ sub 2")[$μ_(d) = μ_(1) − μ_(2)$] is #linebreak() #math.equation(block: false, alt: "d ― minus E less than μ sub d less than d ― plus E; E equals t sub c the fraction s sub d over the square root of n")[$limits(d)^(―) − E < μ_(d) < limits(d)^(―) + E \ E = t_(c) frac(s_(d), sqrt(n))$] #linebreak() #math.equation(block: false, alt: "t sub c")[$t_(c)$] is the critical value where degrees of freedom #emph[df] = #emph[n]- 1 + Statistical Interpretation: In general this looks like, “there is a C% chance that the statement #math.equation(block: false, alt: "d ― minus E less than μ sub d less than d ― plus E")[$limits(d)^(―) − E < μ_(d) < limits(d)^(―) + E$] contains the true mean difference.” + Real World Interpretation: This is where you state what interval contains the true mean difference. The critical value is a value from the Student’s t-distribution. Since a confidence interval is found by adding and subtracting a margin of error amount from the sample mean, and the interval has a probability of containing the true mean difference, then you can think of this as the statement #math.equation(block: false, alt: "P open parenthesis d ― minus E less than μ sub d less than d ― plus E close parenthesis equals C")[$P ( limits(d)^(―) − E < μ_(d) < limits(d)^(―) + E ) = C$]. To find the critical value, you use table A.2 in the Appendix. ==== How to check the assumptions of t-test and confidence interval: In order for the t-test or confidence interval to be valid, the assumptions of the test must be met. So whenever you run a t-test or confidence interval, you must make sure the assumptions are met. So you need to check them. Here is how you do this: + For the assumption that the sample is a random sample, describe how you took the samples. Make sure your sampling technique is random and that the samples were dependent. + For the assumption that the population of the differences is normal, remember the process of assessing normality from chapter 6. #examplebox("Example 2")[hypothesis test for paired samples using the formula][ A researcher wants to see if a weight loss program is effective. She measures the weight of 6 randomly selected women before and after the weight loss program (see Example #math.equation(block: false, alt: "1")[$1$]). Is there evidence that the weight loss program is effective? Test at the 5% level. #figure(table( columns: 7, align: left, inset: 6pt, table.header([Person], [1], [2], [3], [4], [5], [6]), [Weight before], [165], [172], [181], [185], [168], [175], [Weight after], [143], [151], [156], [161], [152], [154], )) + State the random variables and the parameters in words. + State the null and alternative hypotheses and the level of significance. + State and check the assumptions for the hypothesis test. + Find the sample statistic, test statistic, and p-value. + Conclusion + Interpretation #solutionbox[ 1. #math.equation(block: false, alt: "x sub 1")[$x_(1)$] = weight of a woman after the weight loss program #math.equation(block: false, alt: "x sub 2")[$x_(2)$] = weight of a woman before the weight loss program #math.equation(block: false, alt: "μ sub 1")[$μ_(1)$] = mean weight of a woman after the weight loss program #math.equation(block: false, alt: "μ sub 2")[$μ_(2)$] = mean weight of a woman before the weight loss program 2. #math.equation(block: false, alt: "H sub o : μ sub d equals 0; H sub A : μ sub d less than 0; α equals 0.05")[$H_(o) : μ_(d) = 0 \ H_(A) : μ_(d) < 0 \ α = 0.05$] 3. + A random sample of 6 pairs of weights before and after was taken. This was stated in the problem, since the women were chosen randomly. + The population of the difference in after and before weights is normally distributed. To see if this is true, look at the histogram, number of outliers, and the normal probability plot. (If you wish, you can look at the normal probability plot first. If it doesn’t look linear, then you may want to look at the histogram and number of outliers at this point.) #figure(figph[Histogram of the six before-minus-after weight differences, with values from 16 to 25 pounds and the highest frequency in the 20 to 22 pound bin.], alt: "Histogram of the six before-minus-after weight differences, with values from 16 to 25 pounds and the highest frequency in the 20 to 22 pound bin.", caption: [Figure #math.equation(block: false, alt: "1")[$1$]: Histogram of Differences in Weights]) This histogram looks somewhat bell shaped. #figure(figph[A horizontal boxplot of six weight differences, with most differences from 21 to 25 and one low outlier at 16.], alt: "A horizontal boxplot of six weight differences, with most differences from 21 to 25 and one low outlier at 16.", caption: [Figure #math.equation(block: false, alt: "2")[$2$]: Modified Box Plot of Differences in Weights]) There is only one outlier in the difference data set. #figure(figph[A normal Q-Q plot of six weight-loss differences shows values from 16 to 25, with 16 appearing as a low outlier.], alt: "A normal Q-Q plot of six weight-loss differences shows values from 16 to 25, with 16 appearing as a low outlier.", caption: [Figure #math.equation(block: false, alt: "3")[$3$]: Normal Quantile Plot of Differences in Weights]) The probability plot on the differences looks somewhat linear. So you can assume that the distribution of the difference in weights is normal. 4. Sample Statistics: #figure(table( columns: 7, align: left, inset: 6pt, table.header([Person], [1], [2], [3], [4], [5], [6]), [Weight after, #math.equation(block: false, alt: "x sub 1")[$x_(1)$]], [143], [151], [156], [161], [152], [154], [Weight before, #math.equation(block: false, alt: "x sub 2")[$x_(2)$]], [165], [172], [181], [185], [168], [175], [#emph[d] = #math.equation(block: false, alt: "x sub 1 minus x sub 2")[$x_(1) − x_(2)$]], [-22], [-21], [-25], [-24], [-16], [-21], )) The mean and standard deviation are #math.equation(block: true, alt: "d ― equals minus 21.5; s sub d equals 3.15")[$limits(d)^(―) = − 21.5 \ s_(d) = 3.15$] Test Statistic: #math.equation(block: true, alt: "t equals the fraction d ― minus μ sub d over s sub d / the square root of n equals the fraction minus 21.5 minus 0 over 3.15 / the square root of 6 equals minus 16.779")[$t = frac(limits(d)^(―) − μ_(d), s_(d) / sqrt(n)) = frac(− 21.5 − 0, 3.15 / sqrt(6)) = − 16.779$] p-value: There are six pairs so the degrees of freedom are #emph[df] = #emph[n] - 1 = 6 - 1 = 5 Since #math.equation(block: false, alt: "H sub 1 : μ sub d less than 0")[$H_(1) : μ_(d) < 0$], then p-value Using TI-83/84: #emph[tcdf] #math.equation(block: false, alt: "open parenthesis minus 1 E 99 , minus 16.779 , 5 close parenthesis approximately equals 6.87 times 10 to the power minus 6")[$( − 1 E 99 , − 16.779 , 5 ) ≈ 6.87 × 10^(− 6)$] Using R: #emph[pt] #math.equation(block: false, alt: "open parenthesis minus 16.779 , 5 close parenthesis approximately equals 6.87 times 10 to the power minus 6")[$( − 16.779 , 5 ) ≈ 6.87 × 10^(− 6)$] 5. Since the p-value \< 0.05, reject #math.equation(block: false, alt: "H sub o")[$H_(o)$]. 6. There is enough evidence to show that the weight loss program is effective. ] ] #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Note] Just because the hypothesis test says the program is effective doesn’t mean you should go out and use it right away. The program has statistical significance, but that doesn’t mean it has practical significance. You need to see how much weight a person loses, and you need to look at how safe it is, how expensive, does it work in the long term, and other type questions. Remember to look at the practical significance in all situations. In this case, the average weight loss was 21.5 pounds, which is very practically significant. Do remember to look at the safety and expense of the drug also. ] #examplebox("Example 3")[hypothesis Test for Paired Samples Using Technology][ The New Zealand Air Force purchased a batch of flight helmets. They then found out that the helmets didn’t fit. In order to make sure that they order the correct size helmets, they measured the head size of recruits. To save money, they wanted to use cardboard calipers, but were not sure if they will be accurate enough. So they took 18 recruits and measured their heads with the cardboard calipers and also with metal calipers. The data in centimeters (cm) is in Example #math.equation(block: false, alt: "3")[$3$] ("NZ helmet size," 2013). Do the data provide enough evidence to show that there is a difference in measurements between the cardboard and metal calipers? Use a 5% level of significance. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[The paired test without typing 36 numbers] Cardboard measurements load into L1 and metal into L2 for the Paired T-Test; the second link pre-loads the 18 differences L1 − L2 the calculator builds in L3. - Paired T-Test: t = 3.185, p-value = 0.0054 - 1-Var Stats of the differences: x̄ = 1.611, Sx = 2.146 → TInterval (0.544, 2.678) ] #figure(table( columns: 2, align: left, inset: 6pt, table.header([Cardboard], [Metal]), [146], [145], [151], [153], [163], [161], [152], [151], [151], [145], [151], [150], [149], [150], [166], [163], [149], [147], [155], [154], [155], [150], [156], [156], [162], [161], [150], [152], [156], [154], [158], [154], [149], [147], [163], [160], )) + State the random variables and the parameters in words. + State the null and alternative hypotheses and the level of significance. + State and check the assumptions for the hypothesis test. + Find the sample statistic, test statistic, and p-value. + Conclusion + Interpretation #solutionbox[ 1. #math.equation(block: false, alt: "x sub 1")[$x_(1)$] = head measurement of recruit using cardboard caliper #math.equation(block: false, alt: "x sub 2")[$x_(2)$] = head measurement of recruit using metal caliper #math.equation(block: false, alt: "μ sub 1")[$μ_(1)$] = mean head measurement of recruit using cardboard caliper #math.equation(block: false, alt: "μ sub 2")[$μ_(2)$] = mean head measurement of recruit using metal caliper 2. #math.equation(block: false, alt: "H sub o : μ sub d equals 0; H sub A : μ sub d not equal to 0; α equals 0.05")[$H_(o) : μ_(d) = 0 \ H_(A) : μ_(d) ≠ 0 \ α = 0.05$] 3. + A random sample of 18 pairs of head measures of recruits with cardboard and metal caliper was taken. This was not stated, but probably could be safely assumed. + The population of the difference in head measurements between cardboard and metal calipers is normally distributed. To see if this is true, look at the histogram, number of outliers, and the normal probability plot. (If you wish, you can look at the normal probability plot first. If it doesn’t look linear, then you may want to look at the histogram and number of outliers at this point.) #figure(figph[Histogram of diff values with bin frequencies 4 from −2 to 0, 9 from 0 to 2, 3 from 2 to 4, and 2 from 4 to 6.], alt: "Histogram of diff values with bin frequencies 4 from −2 to 0, 9 from 0 to 2, 3 from 2 to 4, and 2 from 4 to 6.", caption: [Figure #math.equation(block: false, alt: "4")[$4$]: Histogram of Differences in Head Measurements]) This histogram looks bell shaped. #figure(figph[A horizontal boxplot of 18 cardboard-minus-metal head-measurement differences, ranging from -2 to 6 with most differences between 1 and 3.], alt: "A horizontal boxplot of 18 cardboard-minus-metal head-measurement differences, ranging from -2 to 6 with most differences between 1 and 3.", caption: [Figure #math.equation(block: false, alt: "5")[$5$]: Modified Box Plot of Differences in Head Measurements]) There are no outliers in the difference data set. #figure(figph[A normal Q-Q plot of the 18 paired Cardboard minus Metal differences, ranging from -2 to 6.], alt: "A normal Q-Q plot of the 18 paired Cardboard minus Metal differences, ranging from -2 to 6.", caption: [Figure #math.equation(block: false, alt: "6")[$6$]: Normal Quantile Plot of Differences in Head Measurements]) The probability plot on the differences looks somewhat linear. So you can assume that the distribution of the difference in weights is normal. 4. Using the TI-83/84, put #math.equation(block: false, alt: "x sub 1")[$x_(1)$] into L1 and #math.equation(block: false, alt: "x sub 2")[$x_(2)$] into L2. Then go onto the name L3, and type #emph[L]1-#emph[L]2. The calculator will calculate the differences for you and put them in L3. Now go into STAT and move over to TESTS. Choose T-Test. The setup for the calculator is in #emph[Figure #math.equation(block: false, alt: "7")[$7$]]. #figure(figph[TI-83/84 calculator T-Test setup screen showing input options for a paired-sample test, with List L3, frequency 1, and the alternative mean difference not equal to 0.], alt: "TI-83/84 calculator T-Test setup screen showing input options for a paired-sample test, with List L3, frequency 1, and the alternative mean difference not equal to 0.", caption: [Figure #math.equation(block: false, alt: "7")[$7$]: Setup for T-Test on TI-83/84 Calculator]) Once you press ENTER on Calculate you will see the result shown in #emph[Figure #math.equation(block: false, alt: "8")[$8$]]. #figure(figph[TI-84 calculator T-Test results screen showing μ≠0, t=3.185421904, p=.0054147206, x̄=1.611111111, Sx=2.145827384, and n=18.], alt: "TI-84 calculator T-Test results screen showing μ≠0, t=3.185421904, p=.0054147206, x̄=1.611111111, Sx=2.145827384, and n=18.", caption: [Figure #math.equation(block: false, alt: "8")[$8$]: Results of T-Test on TI-83/84 Calculator]) Using R: command is t.test(variable1, variable2, paired = TRUE, alternative = "less" or "greater"). For this example, the command would be t.test(cardboard, metal, paired = TRUE) cardboard \<- c(146, 151, 163, 152, 151, 151, 149, 166, 149, 155, 155, 156, 162, 150, 156, 158, 149, 163) metal \<- c(145, 153, 161, 151, 145, 150, 150, 163, 147, 154, 150, 156, 161, 152, 154, 154, 147, 160) t.test(cardboard, metal, paired = TRUE) Paired t-test data: cardboard and metal t = 3.1854, df = 17, p-value = 0.005415 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: 0.5440163 2.6782060 sample estimates: mean of the differences 1.611111 The #emph[t] = 3.185 is the test statistic. The p-value is 0.0054147206. 5. Since the p-value \< 0.05, reject #math.equation(block: false, alt: "H sub o")[$H_(o)$]. 6. There is enough evidence to show that the mean head measurements using the cardboard calipers are not the same as when using the metal calipers. So it looks like the New Zealand Air Force shouldn’t use the cardboard calipers. ] ] #examplebox("Example 4")[confidence interval for paired samples using the formula][ A researcher wants to estimate the mean weight loss that people experience using a new program. She measures the weight of 6 randomly selected women before and after the weight loss program (see Example #math.equation(block: false, alt: "1")[$1$]). Find a 90% confidence interval for the mean the weight loss using the new program. + State the random variables and the parameters in words. + State and check the assumptions for the confidence interval. + Find the sample statistic and confidence interval. + Statistical Interpretation + Real World Interpretation #solutionbox[ 1. These were stated in Example #math.equation(block: false, alt: "2")[$2$], but are reproduced here for reference. #math.equation(block: false, alt: "x sub 1")[$x_(1)$] = weight of a woman after the weight loss program #math.equation(block: false, alt: "x sub 2")[$x_(2)$] = weight of a woman before the weight loss program #math.equation(block: false, alt: "μ sub 1")[$μ_(1)$] = mean weight of a woman after the weight loss program #math.equation(block: false, alt: "μ sub 2")[$μ_(2)$] = mean weight of a woman before the weight loss program 2. The assumptions were stated and checked in Example #math.equation(block: false, alt: "2")[$2$]. 3. Sample Statistics: From Example #math.equation(block: false, alt: "2")[$2$] #math.equation(block: true, alt: "d ― equals minus 21.5; s sub d equals 3.15")[$limits(d)^(―) = − 21.5 \ s_(d) = 3.15$] The confidence level is 90%, so C= 90% There are six pairs, so the degrees of freedom are #emph[df] = #emph[n] - 1 = 6 - 1 = 5 Now look in table A.2. Go down the first column to 5, then over to the column headed with 90%. #math.equation(block: true, alt: "t sub c equals 2.015")[$t_(c) = 2.015$] #math.equation(block: true, alt: "E equals t sub c the fraction s sub d over the square root of n equals 2.015 the fraction 3.15 over the square root of 6 approximately equals 2.6")[$E = t_(c) frac(s_(d), sqrt(n)) = 2.015 frac(3.15, sqrt(6)) ≈ 2.6$] #math.equation(block: true, alt: "d ― minus E less than μ sub d less than d ― plus E")[$limits(d)^(―) − E < μ_(d) < limits(d)^(―) + E$] #math.equation(block: true, alt: "minus 21.5 minus 2.6 less than μ sub d less than minus 21.5 plus 2.6")[$− 21.5 − 2.6 < μ_(d) < − 21.5 + 2.6$] #math.equation(block: true, alt: "minus 24.1 pounds less than μ sub d less than minus 18.9 pounds")[$− 24.1 " pounds " < μ_(d) < − 18.9 " pounds "$] 4. There is a 90% chance that #math.equation(block: false, alt: "minus 24.1 pounds less than μ sub d less than minus 18.9 pounds")[$− 24.1 " pounds " < μ_(d) < − 18.9 " pounds "$] contains the true mean difference in weight loss. 5. The mean weight loss is between 18.9 and 24.1 pounds. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Note] The negative signs tell you that the first mean is less than the second mean, and thus a weight loss in this case. ] ] ] #examplebox("Example 5")[confidence interval for paired samples using technology][ The New Zealand Air Force purchased a batch of flight helmets. They then found out that the helmets didn’t fit. In order to make sure that they order the correct size helmets, they measured the head size of recruits. To save money, they wanted to use cardboard calipers, but were not sure if they will be accurate enough. So they took 18 recruits and measured their heads with the cardboard calipers and also with metal calipers. The data in centimeters (cm) is in Example #math.equation(block: false, alt: "3")[$3$] ("NZ helmet size," 2013). Estimate the mean difference in measurements between the cardboard and metal calipers using a 95% confidence interval. + State the random variables and the parameters in words. + State and check the assumptions for the hypothesis test. + Find the sample statistic and confidence interval. + Statistical Interpretation + Real World Interpretation #solutionbox[ 1. These were stated in Example #math.equation(block: false, alt: "3")[$3$], but are reproduced here for reference. #math.equation(block: false, alt: "x sub 1")[$x_(1)$] = head measurement of recruit using cardboard caliper #math.equation(block: false, alt: "x sub 2")[$x_(2)$] = head measurement of recruit using metal caliper #math.equation(block: false, alt: "μ sub 1")[$μ_(1)$] = mean head measurement of recruit using cardboard caliper #math.equation(block: false, alt: "μ sub 2")[$μ_(2)$] = mean head measurement of recruit using metal caliper 2. The assumptions were stated and checked in Example #math.equation(block: false, alt: "3")[$3$]. 3. Using the TI-83/84, put #math.equation(block: false, alt: "x sub 1")[$x_(1)$] into L1 and #math.equation(block: false, alt: "x sub 2")[$x_(2)$] into L2. Then go onto the name L3, and type #emph[L]1 - #emph[L]2. The calculator will now calculate the differences for you and put them in L3. Now go into STAT and move over to TESTS. Then chose TInterval. The setup for the calculator is in #emph[Figure #math.equation(block: false, alt: "9")[$9$]]. #figure(figph[TI-84 calculator TInterval setup screen showing Data input, List L3, frequency 1, confidence level .95, and Calculate.], alt: "TI-84 calculator TInterval setup screen showing Data input, List L3, frequency 1, confidence level .95, and Calculate.", caption: [Figure #math.equation(block: false, alt: "9")[$9$]: Setup for TInterval on TI-83/84 Calculator]) Once you press ENTER on Calculate you will see the result shown in #emph[Figure #math.equation(block: false, alt: "10")[$10$]]. #figure(figph[TI-84 calculator screen showing a t-interval of (0.54402, 2.6782), sample mean difference x̄=1.611111111, Sx=2.145827384, and n=18.], alt: "TI-84 calculator screen showing a t-interval of (0.54402, 2.6782), sample mean difference x̄=1.611111111, Sx=2.145827384, and n=18.", caption: [Figure #math.equation(block: false, alt: "10")[$10$]: Results of TInterval on TI-83/84 Calculator]) Using R: the command is t.test(variable1, variable2, paired = TRUE, conf.level = C), where C is in decimal form. For this example the command would be t.test(cardboard, metal, paired = TRUE, conf.level=0.95) Paired t-test data: cardboard and metal t = 3.1854, df = 17, p-value = 0.005415 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: 0.5440163 2.6782060 sample estimates: mean of the differences 1.611111 So #math.equation(block: true, alt: "0.54 c m less than μ sub d less than 2.68 c m")[$0.54 upright(c) upright(m) < μ_(d) < 2.68 upright(c) upright(m)$] 4. There is a 95% chance that #math.equation(block: false, alt: "0.54 c m less than μ sub d less than 2.68 c m")[$0.54 upright(c) upright(m) < μ_(d) < 2.68 upright(c) upright(m)$] contains the true mean difference in head measurements between cardboard and metal calibers. 5. The mean difference in head measurements between the cardboard and metal calibers is between 0.54 and 2.68 cm. This means that the cardboard calibers measure on average the head of a recruit to be between 0.54 and 2.68 cm more in diameter than the metal calibers. That makes it seem that the cardboard calibers are not measuring the same as the metal calibers. (The positive values on the confidence interval imply that the first mean is higher than the second mean.) ] ] Examples 9.2.2 and #emph[9.2.4] use the same data set, but one is conducting a hypothesis test and the other is conducting a confidence interval. Notice that the hypothesis test’s conclusion was to reject #math.equation(block: false, alt: "H sub o")[$H_(o)$] and say that there was a difference in the means, and the confidence interval does not contain the number 0. If the confidence interval did contain the number 0, then that would mean that the two means could be the same. Since the interval did not contain 0, then you could say that the means are different just as in the hypothesis test. This means that the hypothesis test and the confidence interval can produce the same interpretation. Do be careful though, you can run a hypothesis test with a particular significance level and a confidence interval with a confidence level that is not compatible with your significance level. This will mean that the conclusion from the confidence interval would not be the same as with a hypothesis test. So if you want to estimate the mean difference, then conduct a confidence interval. If you want to show that the means are different, then conduct a hypothesis test. === Homework #notebox("Your Turn", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ In each problem show all steps of the hypothesis test or confidence interval. If some of the assumptions are not met, note that the results of the test or interval may not be correct and then continue the process of the hypothesis test or confidence interval. + The cholesterol level of patients who had heart attacks was measured two days after the heart attack and then again four days after the heart attack. The researchers want to see if the cholesterol level of patients who have heart attacks reduces as the time since their heart attack increases. The data is in Example #math.equation(block: false, alt: "4")[$4$] ("Cholesterol levels after," 2013). Do the data show that the mean cholesterol level of patients that have had a heart attack reduces as the time increases since their heart attack? Test at the 1% level. #figure(table( columns: 3, align: left, inset: 6pt, table.header([Patient], [Cholesterol Level Day 2], [Cholesterol Level Day 4]), [1], [270], [218], [2], [236], [234], [3], [210], [214], [4], [142], [116], [5], [280], [200], [6], [272], [276], [7], [160], [146], [8], [220], [182], [9], [225], [238], [10], [242], [288], [11], [186], [190], [12], [266], [236], [13], [206], [244], [14], [318], [258], [15], [294], [240], [16], [282], [294], [17], [234], [220], [18], [224], [200], [19], [276], [220], [20], [282], [186], [21], [360], [352], [22], [310], [202], [23], [280], [218], [24], [278], [248], [25], [288], [278], [26], [288], [248], [27], [244], [270], [28], [236], [242], )) + The cholesterol level of patients who had heart attacks was measured two days after the heart attack and then again four days after the heart attack. The researchers want to see if the cholesterol level of patients who have heart attacks reduces as the time since their heart attack increases. The data is in Example #math.equation(block: false, alt: "4")[$4$] ("Cholesterol levels after," 2013). Calculate a 98% confidence interval for the mean difference in cholesterol levels from day two to day four. + All Fresh Seafood is a wholesale fish company based on the east coast of the U.S. Catalina Offshore Products is a wholesale fish company based on the west coast of the U.S. Example #math.equation(block: false, alt: "5")[$5$] contains prices from both companies for specific fish types ("Seafood online," 2013) ("Buy sushi grade," 2013). Do the data provide enough evidence to show that a west coast fish wholesaler is more expensive than an east coast wholesaler? Test at the 5% level. #figure(table( columns: 3, align: left, inset: 6pt, table.header([Fish], [All Fresh Seafood Prices], [Catalina Offshore Product Prices]), [Cod], [19.99], [17.99], [Tilapi], [6.00], [13.99], [Farmed Salmon], [19.99], [22.99], [Organic Salmon], [24.99], [24.99], [Grouper Fillet], [29.99], [19.99], [Tuna], [28.99], [31.99], [Swordfish], [23.99], [23.99], [Sea Bass], [32.99], [23.99], [Striped Bass], [29.99], [14.99], )) + All Fresh Seafood is a wholesale fish company based on the east coast of the U.S. Catalina Offshore Products is a wholesale fish company based on the west coast of the U.S. Example #math.equation(block: false, alt: "5")[$5$] contains prices from both companies for specific fish types ("Seafood online," 2013) ("Buy sushi grade," 2013). Find a 95% confidence interval for the mean difference in wholesale price between the east coast and west coast suppliers. + The British Department of Transportation studied to see if people avoid driving on Friday the 13th. They did a traffic count on a Friday and then again on a Friday the 13th at the same two locations ("Friday the 13th," 2013). The data for each location on the two different dates is in Example #math.equation(block: false, alt: "6")[$6$]. Do the data show that on average fewer people drive on Friday the 13th? Test at the 5% level. #figure(table( columns: 3, align: left, inset: 6pt, table.header([Dates], [6th], [13th]), [1990, July], [139246], [138548], [1990, July], [134012], [132909], [1991, September], [137055], [136018], [1991, September], [133732], [131843], [1991, December], [123552], [121641], [1991, December], [121139], [118723], [1992, March], [128293], [125532], [1992, March], [124631], [120249], [1992, November], [124609], [122770], [1992, November], [117584], [117263], )) + The British Department of Transportation studied to see if people avoid driving on Friday the 13th. They did a traffic count on a Friday and then again on a Friday the 13th at the same two locations ("Friday the 13th," 2013). The data for each location on the two different dates is in Example #math.equation(block: false, alt: "6")[$6$]. Estimate the mean difference in traffic count between the 6th and the 13th using a 90% level. + To determine if Reiki is an effective method for treating pain, a pilot study was carried out where a certified second-degree Reiki therapist provided treatment on volunteers. Pain was measured using a visual analogue scale (VAS) immediately before and after the Reiki treatment (Olson & Hanson, 1997). The data is in Example #math.equation(block: false, alt: "7")[$7$]. Do the data show that Reiki treatment reduces pain? Test at the 5% level. #figure(table( columns: 2, align: left, inset: 6pt, table.header([VAS before], [VAS after]), [6], [3], [2], [1], [2], [0], [9], [1], [3], [0], [3], [2], [4], [1], [5], [2], [2], [2], [3], [0], [5], [1], [2], [2], [3], [0], [5], [1], [1], [0], [6], [4], [6], [1], [4], [4], [4], [1], [7], [6], [2], [1], [4], [3], [8], [8], )) + To determine if Reiki is an effective method for treating pain, a pilot study was carried out where a certified second-degree Reiki therapist provided treatment on volunteers. Pain was measured using a visual analogue scale (VAS) immediately before and after the Reiki treatment (Olson & Hanson, 1997). The data is in Example #math.equation(block: false, alt: "7")[$7$]. Compute a 90% confidence level for the mean difference in VAS score from before and after Reiki treatment. + The female labor force participation rates (FLFPR) of women in randomly selected countries in 1990 and latest years of the 1990s are in Example #math.equation(block: false, alt: "8")[$8$] (Lim, 2002). Do the data show that the mean female labor force participation rate in 1990 is different from that in the latest years of the 1990s using a 5% level of significance? #figure(table( columns: 3, align: left, inset: 6pt, table.header([Region and country], [FLFPR 25-54 1990], [FLFPR 25-54 Latest years of 1990s]), [Iran], [22.6], [12.5], [Morocco], [41.4], [34.5], [Qatar], [42.3], [46.5], [Syrian Arab Republic], [25.6], [19.5], [United Arab Emirates], [36.4], [39.7], [Cape Verde], [46.7], [50.9], [Ghana], [89.8], [90.0], [Kenya], [82.1], [82.6], [Lesotho], [51.9], [68.0], [South Africa], [54.7], [61.7], [Bangladesh], [73.5], [60.6], [Malaysia], [49.0], [50.2], [Mongolia], [84.7], [71.3], [Myanmar], [72.1], [72.3], [Argentina], [36.8], [54], [Belize], [28.8], [42.5], [Bolivia], [27.3], [69.8], [Brazil], [51.1], [63.2], [Colombia], [57.4], [72.7], [Ecuador], [33.5], [64], [Nicaragua], [50.1], [42.5], [Uruguay], [59.5], [71.5], [Albania], [77.4], [78.8], [Uzbekistan], [79.6], [82.8], )) + The female labor force participation rates of women in randomly selected countries in 1990 and latest years of the 1990s are in Example #math.equation(block: false, alt: "8")[$8$] (Lim, 2002). Estimate the mean difference in the female labor force participation rate in 1990 to latest years of the 1990s using a 95% confidence level? + Example #math.equation(block: false, alt: "9")[$9$] contains pulse rates collected from males, who are non-smokers but do drink alcohol ("Pulse rates before," 2013). The before pulse rate is before they exercised, and the after pulse rate was taken after the subject ran in place for one minute. Do the data indicate that the pulse rate before exercise is less than after exercise? Test at the 1% level. #figure(table( columns: 2, align: left, inset: 6pt, table.header([Pulse before], [Pulse after]), [76], [88], [56], [110], [64], [126], [50], [90], [49], [83], [68], [136], [68], [125], [88], [150], [80], [146], [78], [168], [59], [92], [60], [104], [65], [82], [76], [150], [145], [155], [84], [140], [78], [141], [85], [131], [78], [132], )) + Example #math.equation(block: false, alt: "9")[$9$] contains pulse rates collected from males, who are non-smokers but do drink alcohol ("Pulse rates before," 2013). The before pulse rate is before they exercised, and the after pulse rate was taken after the subject ran in place for one minute. Compute a 98% confidence interval for the mean difference in pulse rates from before and after exercise. Answer For all hypothesis tests, just the conclusion is given. For all confidence intervals, just the interval using technology is given. See solution for the entire answer. 1. Reject Ho 2. #math.equation(block: false, alt: "5.39857 m g / d L less than μ sub d less than 41.1729 m g / d L")[$5.39857 upright(m) upright(g) / upright(d) upright(L) < μ_(d) < 41.1729 upright(m) upright(g) / upright(d) upright(L)$] 3. Fail to reject Ho 4. #math.equation(block: false, alt: "minus $ 3.24216 less than μ sub d less than $ 8.13327")[$− \$ 3.24216 < μ_(d) < \$ 8.13327$] 5. Reject Ho 6. #math.equation(block: false, alt: "1154.09 less than μ sub d less than 2517.51")[$1154.09 < μ_(d) < 2517.51$] 7. Reject Ho 8. #math.equation(block: false, alt: "1.499 less than μ sub d less than 3.001")[$1.499 < μ_(d) < 3.001$] 9. Fail to reject Ho 10. #math.equation(block: false, alt: "minus 10.9096")[$− 10.9096$] 11. Reject Ho 12. #math.equation(block: false, alt: "minus 62.0438 beats/min less than μ sub d less than minus 37.1141 beats/min")[$− 62.0438 " beats/min " < μ_(d) < − 37.1141 " beats/min "$] ]