WishWasTraining Academy
NDA & Naval Academy entrance exam school
← home
Chapter M8-4 · 4 of 8 in Statistics and Probability · 13 min read

Correlation and regression

29 real NDA questions of this kind in the 19 papers of 2017 to 2026.

Try three questions free ↓
This chapter has a video lessonWatch it, practise with a drill and keep your record, all with a free account. No fee, no card.

Why this chapter matters. This chapter drew 7 questions in the seven papers from NDA II 2023 to NDA II 2026, spread over five of the seven papers. Six of the seven are about the two lines of regression: find the correlation coefficient from the two lines, find a regression coefficient, or say what the lines look like when ​r = 0​. The school mathematics books do not teach this topic, so a student who learns the few facts in section 4 gains marks that many others lose.

What you will be able to do

  • Find the correlation coefficient ​r​ of a small set of pairs, and state its properties.
  • Write the two regression lines and their regression coefficients ​b_{yx}​ and ​b_{xy}​.
  • Find ​r​ and the two means when only the two regression lines are given.
  • Say how ​r​ changes when the variables are changed in origin and scale.

Before you start you should know: mean (Chapter M8-2), variance and standard deviation (Chapter M8-3), and the slope of a line and the angle between two lines (Chapter M4-2).

1. Two variables together

Sometimes each observation is a pair: the height and weight of a cadet, or the hours of study and the marks of a student. Such data are called bivariate data.

Plot each pair ​(x, y)​ as a point on graph paper. The picture is a scatter diagram. If the points lie in a band that rises from left to right, ​y​ tends to increase with ​x​: the correlation is positive. If the band falls from left to right, the correlation is negative. If the points form a round cloud with no direction, there is no linear correlation.

Three scatter diagrams: points in a rising band, points in a falling band, and points in a round cloud

2. The correlation coefficient

The covariance of ​x​ and ​y​ measures how they vary together:

\text{Cov}(x, y) = \frac{\sum (x_i - \bar{x})(y_i - \bar{y})}{n} = \frac{\sum x_i y_i}{n} - \bar{x}\,\bar{y}

Karl Pearson's coefficient of correlation is the covariance divided by the two standard deviations:

r = \frac{\text{Cov}(x, y)}{\sigma_x\,\sigma_y} = \frac{n\sum xy - \sum x \sum y}{\sqrt{n\sum x^2 - \left(\sum x\right)^2}\;\sqrt{n\sum y^2 - \left(\sum y\right)^2}}

Properties of ​r​:

  • It always lies between ​-1​ and ​1​. It has no unit.
  • ​r = 1​ or ​r = -1​ means all the points lie exactly on one straight line. ​r = 0​ means no linear relation.
  • Change of origin and scale. If ​u = ax + b​ and ​v = cy + d​, the correlation between ​u​ and ​v​ is ​r​ when ​a​ and ​c​ have the same sign, and ​-r​ when they have opposite signs. The size of ​r​ never changes.

3. The two lines of regression

A regression line is the straight line that fits the scatter diagram best. There are two of them, because there are two jobs to do.

Line of regression of ​y​ on ​x​ Line of regression of ​x​ on ​y​
Used to Estimate ​y​ when ​x​ is known Estimate ​x​ when ​y​ is known
Equation ​y - \bar{y} = b_{yx}(x - \bar{x})​ ​x - \bar{x} = b_{xy}(y - \bar{y})​
Regression coefficient ​b_{yx} = r\,\dfrac{\sigma_y}{\sigma_x} = \dfrac{\text{Cov}(x, y)}{\sigma_x^2}​ ​b_{xy} = r\,\dfrac{\sigma_x}{\sigma_y} = \dfrac{\text{Cov}(x, y)}{\sigma_y^2}​
From sums ​b_{yx} = \dfrac{n\sum xy - \sum x \sum y}{n\sum x^2 - \left(\sum x\right)^2}​ ​b_{xy} = \dfrac{n\sum xy - \sum x \sum y}{n\sum y^2 - \left(\sum y\right)^2}​

Read ​b_{yx}​ as "​b​, ​y​ on ​x​". In the line of ​y​ on ​x​, ​y​ is the subject: ​y = b_{yx}\,x + \text{constant}​. In the line of ​x​ on ​y​, ​x​ is the subject: ​x = b_{xy}\,y + \text{constant}​.

