#set document(title: "10.3 Inference for Regression and Correlation", 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")) == 10.3#h(0.6em)Inference for Regression and Correlation How do you really say you have a correlation? Can you test to see if there really is a correlation? Of course, the answer is yes. The hypothesis test for correlation is as follows: === Hypothesis Test for Correlation: + State the random variables in words. #linebreak() #emph[x] = independent variable #linebreak() #emph[y] = dependent variable + State the null and alternative hypotheses and the level of significance #linebreak() #math.equation(block: false, alt: "H sub o : ρ equals 0 (There is no correlation); H sub A : ρ not equal to 0 (There is a correlation); or; H sub A : ρ less than 0 (There is a negative correlation); or; H sub A : ρ greater than 0 (There is a postive correlation)")[$H_(o) : ρ = 0 " (There is no correlation) " \ H_(A) : ρ ≠ 0 " (There is a correlation) " \ " or " \ H_(A) : ρ < 0 " (There is a negative correlation) " \ " or " \ H_(A) : ρ > 0 " (There is a postive correlation) "$] #linebreak() Also, state your #math.equation(block: false, alt: "α")[$α$] level here. + State and check the assumptions for the hypothesis test #linebreak() The assumptions for the hypothesis test are the same assumptions for regression and correlation. + Find the test statistic and p-value #linebreak() #math.equation(block: false, alt: "t equals the fraction r over the square root of the fraction 1 minus r squared over n minus 2")[$t = frac(r, sqrt(frac(1 − r^(2), n − 2)))$] #linebreak() with degrees of freedom = #emph[df] = #emph[n] - 2 #linebreak() p-value: Using the TI-83/84: tcdf(lower limit, upper limit, #emph[df]) Using R: pt(#emph[t, df]) #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Note] If #math.equation(block: false, alt: "H sub A : ρ less than 0")[$H_(A) : ρ < 0$], then lower limit is -1E99 and upper limit is your test statistic. If #math.equation(block: false, alt: "H sub A : ρ greater than 0")[$H_(A) : ρ > 0$], then lower limit is your test statistic and the upper limit is 1E99. If #math.equation(block: false, alt: "H sub A : ρ not equal to 0")[$H_(A) : ρ ≠ 0$], then find the p-value for #math.equation(block: false, alt: "H sub A : ρ less than 0")[$H_(A) : ρ < 0$], and multiply by 2. ] #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Note] If #math.equation(block: false, alt: "H sub A : ρ less than 0")[$H_(A) : ρ < 0$], then use pt(#emph[t, df]), If #math.equation(block: false, alt: "H sub A : ρ greater than 0")[$H_(A) : ρ > 0$], then use #math.equation(block: false, alt: "1 minus p t open parenthesis t , d f close parenthesis")[$1 − upright(p) upright(t) ( t , d f )$]. If #math.equation(block: false, alt: "H sub A : ρ not equal to 0")[$H_(A) : ρ ≠ 0$], then find the p-value for #math.equation(block: false, alt: "H sub A : ρ less than 0")[$H_(A) : ρ < 0$], and multiply by 2. ] + Conclusion #linebreak() 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)$]. + Interpretation #linebreak() 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. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Note] The TI-83/84 calculator results give you the test statistic and the p-value. In R, the command for getting the test statistic and p-value is cor.test(independent variable, dependent variable, alternative = "less" or "greater"). Use less for #math.equation(block: false, alt: "H sub A : ρ less than 0")[$H_(A) : ρ < 0$], use greater for #math.equation(block: false, alt: "H sub A : ρ greater than 0")[$H_(A) : ρ > 0$], and leave off this command for #math.equation(block: false, alt: "H sub A : ρ not equal to 0")[$H_(A) : ρ ≠ 0$]. ] #examplebox("Example 1")[Testing the claim of a linear correlation][ Is there a positive correlation between beer’s alcohol content and calories? To determine if there is a positive linear correlation, a random sample was taken of beer’s alcohol content and calories for several different beers ("Calories in beer," 2011), and the data is in Example #math.equation(block: false, alt: "1")[$1$]. Test at the 5% level. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[The regression test screens, live] The nine beers are pre-loaded for the test; the second link gives the 1-Var Stats of the alcohol contents used by the prediction interval (x̄ = 5.517, Sx = 1.247). - LinRegTTest: t = 5.938, p-value = 0.000288, s = 15.638 - 1-Var Stats of x: x̄ = 5.517, Sx = 1.247, n = 9 ] #solutionbox[ + State the random variables in words. #linebreak() #emph[x] = alcohol content in the beer #linebreak() #emph[y] = calories in 12 ounce beer + State the null and alternative hypotheses and the level of significance. #linebreak() Since you are asked if there is a positive correlation, #math.equation(block: false, alt: "ρ greater than 0")[$ρ > 0$]. #linebreak() #math.equation(block: false, alt: "H sub o : ρ equals 0; H sub A : ρ greater than 0; α equals 0.05")[$H_(o) : ρ = 0 \ H_(A) : ρ > 0 \ α = 0.05$] + State and check the assumptions for the hypothesis test. #linebreak() The assumptions for the hypothesis test were already checked in#emph[Example #math.equation(block: false, alt: "2")[$2$]]. + Find the test statistic and p-value. #linebreak() The results from the TI-83/84 calculator are in #emph[Figure #math.equation(block: false, alt: "1")[$1$]]. #linebreak() #linebreak() #strong[#emph[Figure #math.equation(block: false, alt: "1")[$1$]]]#emph[: Results for Linear Regression Test on TI-83/84] #linebreak() Test statistic: #emph[t] #math.equation(block: false, alt: "approximately equals")[$≈$] 5.938 and p-value: #math.equation(block: false, alt: "p approximately equals 2.884 times 10 to the power minus 4")[$p ≈ 2.884 × 10^(− 4)$] #linebreak() The results from R are #linebreak() cor.test(alcohol, calories, alternative = "greater") #linebreak() Pearson's product-moment correlation #linebreak() data: alcohol and calories #linebreak() t = 5.9384, df = 7, p-value = 0.0002884 #linebreak() alternative hypothesis: true correlation is greater than 0 #linebreak() 95 percent confidence interval: #linebreak() 0.7046161 1.0000000 #linebreak() sample estimates: #linebreak() cor #linebreak() 0.9134414 #linebreak() Test statistic: #emph[t] #math.equation(block: false, alt: "approximately equals")[$≈$] 5.9384 and p-value: #math.equation(block: false, alt: "p approximately equals 0.0002884")[$p ≈ 0.0002884$] + Conclusion #linebreak() Reject #math.equation(block: false, alt: "H sub o")[$H_(o)$] since the p-value is less than 0.05. + Interpretation #linebreak() There is enough evidence to show that there is a positive correlation between alcohol content and number of calories in a 12-ounce bottle of beer. ] ] === Prediction Interval Using the regression equation you can predict the number of calories from the alcohol content. However, you only find one value. The problem is that beers vary a bit in calories even if they have the same alcohol content. It would be nice to have a range instead of a single value. The range is called a prediction interval. To find this, you need to figure out how much error is in the estimate from the regression equation. This is known as the #strong[standard error of the estimate]. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #strong[Standard Error of the Estimate] #linebreak() This is the sum of squares of the residuals #math.equation(block: true, alt: "s sub e equals the square root of the fraction ∑ open parenthesis y minus y ^ close parenthesis squared over n minus 2")[$s_(e) = sqrt(frac(∑ ( y − hat(y) )^(2), n − 2))$] ] This formula is hard to work with, so there is an easier formula. You can also find the value from technology, such as the calculator. #math.equation(block: true, alt: "s sub e equals the square root of the fraction S S sub y minus b to the power * S S sub x y over n minus 2")[$s_(e) = sqrt(frac(S S_(y) − b^(*) S S_(x y), n − 2))$] #examplebox("Example 2")[finding the standard error of the estimate][ Find the standard error of the estimate for the beer data. To determine if there is a positive linear correlation, a random sample was taken of beer’s alcohol content and calories for several different beers ("Calories in beer," 2011), and the data are in Example #math.equation(block: false, alt: "1")[$1$]. #solutionbox[ #emph[x] = alcohol content in the beer #emph[y] = calories in 12 ounce beer Using the TI-83/84, the results are in #emph[Figure #math.equation(block: false, alt: "2")[$2$]]. #figure(figph[TI-83/84 calculator screen showing LinRegTTest results for y=a+bx, with b=26.31860776, standard error 15.63798068, r²=0.8343751268, and r=0.9134413647.], alt: "TI-83/84 calculator screen showing LinRegTTest results for y=a+bx, with b=26.31860776, standard error 15.63798068, r²=0.8343751268, and r=0.9134413647.", caption: [Figure #math.equation(block: false, alt: "2")[$2$]: Results for Linear Regression Test on TI-83/84]) The #emph[s] in the results is the standard error of the estimate. So #math.equation(block: false, alt: "s sub e approximately equals 15.64")[$s_(e) ≈ 15.64$]. To find the standard error of the estimate in R, the commands are #linebreak() lm.out = lm(dependent variable ~ independent variable) – this defines the linear model with a name so you can use it later. Then #linebreak() summary(lm.out) – this will produce most of the information you need for a regression and correlation analysis. In fact, the only thing R doesn’t produce with this command is the correlation coefficient. Otherwise, you can use the command to find the regression equation, coefficient of determination, test statistic, p-value for a two-tailed test, and standard error of the estimate. The results from R are #linebreak() lm.out=lm(calories~alcohol) #linebreak() summary(lm.out) Call: #linebreak() lm(formula = calories ~ alcohol) Residuals: #linebreak() #math.equation(block: false, alt: "Min 1Q Median 3Q Max; minus 30.253 minus 1.624 2.744 9.271 14.271")[$"Min" "1Q" "Median" "3Q" "Max" \ − 30.253 − 1.624 2.744 9.271 14.271$] Coefficients: #linebreak() #math.equation(block: false, alt: "Estimate Std. Error t value Pr(>|t|); (Intercept) 25.031 24.999 1.001 0.350038; alcohol 26.319 4.432 5.938 0.000577")[$"Estimate Std." "Error" "t value" "Pr(>|t|)" \ "(Intercept)" 25.031 24.999 1.001 0.350038 \ "alcohol" 26.319 4.432 5.938 0.000577$] #linebreak() --- #linebreak() Signif. codes: 0 ‘\*\*\*’ 0.001 ‘\*\*’ 0.01 ‘\*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 15.64 on 7 degrees of freedom #linebreak() Multiple R-squared: 0.8344, Adjusted R-squared: 0.8107 #linebreak() F-statistic: 35.26 on 1 and 7 DF, p-value: 0.0005768 From this output, you can find the y-intercept is 25.031, the slope is 26.319, the test statistic is t = 5.938, the p-value for the two-tailed test is 0.000577. If you want the p-value for a one-tailed test, divide this number by 2. The standard error of the estimate is the residual standard error and is 15.64. There is some information in this output that you do not need. ] ] If you want to know how to calculate the standard error of the estimate from the formula, refer to Example #math.equation(block: false, alt: "3")[$3$]. #examplebox("Example 3")[finding the standard error of the estimate from the formula][ Find the standard error of the estimate for the beer data using the formula. To determine if there is a positive linear correlation, a random sample was taken of beer’s alcohol content and calories for several different beers ("Calories in beer," 2011), and the data are in Example #math.equation(block: false, alt: "1")[$1$]. #solutionbox[ #emph[x] = alcohol content in the beer #emph[y] = calories in 12 ounce beer From Example #math.equation(block: false, alt: "3")[$3$] : #math.equation(block: true, alt: "S S sub y equals ∑ open parenthesis y minus y ― close parenthesis squared equals 10335.56; S S sub x y equals ∑ open parenthesis x minus x ― close parenthesis open parenthesis y minus y ― close parenthesis equals 327.6666; n equals 9; b equals 26.3")[$S S_(y) = ∑ ( y − limits(y)^(―) )^(2) = 10335.56 \ S S_(x y) = ∑ ( x − limits(x)^(―) ) ( y − limits(y)^(―) ) = 327.6666 \ n = 9 \ b = 26.3$] The standard error of the estimate is #math.equation(block: true, alt: "s sub e equals the square root of the fraction S S sub y minus b to the power * S S sub x y over n minus 2; equals the square root of the fraction 10335.56 minus 26.3 open parenthesis 327.6666 close parenthesis over 9 minus 2; equals 15.67")[$s_(e) = sqrt(frac(S S_(y) − b^(*) S S_(x y), n − 2)) \ = sqrt(frac(10335.56 − 26.3 ( 327.6666 ), 9 − 2)) \ = 15.67$] ] ] === Prediction Interval for an Individual #emph[y] Given the fixed value #math.equation(block: false, alt: "x sub 0")[$x_(0)$], the prediction interval for an individual#emph[y] is #math.equation(block: true, alt: "y ^ minus E less than y less than y ^ plus E")[$hat(y) − E < y < hat(y) + E$] where #math.equation(block: true, alt: "y ^ equals a plus b x; E equals t sub c s sub e the square root of 1 plus the fraction 1 over n plus the fraction open parenthesis x sub o minus x ― close parenthesis squared over S S sub x; d f equals n minus 2")[$hat(y) = a + b x \ E = t_(c) s_(e) sqrt(1 + frac(1, n) + frac(attach(( x_(o) − limits(x)^(―) ), t: 2), S S_(x))) \ d f = n − 2$] #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Note] To find #math.equation(block: false, alt: "S S sub x equals ∑ open parenthesis x minus x ― close parenthesis squared")[$S S_(x) = ∑ ( x − limits(x)^(―) )^(2)$] remember, the standard deviation formula from chapter 3 #math.equation(block: false, alt: "s sub x equals the square root of the fraction ∑ open parenthesis x minus x ― close parenthesis squared over n minus 1")[$s_(x) = sqrt(frac(∑ ( x − limits(x)^(―) )^(2), n − 1))$] So, #math.equation(block: false, alt: "s sub x equals the square root of the fraction S S sub x over n minus 1")[$s_(x) = sqrt(frac(S S_(x), n − 1))$] Now solve for #math.equation(block: false, alt: "S S sub x")[$S S_(x)$] #math.equation(block: true, alt: "S S sub x equals s x 2 open parenthesis n minus 1 close parenthesis")[$S S_(x) = s_(x)^(2) ( n − 1 )$] ] You can get the standard deviation from technology. #linebreak() R will produce the prediction interval for you. The commands are (Note you probably already did the lm.out command. You do not need to do it again.) #linebreak() lm.out = lm(dependent variable ~ independent variable) – calculates the linear model #linebreak() predict(lm.out, newdata=list(independent variable = value), interval="prediction", level=C) – will compute a prediction interval for the independent variable set to a particular value (put that value in place of the word value), at a particular C level (given as a decimal) #examplebox("Example 4")[find the prediction interval][ Find a 95% prediction interval for the number of calories when the alcohol content is 6.5% using a random sample taken of beer’s alcohol content and calories ("Calories in beer," 2011). The data are in Example #math.equation(block: false, alt: "1")[$1$]. #solutionbox[ #emph[x] = alcohol content in the beer #emph[y] = calories in 12 ounce beer Computing the prediction interval using the TI-83/84 calculator: #linebreak() From Example #math.equation(block: false, alt: "2")[$2$] #math.equation(block: true, alt: "y ^ equals 25.0 plus 26.3 x; x sub o equals 6.50; y ^ equals 25.0 plus 26.3 open parenthesis 6.50 close parenthesis equals 196 calories")[$hat(y) = 25.0 + 26.3 x \ x_(o) = 6.50 \ hat(y) = 25.0 + 26.3 ( 6.50 ) = 196 " calories "$] From Example \#10.3.2 #math.equation(block: true, alt: "s sub e approximately equals 15.64")[$s_(e) ≈ 15.64$] #figure(figph[TI-84 calculator 1-Var Stats screen showing x̄=5.516666667, Σx=49.65, Σx²=286.3525, Sx=1.247497495, σx=1.176151918, and n=9.], alt: "TI-84 calculator 1-Var Stats screen showing x̄=5.516666667, Σx=49.65, Σx²=286.3525, Sx=1.247497495, σx=1.176151918, and n=9.", caption: [Figure #math.equation(block: false, alt: "3")[$3$]: Results of 1-Var Stats on TI-83/84]) #math.equation(block: true, alt: "x ― equals 5.517; s sub x equals 1.247497495; n equals 9")[$limits(x)^(―) = 5.517 \ s_(x) = 1.247497495 \ n = 9$] Now you can find #math.equation(block: true, alt: "S S sub x equals s x 2 open parenthesis n minus 1 close parenthesis; equals open parenthesis 1.247497495 close parenthesis squared open parenthesis 9 minus 1 close parenthesis; equals 12.45; d f equals n minus 2 equals 9 minus 2 equals 7")[$S S_(x) = s_(x)^(2) ( n − 1 ) \ = ( 1.247497495 )^(2) ( 9 − 1 ) \ = 12.45 \ d f = n − 2 = 9 − 2 = 7$] Now look in table A.2. Go down the first column to 7, then over to the column headed with 95%. #math.equation(block: true, alt: "t sub c equals 2.365")[$t_(c) = 2.365$] #math.equation(block: true, alt: "E equals t sub c s sub e the square root of 1 plus the fraction 1 over n plus the fraction open parenthesis x sub o minus x ― close parenthesis squared over S S sub x; equals 2.365 open parenthesis 15.64 close parenthesis the square root of 1 plus the fraction 1 over 9 plus the fraction open parenthesis 6.50 minus 5.517 close parenthesis squared over 12.45; equals 40.3")[$E = t_(c) s_(e) sqrt(1 + frac(1, n) + frac(attach(( x_(o) − limits(x)^(―) ), t: 2), S S_(x))) \ = 2.365 ( 15.64 ) sqrt(1 + frac(1, 9) + frac(( 6.50 − 5.517 )^(2), 12.45)) \ = 40.3$] Prediction interval is #math.equation(block: true, alt: "y ^ minus E less than y less than y ^ plus E; 196 minus 40.3 less than y less than 196 plus 40.3; 155.7 less than y less than 236.3")[$hat(y) − E < y < hat(y) + E \ 196 − 40.3 < y < 196 + 40.3 \ 155.7 < y < 236.3$] Computing the prediction interval using R: #linebreak() predict(lm.out, newdata=list(alcohol=6.5), interval = "prediction", level=0.95) #linebreak() #math.equation(block: false, alt: "fit lwr upr; 1 196.1022 155.7847 236 .4196")[$" fit " " lwr " " upr " \ 1 196.1022 155.7847 236 ".4196"$] newdata=list(alcohol=6.5) fit = #math.equation(block: false, alt: "𝒴 ^")[$hat(𝒴)$] when x = 6.5%. lwr = lower limit of prediction interval. upr = upper limit of prediction interval. So the prediction interval is #math.equation(block: false, alt: "155.8 less than y less than 236.4")[$155.8 < y < 236.4$]. Statistical interpretation: There is a 95% chance that the interval #math.equation(block: false, alt: "155.8 less than y less than 236.4")[$155.8 < y < 236.4$] contains the true value for the calories when the alcohol content is 6.5%. Real world interpretation: If a beer has an alcohol content of 6.50% then it has between 156 and 236 calories. ] ] #examplebox("Example 5")[Doing a correlation and regression analysis using the ti-83/84][ Example #math.equation(block: false, alt: "1")[$1$] contains randomly selected high temperatures at various cities on a single day and the elevation of the city. #figure(table( columns: 8, align: left, inset: 6pt, table.header([Elevation (in feet)], [7000], [4000], [6000], [3000], [7000], [4500], [5000]), [Temperature (°F)], [50], [60], [48], [70], [55], [55], [60], )) + State the random variables. + Find a regression equation for elevation and high temperature on a given day. + Find the residuals and create a residual plot. + Use the regression equation to estimate the high temperature on that day at an elevation of 5500 ft. + Use the regression equation to estimate the high temperature on that day at an elevation of 8000 ft. + Between the answers to parts d and e, which estimate is probably more accurate and why? + Find the correlation coefficient and coefficient of determination and interpret both. + Is there enough evidence to show a negative correlation between elevation and high temperature? Test at the 5% level. + Find the standard error of the estimate. + Using a 95% prediction interval, find a range for high temperature for an elevation of 6500 feet. #solutionbox[ a. #emph[x] = elevation #emph[y] = high temperature b. + A random sample was taken as stated in the problem. + The distribution for each high temperature value is normally distributed for every value of elevation. + Look at the scatter plot of high temperature versus elevation. #linebreak() #linebreak() #strong[#emph[Figure #math.equation(block: false, alt: "4")[$4$]]]#emph[: Scatter Plot of Temperature Versus Elevation] #linebreak() The scatter plot looks fairly linear. + There are no points that appear to be outliers. + The residual plot for temperature versus elevation appears to be fairly random. (See #emph[Figure #math.equation(block: false, alt: "7")[$7$]].) #linebreak() It appears that the high temperature is normally distributed. All calculations computed using the TI-83/84 calculator. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[The full analysis on the elevation data] Elevations load into L1 and high temperatures into L2 — one panel reproduces the whole LinRegTTest screen for parts b through j. - LinRegTTest: b = −0.00393, r = −0.814, t = −3.139, p = 0.0129 ] #figure(figph[TI-83/84 calculator LinRegTTest setup screen showing Xlist L1, Ylist L2, frequency 1, and the alternative β\<0 and ρ\<0 selected.], alt: "TI-83/84 calculator LinRegTTest setup screen showing Xlist L1, Ylist L2, frequency 1, and the alternative β<0 and ρ<0 selected.", caption: [Figure #math.equation(block: false, alt: "5")[$5$]: Setup for Linear Regression on TI-83/84 Calculator]) #figure(figph[Two TI-83/84 calculator LinRegTTest result screens for the elevation and temperature data, showing β\<0 and ρ\<0, t=-3.138748764, p=.0128512886, df=5, a=77.36666667, b=-.0039333333, s=4.676893556, r²=.6633391967, and r=-.8144563811.], alt: "Two TI-83/84 calculator LinRegTTest result screens for the elevation and temperature data, showing β<0 and ρ<0, t=-3.138748764, p=.0128512886, df=5, a=77.36666667, b=-.0039333333, s=4.676893556, r²=.6633391967, and r=-.8144563811.", caption: [Figure #math.equation(block: false, alt: "6")[$6$]: Results for Linear Regression on TI-83/84 Calculator]) #math.equation(block: true, alt: "y ^ equals 77.4 minus 0.0039 x")[$hat(y) = 77.4 − 0.0039 x$] c. #figure(table( columns: 4, align: left, inset: 6pt, table.header([#emph[x]], [#emph[y]], [#math.equation(block: false, alt: "𝒴 ^")[$hat(𝒴)$]], [#math.equation(block: false, alt: "y minus y ^")[$y − hat(y)$]]), [7000], [50], [50.1], [-0.1], [4000], [60], [61.8], [-1.8], [6000], [48], [54.0], [-6.0], [3000], [70], [65.7], [4.3], [7000], [55], [50.1], [4.9], [4500], [55], [59.85], [-4.85], [5000], [60], [57.9], [2.1], )) #figure(figph[Scatterplot residual plot showing residuals for temperature versus elevation, with residuals ranging from about -6 to 5.], alt: "Scatterplot residual plot showing residuals for temperature versus elevation, with residuals ranging from about -6 to 5.", caption: [Figure #math.equation(block: false, alt: "7")[$7$]: Residual Plot for Temperature vs. Elevation]) The residuals appear to be fairly random. d. #math.equation(block: true, alt: "x sub o equals 5500; y ^ equals 77.4 minus 0.0039 open parenthesis 5500 close parenthesis equals 55.95 degrees F")[$x_(o) = 5500 \ hat(y) = 77.4 − 0.0039 ( 5500 ) = 55.95^(∘) F$] e. #math.equation(block: true, alt: "x sub o equals 8000; y ^ equals 77.4 minus 0.0039 open parenthesis 8000 close parenthesis equals 46.2 degrees F")[$x_(o) = 8000 \ hat(y) = 77.4 − 0.0039 ( 8000 ) = 46.2^(∘) F$] f. Part d is more accurate, since it is interpolation and part e is extrapolation. g. From #emph[Figure #math.equation(block: false, alt: "6")[$6$]], the correlation coefficient is #emph[r] #math.equation(block: false, alt: "approximately equals")[$≈$] -0.814, which is moderate to strong negative correlation. From #emph[Figure #math.equation(block: false, alt: "6")[$6$]], the coefficient of determination is #math.equation(block: false, alt: "r squared approximately equals 0.663")[$r^(2) ≈ 0.663$], which means that 66.3% of the variability in high temperature is explained by the linear model. The other 33.7% is explained by other variables such as local weather conditions. h. + State the random variables in words. #linebreak() #emph[x] = elevation #linebreak() #emph[y] = high temperature + State the null and alternative hypotheses and the level of significance #linebreak() #math.equation(block: false, alt: "H sub o : ρ equals 0; H sub A : ρ less than 0; α equals 0.05")[$H_(o) : ρ = 0 \ H_(A) : ρ < 0 \ α = 0.05$] + State and check the assumptions for the hypothesis test The assumptions for the hypothesis test were already checked part b. + Find the test statistic and p-value #linebreak() From #emph[Figure #math.equation(block: false, alt: "6")[$6$]], #linebreak() Test statistic: #linebreak() #math.equation(block: false, alt: "t approximately equals minus 3.139")[$t ≈ − 3.139$] #linebreak() p-value: #linebreak() #math.equation(block: false, alt: "p approximately equals 0.0129")[$p ≈ 0.0129$] + Conclusion #linebreak() Reject #math.equation(block: false, alt: "H sub o")[$H_(o)$] since the p-value is less than 0.05. + Interpretation #linebreak() There is enough evidence to show that there is a negative correlation between elevation and high temperatures. i. From #emph[Figure #math.equation(block: false, alt: "6")[$6$]], #math.equation(block: true, alt: "s sub e approximately equals 4.677")[$s_(e) ≈ 4.677$] j. #math.equation(block: false, alt: "y ^ equals 77.4 minus 0.0039 open parenthesis 6500 close parenthesis approximately equals 52.1 degrees F")[$hat(y) = 77.4 − 0.0039 ( 6500 ) ≈ 52.1^(∘) F$] #figure(figph[TI-84 calculator 1-Var Stats screen showing summary statistics for seven x-values, including mean 5214.285714 and standard deviation 1410.601261.], alt: "TI-84 calculator 1-Var Stats screen showing summary statistics for seven x-values, including mean 5214.285714 and standard deviation 1410.601261.", caption: [Figure #math.equation(block: false, alt: "8")[$8$]: Results of 1-Var Stats on TI-83/84]) #math.equation(block: true, alt: "x ― equals 5214.29; s sub x equals 1523.624; n equals 7")[$limits(x)^(―) = 5214.29 \ s_(x) = 1523.624 \ n = 7$] Now you can find #math.equation(block: true, alt: "S S sub x equals s x 2 open parenthesis n minus 1 close parenthesis; equals open parenthesis 1523.623501 close parenthesis squared open parenthesis 7 minus 1 close parenthesis; equals 13928571.43; d f equals n minus 2 equals 7 minus 2 equals 5")[$S S_(x) = s_(x)^(2) ( n − 1 ) \ = ( 1523.623501 )^(2) ( 7 − 1 ) \ = 13928571.43 \ d f = n − 2 = 7 − 2 = 5$] Now look in table A.2. Go down the first column to 5, then over to the column headed with 95%. #math.equation(block: true, alt: "t sub c equals 2.571")[$t_(c) = 2.571$] So #math.equation(block: true, alt: "E equals t sub c s sub e the square root of 1 plus the fraction 1 over n plus the fraction open parenthesis x sub o minus x ― close parenthesis squared over S S sub x; equals 2.571 open parenthesis 4.677 close parenthesis the square root of 1 plus the fraction 1 over 7 plus the fraction open parenthesis 6500 minus 5214.29 close parenthesis squared over 13928571.43; equals 13.5")[$E = t_(c) s_(e) sqrt(1 + frac(1, n) + frac(attach(( x_(o) − limits(x)^(―) ), t: 2), S S_(x))) \ = 2.571 ( 4.677 ) sqrt(1 + frac(1, 7) + frac(( 6500 − 5214.29 )^(2), 13928571.43)) \ = 13.5$] Prediction interval is #math.equation(block: true, alt: "y ^ minus E less than y less than y ^ plus E; 52.1 minus 13.5 less than y less than 52.1 plus 13.5; 38.6 less than y less than 65.6")[$hat(y) − E < y < hat(y) + E \ 52.1 − 13.5 < y < 52.1 + 13.5 \ 38.6 < y < 65.6$] Statistical interpretation: There is a 95% chance that the interval #math.equation(block: false, alt: "38.6 less than y less than 65.6")[$38.6 < y < 65.6$] contains the true value for the temperature at an elevation of 6500 feet. Real world interpretation: A city of 6500 feet will have a high temperature between 38.6°F and 65.6°F. Though this interval is fairly wide, at least the interval tells you that the temperature isn’t that warm. ] ] #examplebox("Example 6")[doing a correlation and regression analysis using r][ Example #math.equation(block: false, alt: "1")[$1$] contains randomly selected high temperatures at various cities on a single day and the elevation of the city. + State the random variables. + Find a regression equation for elevation and high temperature on a given day. + Find the residuals and create a residual plot. + Use the regression equation to estimate the high temperature on that day at an elevation of 5500 ft. + Use the regression equation to estimate the high temperature on that day at an elevation of 8000 ft. + Between the answers to parts d and e, which estimate is probably more accurate and why? + Find the correlation coefficient and coefficient of determination and interpret both. + Is there enough evidence to show a negative correlation between elevation and high temperature? Test at the 5% level. + Find the standard error of the estimate. + Using a 95% prediction interval, find a range for high temperature for an elevation of 6500 feet. #solutionbox[ a. #emph[x] = elevation #emph[y] = high temperature b. + A random sample was taken as stated in the problem. + The distribution for each high temperature value is normally distributed for every value of elevation. + Look at the scatter plot of high temperature versus elevation. #linebreak() R command: plot(elevation, temperature, main="Scatter Plot for Temperature vs Elevation", xlab="Elevation (feet)", ylab="Temperature (degrees F)", ylim=c(0,80)) #linebreak() #linebreak() #strong[#emph[Figure #math.equation(block: false, alt: "9")[$9$]]]#emph[: Scatter Plot of Temperature Versus Elevation] #linebreak() The scatter plot looks fairly linear. + The residual plot for temperature versus elevation appears to be fairly random. (See #emph[Figure] #emph[10.3.10].) #linebreak() It appears that the high temperature is normally distributed. Using R: #linebreak() Commands: #linebreak() lm.out=lm(temperature ~ elevation) #linebreak() summary(lm.out) Output: #linebreak() Call: #linebreak() lm(formula = temperature ~ elevation) Residuals: #linebreak() #math.equation(block: false, alt: "1 2 3 4 5 6 7; 0.1667 minus 1.6333 minus 5.7667 4 .4333 5 .1667 minus 4.6667 2.3000")[$1 2 3 4 5 6 7 \ 0.1667 − 1.6333 − 5.7667 4 ".4333" 5 ".1667" − 4.6667 2.3000$] Coefficients: #linebreak() #math.equation(block: false, alt: "Estimate Std. Error t value Pr(>|t|); (Intercept) 77.36667 6.769182 11.429 8.98 e minus 05 * * *; elevation minus 0.003933 0.001253 minus 3.139 0.0257 *")[$"Estimate Std." "Error" "t value" "Pr(>|t|)" \ "(Intercept)" 77.36667 6.769182 11.429 8.98 e − 05 * * * \ "elevation" − 0.003933 0.001253 − 3.139 0.0257 *$] #linebreak() --- #linebreak() Signif. codes: 0 ‘\*\*\*’ 0.001 ‘\*\*’ 0.01 ‘\*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #linebreak() Residual standard error: 4.677 on 5 degrees of freedom #linebreak() Multiple R-squared: 0.6633, Adjusted R-squared: 0.596 #linebreak() F-statistic: 9.852 on 1 and 5 DF, p-value: 0.0257 From the output you can see the slope = -0.0039 and the y-intercept = 77.4. So the regression equation is: #math.equation(block: true, alt: "y ^ equals 77.4 minus 0.0039 x")[$hat(y) = 77.4 − 0.0039 x$] c. R command: (notice these are also in the summary(lm.out) output, but if you have too many data points, then R only gives a numerical summary of the residuals.) residuals(lm.out) #math.equation(block: true, alt: "C C C C C C C 1 2 3 4 5 6 7; 0.1666667 minus 1.63333333 minus 5.766667 4 .43333333 5 .1666667 minus 4.66666667 2.3000000")[$C C C C C C C 1 2 3 4 5 6 7 \ 0.1666667 − 1.63333333 − 5.766667 4 ".43333333" 5 ".1666667" − 4.66666667 2.3000000$] So for the first x of 7000, the residual is approximately 0.1667. This means if you find the #math.equation(block: false, alt: "y ^")[$hat(y)$] for when x is 7000 and then subtract this answer from the y value of 50 that was measured, you would obtain 0.1667. Similar process is computed for the other residual values. To plot the residuals, the R command is plot(elevation, residuals(lm.out), main="Residual Plot for Temperautre vs Elevation", xlab="Elevation (feet)", ylab="Residuals") #linebreak() abline(0,0) abline(0, 0) #figure(figph[Scatterplot of residuals versus elevation, with seven points ranging from -6.0 to 4.9 residual units and a horizontal reference line at zero.], alt: "Scatterplot of residuals versus elevation, with seven points ranging from -6.0 to 4.9 residual units and a horizontal reference line at zero.", caption: [Figure #math.equation(block: false, alt: "10")[$10$]: Residual Plot for Temperature vs. Elevation]) The residuals appear to be fairly random. d. #math.equation(block: false, alt: "x sub o equals 5500; y ^ equals 77.4 minus 0.0039 open parenthesis 5500 close parenthesis equals 55.95 degrees F")[$x_(o) = 5500 \ hat(y) = 77.4 − 0.0039 ( 5500 ) = 55.95^(∘) F$] e. #math.equation(block: false, alt: "x sub o equals 8000; y ^ equals 77.4 minus 0.0039 open parenthesis 8000 close parenthesis equals 46.2 degrees F")[$x_(o) = 8000 \ hat(y) = 77.4 − 0.0039 ( 8000 ) = 46.2^(∘) F$] f. Part d is more accurate, since it is interpolation and part e is extrapolation. g. The R command for the correlation coefficient is #linebreak() cor(elevation, temperature) #linebreak() \[1\] -0.8144564 So, #math.equation(block: false, alt: "r approximately equals minus 0.814")[$r ≈ − 0.814$], which is moderate to strong negative correlation. From summary(lm.out), the coefficient of determination is the Multiple R-squared. So #math.equation(block: false, alt: "r squared approximately equals 0.663")[$r^(2) ≈ 0.663$], which means that 66.3% of the variability in high temperature is explained by the linear model. The other 33.7% is explained by other variables such as local weather conditions. h. + State the random variables in words. #linebreak() #emph[x] = elevation #linebreak() #emph[y] = high temperature + . State the null and alternative hypotheses and the level of significance #linebreak() #math.equation(block: false, alt: "H sub o : ρ equals 0; H sub A : ρ less than 0; α equals 0.05")[$H_(o) : ρ = 0 \ H_(A) : ρ < 0 \ α = 0.05$] + State and check the assumptions for the hypothesis test. #linebreak() The assumptions for the hypothesis test were already checked part b. + Find the test statistic and p-value #linebreak() The R command is cor.test(elevation, temperature, alternative = "less") #linebreak() Pearson's product-moment correlation #linebreak() data: elevation and temperature #linebreak() t = -3.1387, df = 5, p-value = 0.01285 #linebreak() alternative hypothesis: true correlation is less than 0 #linebreak() 95 percent confidence interval: #linebreak() -1.0000000 -0.3074247 #linebreak() sample estimates: #linebreak() cor #linebreak() -0.8144564 #linebreak() Test statistic: #math.equation(block: false, alt: "t approximately equals minus 3.1387")[$t ≈ − 3.1387$] and p-value: #math.equation(block: false, alt: "p approximately equals 0.01285")[$p ≈ 0.01285$] + Conclusion #linebreak() Reject #math.equation(block: false, alt: "H sub o")[$H_(o)$] since the p-value is less than 0.05. + Interpretation #linebreak() There is enough evidence to show that there is a negative correlation between elevation and high temperatures. i. From summary(lm.out), Residual standard error: 4.677. So, #math.equation(block: false, alt: "s sub e approximately equals 4.677")[$s_(e) ≈ 4.677$] j. R command is predict(lm.out, newdata=list(elevation = 6500), interval = "prediction", level=0.95) newdata=list(elevation = 6500) #math.equation(block: true, alt: "fit lwr upr; 1 51.8 38 .29672 65 .30328")[$" fit " " lwr" " upr " \ 1 51.8 38 ".29672" 65 ".30328"$] So when x = 6500 feet, #math.equation(block: false, alt: "y ^ equals 51.8 degrees F and 38.29672 less than y less than 65.30328")[$hat(y) = 51.8^(∘) F " and " 38.29672 < y < 65.30328$]. Statistical interpretation: There is a 95% chance that the interval #math.equation(block: false, alt: "38.3 less than y less than 65.3")[$38.3 < y < 65.3$] contains the true value for the temperature at an elevation of 6500 feet. Real world interpretation: A city of 6500 feet will have a high temperature between 38.3°F and 65.3°F. Though this interval is fairly wide, at least the interval tells you that the temperature isn’t that warm. ] ] === Homework #notebox("Your Turn", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ For each problem, state the random variables. The data sets in this section are in the homework for section 10.1 and were also used in section 10.2. If you removed any data points as outliers in the other sections, remove them in this sections homework too. + When an anthropologist finds skeletal remains, they need to figure out the height of the person. The height of a person (in cm) and the length of their metacarpal bone one (in cm) were collected and are in Example #math.equation(block: false, alt: "5")[$5$] ("Prediction of height," 2013). + Test at the 1% level for a positive correlation between length of metacarpal bone one and height of a person. + Find the standard error of the estimate. + Compute a 99% prediction interval for height of a person with a metacarpal length of 44 cm. + Example #math.equation(block: false, alt: "6")[$6$] contains the value of the house and the amount of rental income in a year that the house brings in ("Capital and rental," 2013). + Test at the 5% level for a positive correlation between house value and rental amount. + Find the standard error of the estimate. + Compute a 95% prediction interval for the rental income on a house worth \$230,000. + The World Bank collects information on the life expectancy of a person in each country ("Life expectancy at," 2013) and the fertility rate per woman in the country ("Fertility rate," 2013). The data for 24 randomly selected countries for the year 2011 are in Figure 7. + Test at the 1% level for a negative correlation between fertility rate and life expectancy. + Find the standard error of the estimate. + Compute a 99% prediction interval for the life expectancy for a country that has a fertility rate of 2.7. + The World Bank collected data on the percentage of GDP that a country spends on health expenditures ("Health expenditure," 2013) and also the percentage of women receiving prenatal care ("Pregnant woman receiving," 2013). The data for the countries where this information is available for the year 2011 are in Figure 8. + Test at the 5% level for a correlation between percentage spent on health expenditure and the percentage of women receiving prenatal care. + Find the standard error of the estimate. + Compute a 95% prediction interval for the percentage of woman receiving prenatal care for a country that spends 5.0 % of GDP on health expenditure. + The height and weight of baseball players are in Figure 9 ("MLB heightsweights," 2013). + Test at the 5% level for a positive correlation between height and weight of baseball players. + Find the standard error of the estimate. + Compute a 95% prediction interval for the weight of a baseball player that is 75 inches tall. + Different species have different body weights and brain weights are in Figure 10. ("Brain2bodyweight," 2013). + Test at the 1% level for a positive correlation between body weights and brain weights. + Find the standard error of the estimate. + Compute a 99% prediction interval for the brain weight for a species that has a body weight of 62 kg. + A random sample of beef hotdogs was taken and the amount of sodium (in mg) and calories were measured. ("Data hotdogs," 2013) The data are in Example #math.equation(block: false, alt: "11")[$11$]. + Test at the 5% level for a correlation between amount of calories and amount of sodium. + Find the standard error of the estimate. + Compute a 95% prediction interval for the amount of sodium a beef hotdog has if it is 170 calories. + Per capita income in 1960 dollars for European countries and the percent of the labor force that works in agriculture in 1960 are in Example #math.equation(block: false, alt: "12")[$12$] ("OECD economic development," 2013). + Test at the 5% level for a negative correlation between percent of labor force in agriculture and per capita income. + Find the standard error of the estimate. + Compute a 90% prediction interval for the per capita income in a country that has 21 percent of labor in agriculture. + Cigarette smoking and cancer have been linked. The number of deaths per one hundred thousand from bladder cancer and the number of cigarettes sold per capita in 1960 are in Example #math.equation(block: false, alt: "13")[$13$] ("Smoking and cancer," 2013). + Test at the 1% level for a positive correlation between cigarette smoking and deaths of bladder cancer. + Find the standard error of the estimate. + Compute a 99% prediction interval for the number of deaths from bladder cancer when the cigarette sales were 20 per capita. + The weight of a car can influence the mileage that the car can obtain. A random sample of cars weights and mileage was collected and are in Example #math.equation(block: false, alt: "14")[$14$] ("Passenger car mileage," 2013). + Test at the 5% level for a negative correlation between the weight of cars and mileage. + Find the standard error of the estimate. + Compute a 95% prediction interval for the mileage on a car that weighs 3800 pounds. Answer For hypothesis test just the conclusion is given. See solutions for entire answer. 1. a. Reject Ho, b. #math.equation(block: false, alt: "s sub e approximately equals 4.559")[$s_(e) ≈ 4.559$], c. #math.equation(block: false, alt: "151.3161 c m less than y less than 187.3859 c m")[$151.3161 upright(c) upright(m) < y < 187.3859 upright(c) upright(m)$] 3. a. Reject Ho, b. #math.equation(block: false, alt: "s sub e approximately equals 3.204")[$s_(e) ≈ 3.204$], c. #math.equation(block: false, alt: "62.945 years less than y less than 81.391 years")[$62.945 " years " < y < 81.391 "years"$] 5. a. Reject Ho, b. #math.equation(block: false, alt: "s sub e approximately equals 15.33")[$s_(e) ≈ 15.33$], c. #math.equation(block: false, alt: "176.02 inches less than y less than 240.92 inches")[$176.02 " inches " < y < 240.92 "inches"$] 7. a. Reject Ho, b. #math.equation(block: false, alt: "s sub e approximately equals 48.58")[$s_(e) ≈ 48.58$], c. #math.equation(block: false, alt: "348.46 m g less than y less than 559.38 m g")[$348.46 upright(m) upright(g) < y < 559.38 upright(m) upright(g)$] 9. a. Reject Ho, b. #math.equation(block: false, alt: "s sub e approximately equals 0.6838")[$s_(e) ≈ 0.6838$], c. #math.equation(block: false, alt: "1.613 hundred thousand less than y less than 5.432 hundred thousand")[$1.613 " hundred thousand " < y < 5.432 " hundred thousand"$] ] === Data Source: #emph[Brain2bodyweight]. (2013, November 16). Retrieved from #link("http://wiki.stat.ucla.edu/socr/index.php/SOCR_Data_Brain2BodyWeight")[http://wiki.stat.ucla.edu/socr/index...ain2BodyWeight] #emph[Calories in beer, beer alcohol, beer carbohydrates]. (2011, October 25). Retrieved from www.beer100.com/beercalories.htm #emph[Capital and rental values of Auckland properties]. (2013, September 26). Retrieved from #link("http://www.statsci.org/data/oz/rentcap.html")[http://www.statsci.org/data/oz/rentcap.html] #emph[Data hotdogs]. (2013, November 16). Retrieved from #link("http://wiki.stat.ucla.edu/socr/index.php/SOCR_012708_ID_Data_HotDogs")[http://wiki.stat.ucla.edu/socr/index...D\_Data\_HotDogs] #emph[Fertility rate.] (2013, October 14). Retrieved from #link("http://data.worldbank.org/indicator/SP.DYN.TFRT.IN")[http://data.worldbank.org/indicator/SP.DYN.TFRT.IN] #emph[Health expenditure.] (2013, October 14). Retrieved from #link("http://data.worldbank.org/indicator/SH.XPD.TOTL.ZS")[http://data.worldbank.org/indicator/SH.XPD.TOTL.ZS] #emph[Life expectancy at birth]. (2013, October 14). Retrieved from #link("http://data.worldbank.org/indicator/SP.DYN.LE00.IN")[http://data.worldbank.org/indicator/SP.DYN.LE00.IN] #emph[MLB heightsweights]. (2013, November 16). Retrieved from #link("http://wiki.stat.ucla.edu/socr/index.php/SOCR_Data_MLB_HeightsWeights")[http://wiki.stat.ucla.edu/socr/index...HeightsWeights] #emph[OECD economic development.] (2013, December 04). Retrieved from lib.stat.cmu.edu/DASL/Datafiles/oecdat.html #emph[Passenger car mileage]. (2013, December 04). Retrieved from lib.stat.cmu.edu/DASL/Datafiles/carmpgdat.html #emph[Prediction of height from metacarpal bone length]. (2013, September 26). Retrieved from #link("http://www.statsci.org/data/general/stature.html")[http://www.statsci.org/data/general/stature.html] #emph[Pregnant woman receiving prenatal care]. (2013, October 14). Retrieved from #link("http://data.worldbank.org/indicator/SH.STA.ANVC.ZS")[http://data.worldbank.org/indicator/SH.STA.ANVC.ZS] #emph[Smoking and cancer]. (2013, December 04). Retrieved from lib.stat.cmu.edu/DASL/Datafil...cancerdat.html