STA154 · 2082 · 10 marks
Question A web development team records the number of hours spent on debugging (X) and the number of resolved issues (Y) across 10 sprints. a) Calculate the Pearson correlation coefficient to assess the relationship between debugging hours and issues resolved. b) Derive the regression equation of is
Question
A web development team records the number of hours spent on debugging (X) and the number of resolved issues (Y) across 10 sprints.
$$\begin{array}{|c|cccccccccc|}\hline X & 15 & 20 & 25 & 30 & 35 & 40 & 45 & 50 & 55 & 60 \ \hline Y & 3 & 6 & 8 & 11 & 12 & 14 & 16 & 19 & 21 & 22 \ \hline \end{array}$$
a) Calculate the Pearson correlation coefficient to assess the relationship between debugging hours and issues resolved.
b) Derive the regression equation of issues resolved on hours spent debugging.
c) Predict the number of issues resolved for 38 hours of debugging.
[10+0+0+0]
Model Answer: Correlation and Regression Analysis
Given Data
| X (hours) | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 |
|---|---|---|---|---|---|---|---|---|---|---|
| Y (issues) | 3 | 6 | 8 | 11 | 12 | 14 | 16 | 19 | 21 | 22 |
$n = 10$
STEP 1: Compute the sums
| X | Y | XY | X² | Y² |
|---|---|---|---|---|
| 15 | 3 | 45 | 225 | 9 |
| 20 | 6 | 120 | 400 | 36 |
| 25 | 8 | 200 | 625 | 64 |
| 30 | 11 | 330 | 900 | 121 |
| 35 | 12 | 420 | 1225 | 144 |
| 40 | 14 | 560 | 1600 | 196 |
| 45 | 16 | 720 | 2025 | 256 |
| 50 | 19 | 950 | 2500 | 361 |
| 55 | 21 | 1155 | 3025 | 441 |
| 60 | 22 | 1320 | 3600 | 484 |
| 375 | 132 | 5820 | 16125 | 2112 |
$\sum X = 375,\ \sum Y = 132,\ \sum XY = 5820,\ \sum X^2 = 16125,\ \sum Y^2 = 2112$
a) Pearson Correlation Coefficient
$$r = \frac{n\sum XY - \sum X \sum Y}{\sqrt{[n\sum X^2 - (\sum X)^2][n\sum Y^2 - (\sum Y)^2]}}$$
Compute components:
- $n\sum XY = 10 \times 5820 = 58200$
- $\sum X \sum Y = 375 \times 132 = 49500$
- $n\sum X^2 = 161250,\quad (\sum X)^2 = 140625 \Rightarrow 20625$
- $n\sum Y^2 = 21120,\quad (\sum Y)^2 = 17424 \Rightarrow 3696$
$$r = \frac{58200 - 49500}{\sqrt{20625 \times 3696}} = \frac{8700}{\sqrt{76245000}}$$
$$\sqrt{76245000} = 8731.95$$
$$r = \frac{8700}{8731.95} = 0.9963$$
$r \approx 0.996$: very strong positive correlation.
b) Regression Equation of Y on X
$$b = \frac{n\sum XY - \sum X \sum Y}{n\sum X^2 - (\sum X)^2} = \frac{8700}{20625} = 0.42182$$
Means:
$$\bar{X} = \frac{375}{10} = 37.5,\qquad \bar{Y} = \frac{132}{10} = 13.2$$
Intercept:
$$a = \bar{Y} - b\bar{X} = 13.2 - (0.42182)(37.5) = 13.2 - 15.818 = -2.618$$
$$\boxed{\hat{Y} = -2.618 + 0.4218,X}$$
c) Prediction for X = 38 hours
$$\hat{Y} = -2.618 + 0.4218(38) = -2.618 + 16.029 = 13.41$$
Approximately 13 issues resolved (13.4 if retaining decimals).
Since $r = 0.996$ and $X = 38$ lies inside the observed range $[15,60]$, the prediction is reliable.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.