4. Six facts the exam uses

  1. Both lines pass through the point of means ​(\bar{x}, \bar{y})​. So solving the two equations together gives ​\bar{x}​ and ​\bar{y}​.
  2. ​b_{yx} \times b_{xy} = r^2​. So ​r = \pm\sqrt{b_{yx}\,b_{xy}}​.
  3. ​b_{yx}​, ​b_{xy}​ and ​r​ all have the same sign. If both coefficients are negative, ​r​ is negative.
  4. Since ​r^2 \le 1​, the product ​b_{yx}\,b_{xy}​ cannot be more than 1. If one coefficient is more than 1 in size, the other is less than 1.
  5. If ​r = 0​, the lines are ​y = \bar{y}​ and ​x = \bar{x}​: parallel to the axes and at right angles to each other. If ​r = \pm 1​, the two lines are the same line.
  6. The acute angle ​\theta​ between the two lines is given by ​\tan\theta = \dfrac{1 - r^2}{\lvert r \rvert} \cdot \dfrac{\sigma_x\,\sigma_y}{\sigma_x^2 + \sigma_y^2}​. In a question with two given lines, it is quicker to use their slopes and the formula of Chapter M4-2.

Three sketches of the two regression lines through the point of means: at right angles when r is 0, partly open when r is 0.5, and a single line when r is plus or minus 1

The picture shows fact 5, drawn for equal standard deviations: the two lines open like scissors as ​r​ goes from ​\pm 1​ to 0.

Which line is which? The question usually gives two equations without saying which is which. Assume one of them is ​y​ on ​x​ and the other ​x​ on ​y​, and find ​b_{yx}​ and ​b_{xy}​. If their product is more than 1, the assumption is wrong: swap them.

5. Worked examples

Example 1. For the five pairs below, find ​r​ and both regression lines.

​x​ 1 2 3 4 5
​y​ 2 4 5 4 5

​n = 5​, ​\sum x = 15​, ​\sum y = 20​, ​\sum xy = 2 + 8 + 15 + 16 + 25 = 66​, ​\sum x^2 = 55​, ​\sum y^2 = 86​. So ​\bar{x} = 3​ and ​\bar{y} = 4​.

​n\sum xy - \sum x\sum y = 330 - 300 = 30​. ​n\sum x^2 - (\sum x)^2 = 275 - 225 = 50​. ​n\sum y^2 - (\sum y)^2 = 430 - 400 = 30​.

​r = \dfrac{30}{\sqrt{50 \times 30}} = \dfrac{30}{\sqrt{1500}} \approx 0.77​.

​b_{yx} = \dfrac{30}{50} = 0.6​, so the line of ​y​ on ​x​ is ​y - 4 = 0.6(x - 3)​, that is ​y = 0.6x + 2.2​.

​b_{xy} = \dfrac{30}{30} = 1​, so the line of ​x​ on ​y​ is ​x - 3 = 1(y - 4)​, that is ​x = y - 1​.

Check with fact 2: ​b_{yx}\,b_{xy} = 0.6​ and ​r^2 = \dfrac{900}{1500} = 0.6​.

The five points of Example 1 with the line of y on x, y = 0.6x + 2.2, and the line of x on y, x = y - 1, crossing at the point of means (3, 4)

Example 2. Given ​\sigma_x = 3​, ​\sigma_y = 4​ and ​r = 0.5​, find the two regression coefficients.

​b_{yx} = 0.5 \times \dfrac{4}{3} = \dfrac{2}{3}​ and ​b_{xy} = 0.5 \times \dfrac{3}{4} = \dfrac{3}{8}​. Check: ​\dfrac{2}{3} \times \dfrac{3}{8} = \dfrac{1}{4} = r^2​.

Example 3. The two lines of regression are ​3x + 2y = 26​ and ​6x + y = 31​. Find the means of ​x​ and ​y​ and the correlation coefficient.

Means. Solve the two equations. From the second, ​y = 31 - 6x​. Then ​3x + 62 - 12x = 26​, so ​x = 4​ and ​y = 7​. Hence ​\bar{x} = 4​, ​\bar{y} = 7​.

Which is which. Take the first as ​y​ on ​x​: ​y = -\dfrac{3}{2}x + 13​, so ​b_{yx} = -\dfrac{3}{2}​. Take the second as ​x​ on ​y​: ​x = -\dfrac{1}{6}y + \dfrac{31}{6}​, so ​b_{xy} = -\dfrac{1}{6}​. Product ​= \dfrac{1}{4}​, which is not more than 1, so the choice is right. (The other way gives ​(-6) \times \left(-\dfrac{2}{3}\right) = 4​, which is impossible.)

Correlation. ​r^2 = \dfrac{1}{4}​ and both coefficients are negative, so ​r = -\dfrac{1}{2}​.

