Correlation & Regression • CR3

Simple Regression by Least Squares Formula Method

This page uses two small problems to practise correlation, coefficient of determination, regression equation, prediction and interpretation.

Formulae Used in This Page

We use the direct formula method based on the least squares idea. The fitted line predicts \(Y\) from \(X\).

Karl Pearson’s Correlation Coefficient

\[ r=\frac{n\sum XY-\sum X\sum Y} {\sqrt{\left[n\sum X^2-(\sum X)^2\right]\left[n\sum Y^2-(\sum Y)^2\right]}} \]

Coefficient of Determination

\[ \text{Coefficient of Determination}=r^2\times100\% \]

Regression Coefficient

\[ b=\frac{n\sum XY-\sum X\sum Y}{n\sum X^2-(\sum X)^2} \]

Regression Line

\[ a=\bar{Y}-b\bar{X} \]

\[ \hat{Y}=a+bX \]

Equivalently, after finding \(b\), write

\[ Y-\bar{Y}=b(X-\bar{X}) \]

and simplify. Both forms give the same regression line.

\(\hat{Y}\) means predicted value of \(Y\). The predicted value is not necessarily the exact actual value.

Problem 1: Study Hours and Exam Marks

Correlation • COD • Regression

The following data show study hours \(X\) and exam marks \(Y\) of five students. Find \(r\), coefficient of determination, regression equation of marks on study hours, and predict marks when \(X=7\) hours.

Study Hours \(X\) 2 3 5 6 8
Exam Marks \(Y\) 50 55 65 70 82
✓
Enter your answer first.
Correct answer: \(0.999\)
✓
Enter your answer first.
Correct answer: \(99.78\%\)
✓
Enter your answer first.
Correct answer: \(39.053\)
✓
Enter your answer first.
Correct answer: \(5.281\)
✓
Enter your answer first.
Correct answer: \(76.02\)

Try once before opening the solution

First find the required sums, then calculate \(r\), \(b\), \(a\) and \(\hat{Y}\).

Detailed Step-by-Step Solution

First calculate the required sums:

\(n\) \(\sum X\) \(\sum Y\) \(\sum X^2\) \(\sum Y^2\) \(\sum XY\)
5 24 322 138 21374 1666

Calculate Karl Pearson’s correlation coefficient:

\[ r=\frac{n\sum XY-\sum X\sum Y} {\sqrt{\left[n\sum X^2-(\sum X)^2\right]\left[n\sum Y^2-(\sum Y)^2\right]}} \]

\[ r=\frac{5(1666)-24(322)} {\sqrt{\left[5(138)-24^2\right]\left[5(21374)-322^2\right]}} \]

\[ r=0.999 \]

Coefficient of determination:

\[ r^2\times100\%=(0.999)^2\times100\%=99.78\% \]

About \(99.78\%\) of the variation in exam marks is explained by study hours according to this linear model.

Now calculate the regression coefficient \(b\):

\[ b=\frac{n\sum XY-\sum X\sum Y}{n\sum X^2-(\sum X)^2} \]

\[ b=\frac{5(1666)-24(322)}{5(138)-24^2} \]

\[ b=5.281 \]

Here,

\[ \bar{X}=\frac{24}{5}=4.8,\qquad \bar{Y}=\frac{322}{5}=64.4 \]

Using \(a=\bar{Y}-b\bar{X}\):

\[ a=64.4-5.281(4.8) \]

\[ a=39.053 \]

So the regression equation is:

\[ \hat{Y}=39.053+5.281X \]

The same regression line can also be written directly as:

\[ Y-\bar{Y}=b(X-\bar{X}) \]

\[ Y-64.4=5.281(X-4.8) \]

Simplifying,

\[ \hat{Y}=39.053+5.281X \]

When \(X=7\),

\[ \hat{Y}=39.053+5.281(7) \]

\[ \hat{Y}=76.02 \]

Final Interpretation

There is a very strong positive correlation between study hours and exam marks. About \(99.78\%\) of the variation in marks is explained by study hours according to this model. The regression coefficient \(5.281\) means that for each additional 1 hour of study, the predicted mark increases by about \(5.281\) marks. Predicted marks for 7 study hours \(=76.02\).

Video Solution

In this video, we solve the study hours and exam marks problem using the least squares formula method.

Problem 2: Load and Deflection

Engineering Example • Prediction

A simply supported beam carries different loads \(X\) at its midpoint. The corresponding maximum deflection \(Y\) is recorded below. Find \(r\), coefficient of determination, regression equation of deflection on load, and estimate deflection when \(X=170\) kg.

Load \(X\) kg 100 120 140 160 180 200
Deflection \(Y\) cm 0.45 0.55 0.60 0.70 0.80 0.85
✓
Enter your answer first.
Correct answer: \(0.996\)
✓
Enter your answer first.
Correct answer: \(99.11\%\)
✓
Enter your answer first.
Correct answer: \(0.048\)
✓
Enter your answer first.
Correct answer: \(0.0041\)
✓
Enter your answer first.
Correct answer: \(0.740\)

Try once before opening the solution

Find \(r\), \(r^2\times100\%\), \(b\), \(a\), then substitute \(X=170\).

Detailed Step-by-Step Solution

First calculate the required sums:

\(n\) \(\sum X\) \(\sum Y\) \(\sum X^2\) \(\sum Y^2\) \(\sum XY\)
6 900 3.95 142000 2.7175 621

Calculate Karl Pearson’s correlation coefficient:

\[ r=\frac{6(621)-900(3.95)} {\sqrt{\left[6(142000)-900^2\right]\left[6(2.7175)-(3.95)^2\right]}} \]

\[ r=0.996 \]

Coefficient of determination:

\[ r^2\times100\%=(0.996)^2\times100\%=99.11\% \]

About \(99.11\%\) of the variation in deflection is explained by load according to this linear model.

Calculate \(b\):

\[ b=\frac{6(621)-900(3.95)}{6(142000)-900^2} \]

\[ b=0.004071 \]

Here,

\[ \bar{X}=\frac{900}{6}=150,\qquad \bar{Y}=\frac{3.95}{6}=0.6583 \]

Using \(a=\bar{Y}-b\bar{X}\):

\[ a=0.6583-0.004071(150) \]

\[ a=0.0476 \]

So the regression equation is:

\[ \hat{Y}=0.0476+0.004071X \]

The same regression line can also be written directly as:

\[ Y-\bar{Y}=b(X-\bar{X}) \]

\[ Y-0.6583=0.004071(X-150) \]

Simplifying,

\[ \hat{Y}=0.0476+0.004071X \]

When \(X=170\),

\[ \hat{Y}=0.0476+0.004071(170) \]

\[ \hat{Y}=0.740 \]

Final Interpretation

There is a very strong positive correlation between load and deflection. About \(99.11\%\) of the variation in deflection is explained by load according to this model. The regression coefficient \(0.004071\) means that for each additional 1 kg load, the predicted deflection increases by about \(0.004071\) cm. Predicted deflection for \(170\) kg load \(=0.740\) cm.

Video Solution

In this video, we solve the load and deflection problem and interpret the regression coefficient in engineering language.
Formulae

Available Formula Sheets

⌂ Home
Latest
Latest Content Auto
Home