Regression line of Y on X: \(Y = 3 + 3X\) (all four points lie exactly on it).
Step 1: Means
\[\bar{X} = \frac{3+5+7+9}{4} = 6,\quad \bar{Y} = \frac{12+18+24+30}{4} = 21\]
Step 2: Deviations
| X | Y | \(x = X-6\) | \(y = Y-21\) | \(x^2\) | \(xy\) |
| 3 | 12 | −3 | −9 | 9 | 27 |
| 5 | 18 | −1 | −3 | 1 | 3 |
| 7 | 24 | 1 | 3 | 1 | 3 |
| 9 | 30 | 3 | 9 | 9 | 27 |
| | | Total | 20 | 60 |
Step 3: Slope and intercept
\[b = \frac{\sum xy}{\sum x^2} = \frac{60}{20} = 3\]
\[a = \bar{Y} - b\bar{X} = 21 - 3(6) = 3\]
\[\hat{Y} = 3 + 3X\]
Check: X = 3 gives 12, X = 9 gives 30, so every point fits exactly and the correlation coefficient is \(r = 1\). (The line of X on Y is \(X = \tfrac{Y}{3} - 1\), the same line.)