Example 4. The correlation coefficient between ​x​ and ​y​ is ​0.6​. Find the correlation coefficient between (i) ​2x + 3​ and ​5y - 1​, (ii) ​-x​ and ​4y​.

(i) The multipliers 2 and 5 have the same sign: ​0.6​. (ii) The multipliers ​-1​ and 4 have opposite signs: ​-0.6​.

6. From the real papers

Try each for 75 seconds before reading the solution. The third one needs more time.

NDA II 2023, Q111. If ​r​ is the coefficient of correlation between ​x​ and ​y​, then what is the correlation coefficient between ​(3x + 4)​ and ​(-3y + 3)​?

(a) ​-r​  (b) ​r​  (c) ​\sqrt{3}r​  (d) ​-\sqrt{3}r​

Solution. Adding constants changes nothing. The multipliers ​3​ and ​-3​ have opposite signs, so the sign of ​r​ changes and its size does not. Answer (a).

NDA I 2024, Q103. From data ​(-4, 1)​, ​(-1, 2)​, ​(2, 7)​ and ​(3, 1)​, the regression line of ​y​ on ​x​ is obtained as ​y = a + bx​, then what is the value of ​2a + 15b​?

(a) ​6​  (b) ​11​  (c) ​17​  (d) ​21​

Solution. ​n = 4​, ​\sum x = 0​, ​\sum y = 11​, ​\sum xy = -4 - 2 + 14 + 3 = 11​, ​\sum x^2 = 30​. So ​b = b_{yx} = \dfrac{4 \times 11 - 0}{4 \times 30 - 0} = \dfrac{11}{30}​. The line passes through ​(\bar{x}, \bar{y}) = \left(0, \dfrac{11}{4}\right)​, so ​a = \dfrac{11}{4}​. Then ​2a + 15b = \dfrac{11}{2} + \dfrac{11}{2} = 11​. Answer (b).

NDA I 2024, Q104. Let ​x + 2y + 1 = 0​ and ​2x + 3y + 4 = 0​ are two lines of regression computed from some bivariate data. If ​\theta​ is the acute angle between them, then what is the value of ​488\tan 3\theta​?

(a) ​191​  (b) ​161​  (c) ​131​  (d) ​121​

Solution. Use the slopes: ​m_1 = -\dfrac{1}{2}​, ​m_2 = -\dfrac{2}{3}​. ​\tan\theta = \left\lvert \dfrac{m_1 - m_2}{1 + m_1 m_2} \right\rvert = \dfrac{1/6}{4/3} = \dfrac{1}{8}​. Then ​\tan 3\theta = \dfrac{3\tan\theta - \tan^3\theta}{1 - 3\tan^2\theta} = \dfrac{\frac{3}{8} - \frac{1}{512}}{1 - \frac{3}{64}} = \dfrac{191/512}{61/64} = \dfrac{191}{488}​. So ​488\tan 3\theta = 191​. Answer (a).

NDA I 2026, Q111. Let two lines of regression be ​x + y + 11 = 0​ and ​2x + 3y + 4 = 0​ for some data. What is the value of correlation coefficient between ​x​ and ​y​?

(a) ​-\sqrt{\frac{2}{3}}​  (b) ​-\sqrt{\frac{1}{6}}​  (c) ​\sqrt{\frac{2}{3}}​  (d) ​\sqrt{\frac{1}{6}}​

Solution. Take ​2x + 3y + 4 = 0​ as ​y​ on ​x​: ​y = -\dfrac{2}{3}x - \dfrac{4}{3}​, so ​b_{yx} = -\dfrac{2}{3}​. Take ​x + y + 11 = 0​ as ​x​ on ​y​: ​x = -y - 11​, so ​b_{xy} = -1​. Product ​= \dfrac{2}{3} \le 1​, so this is right. (The other way gives ​\dfrac{3}{2}​.) Both coefficients are negative, so ​r = -\sqrt{\dfrac{2}{3}}​. Answer (a).

NDA II 2026, Q104. If the correlation coefficient between the variables ​X​ and ​Y​ is zero, then the two lines of regression are

(a) ​X + Y + 11 = 0​ and ​2X + 3Y + 4 = 0​  (b) ​X = \bar{X}​ and ​Y = \bar{Y}​  (c) ​X = 0\cdot4Y + 10​ and ​Y = 1\cdot6X + 20​  (d) ​\bar{X} + \bar{Y} + 11 = 0​ and ​2\bar{X} + 3\bar{Y} + 4 = 0​

Solution. If ​r = 0​, both regression coefficients are zero. The lines become ​Y = \bar{Y}​ and ​X = \bar{X}​ (fact 5). Answer (b).

