Theme 6 Week 12 - Tutorial With Answers
Theme 6 Week 12 - Tutorial With Answers
Theme 6:
Week 12- Tutorial
Linear regression and correlation
1
Question 1
The ability of a welded joint to elongate under stress is affected by the
chemical composition of the weld metal. In an experiment to determine
the effect of carbon content (x) on elongation (y), 39 welds were
stressed until fracture, and both carbon content (in parts per thousand)
and elongation (in percent) were measured. The following summary
statistics were calculated:
σ𝑛𝑖=1 ( 𝑥1 − 𝑥)ҧ 2 = 0.6561, σ𝑛𝑖=1(𝑥1 − 𝑥)(𝑦
ҧ 1 − 𝑦)
ത = - 3.9097, s = 4.3319
Assuming that 𝑥 and 𝑦 follow a linear model, compute the estimated
change in elongation due to an increase of one part per thousand in
carbon content. Test if it is appropriate to use the linear model to
predict elongation from carbon content?
Solution 1
Given: σ𝑛𝑖=1 ( 𝑥1 − 𝑥)ҧ 2 = 0.6561, σ𝑛𝑖=1(𝑥1 − 𝑥)(𝑦
ҧ 1 − 𝑦)
ത = - 3.9097, s =
4.3319, n = 39
In the linear model: 𝑦 = 𝛽0 + 𝛽1𝑥 + 𝜀, the change in elongation due to
an increase of one part per thousand in carbon, is the slope 𝛽1. We
can estimate this to be:
σ𝑛
𝑖=1(𝑥1 −𝑥)(𝑦
ҧ 1 −𝑦)
ത − 3.9097
𝛽መ1 = σ𝑛
= = − 5.959
𝑖=1 ( 𝑥1 − 𝑥)ҧ 2 0.6561
1 − 𝛽1
𝛽
t=
𝑆𝛽
1
𝑠 4.3319
We must find 𝑆𝛽1 : 𝑆𝛽1 = = 0.6561
= 5.348
σ𝑛
𝑖=1 ത 2
( 𝑥1 − 𝑥)
1 − 𝛽1
𝛽 −5.959 −0
t= = = -1.114
𝑆𝛽
1
5.348
A linear model is not appropriate. The errors are not random, there is a
pattern.
Solution 2
Determine if a linear model is appropriate for the following residual
plots.
(a) Decide which variable should be the independent variable and which should
be the dependent variable.
(b) What is the slope of the least-squares (best-fit) line? Interpret the slope.
(c) Calculate the least-squares line.
(d) Find the correlation coefficient.
(e) Find the estimated average height for an eleven-year-old.
(f) Are there any outliers in the data?
Solution 3
b) What is the slope of the least-squares (best-fit) line? Interpret the slope.
σ𝑛 ҧ 1 −𝑦)
𝑖=1(𝑥1 −𝑥)(𝑦 ത 1013,54
𝛽መ1 = σ𝑛 ҧ 2
= = − 7.095
𝑖=1 ( 𝑥1 − 𝑥) 142,85
As the age of a South African boy increases by one year, the average
height tends to increase by 7.095
Solution 3
𝑆 4.88
𝑟 = 𝛽መ1 × 𝑥 = 7.095 × = 0.976
𝑆𝑦 35.47
Solution 3
(1 −𝑟 2 ) σ𝑛 ഥ)2
𝑖=1 ( 𝑦1 −𝑦 (1 −0.9762 )(7546,86)
s= = = 8.46
𝑛 −2 7 −2
Outlier > 2(8.46) = 16.92. Check all the 𝑦1 − 𝑦ො using 𝑦ො 65.06 + 7.095x.
No, there are no outliers.
Thank you!
Happy studying ☺