NDA II 2026, Q108. The standard deviation of ​X​ is 4 and the standard deviation of ​Y​ is 5. If the correlation coefficient ​r​ is ​0\cdot8​, then what is the regression coefficient of ​Y​ on ​X​?

(a) ​-2​  (b) ​-1​  (c) ​0​  (d) ​1​

Solution. ​b_{yx} = r\,\dfrac{\sigma_y}{\sigma_x} = 0.8 \times \dfrac{5}{4} = 1​. Answer (d).

7. Mistakes that cost marks

  1. Turning the fraction upside down. In ​b_{yx}​ the standard deviation of ​y​ is on top: ​b_{yx} = r\,\dfrac{\sigma_y}{\sigma_x}​. The first letter of the suffix goes on top.
  2. Forgetting the sign of ​r​. ​r = \pm\sqrt{b_{yx}\,b_{xy}}​, and the sign is the sign of the two coefficients. Two negative coefficients give a negative ​r​.
  3. Not testing which line is which. If your ​r^2​ comes out more than 1, you have the two lines the wrong way round.
  4. Taking the slope of the ​x​ on ​y​ line as ​b_{xy}​. ​b_{xy}​ is the coefficient of ​y​ when ​x​ is the subject. The slope of that line on the usual graph is ​\dfrac{1}{b_{xy}}​.

8. Quick check

Do these without help. Answers are at the end.

  1. ​b_{yx} = 0.8​ and ​b_{xy} = 0.45​. Find ​r​.
  2. ​\sigma_x = 4​, ​\sigma_y = 5​ and ​\text{Cov}(x, y) = 12​. Find ​r​, ​b_{yx}​ and ​b_{xy}​.
  3. The correlation coefficient between ​x​ and ​y​ is ​0.7​. Find it between ​2x + 5​ and ​-3y + 1​.
  4. The two regression lines of some data meet at the point ​(5, 8)​. What are the means of ​x​ and ​y​?
  5. Can ​b_{yx} = 1.5​ and ​b_{xy} = 0.8​ for the same data? Give the reason.

9. Read and watch more, free

What Where Language
Textbook, correlation NCERT Statistics for Economics, Chapter 6 Correlation · Hindi edition, book page English, Hindi
Textbook, the regression line of ​y​ on ​x​ OpenStax Introductory Statistics 2e, 12.3 The Regression Equation English
Video, the two regression lines for NDA Arpit Choudhary: Regression Lines (54 minutes) Hinglish
Video, the whole chapter for NDA R.S SIR: Correlation and Regression for NDA (55 minutes) Hinglish
Video and practice, bivariate data Khan Academy: Statistics and Probability course (Unit 5) English

No free textbook that we found teaches the two regression lines the way NDA asks them; the two NDA videos and this lesson do. The videos were chosen from their titles, length and views; they have not yet been watched by a teacher.

Answers to the quick check

  1. ​r^2 = 0.8 \times 0.45 = 0.36​. Both coefficients are positive, so ​r = 0.6​.
  2. ​r = \dfrac{12}{4 \times 5} = 0.6​; ​b_{yx} = \dfrac{12}{16} = 0.75​; ​b_{xy} = \dfrac{12}{25} = 0.48​.
  3. ​-0.7​, because the multipliers ​2​ and ​-3​ have opposite signs.
  4. ​\bar{x} = 5​ and ​\bar{y} = 8​.
  5. No. The product is ​1.2​, which would make ​r^2​ more than 1.

Next chapter: Sample space and events.

Free · no sign-up

Try three questions on this chapter

Exam-pattern questions from this chapter's drill. Pick an answer for each, then check.

  1. Question 1 of 3
    Which one of the following pairs can be the values of ​b_{yx}​ and ​b_{xy}​, the two regression coefficients of the same bivariate data?
  2. Question 2 of 3
    For a variable ​x​ that takes at least two different values, what is the coefficient of correlation between ​x​ and ​3x - 2​?
  3. Question 3 of 3
    The two lines of regression for some data are ​x + 2y = 10​ and ​2x + y = 11​. What is the coefficient of correlation between ​x​ and ​y​?
Free sign-up

You have read the chapter. Now make it stick.

A free account adds the video lesson, a drill of ten questions on this chapter marked like the exam, the timed mock papers, a study plan to your exam date and your own record of what you have done. No fee, no card.

Past questions quoted are from the official UPSC paper named in the text; the explanations are WishWas's own and have been checked against the official key. The links under “Read and watch more” go to free material on other sites; nothing is copied.