• NEET
      • Class 11th
      • Class 12th
      • Class 12th Plus
    • JEE
      • Class 11th
      • Class 12th
      • Class 12th Plus
    • Class 6-10
      • Class 6th
      • Class 7th
      • Class 8th
      • Class 9th
      • Class 10th
    • View All Options
      • Online Courses
      • Distance Learning
      • Hindi Medium Courses
      • International Olympiad
    • NEET
      • Class 11th
      • Class 12th
      • Class 12th Plus
    • JEE (Main+Advanced)
      • Class 11th
      • Class 12th
      • Class 12th Plus
    • JEE Main
      • Class 11th
      • Class 12th
      • Class 12th Plus
  • Classroom
    • NEET
      • 2025
      • 2024
      • 2023
      • 2022
    • JEE
      • 2025
      • 2024
      • 2023
      • 2022
    • Class 6-10
    • JEE Main
      • Previous Year Papers
      • Sample Papers
      • Result
      • Analysis
      • Syllabus
      • Exam Date
    • JEE Advanced
      • Previous Year Papers
      • Sample Papers
      • Mock Test
      • Result
      • Analysis
      • Syllabus
      • Exam Date
    • NEET
      • Previous Year Papers
      • Sample Papers
      • Mock Test
      • Result
      • Analysis
      • Syllabus
      • Exam Date
      • College Predictor
      • Counselling
    • NCERT Solutions
      • Class 6
      • Class 7
      • Class 8
      • Class 9
      • Class 10
      • Class 11
      • Class 12
    • CBSE
      • Notes
      • Sample Papers
      • Question Papers
    • Olympiad
      • NSO
      • IMO
      • NMTC
  • NEW
    • TALLENTEX
    • AOSAT
  • ALLEN E-Store
    • ALLEN for Schools
    • About ALLEN
    • Blogs
    • News
    • Careers
    • Request a call back
    • Book home demo
Home
JEE Maths
Linear Regression

Linear Regression

Linear Regression is a fundamental concept in statistics and machine learning, widely used for modeling relationships between variables. Whether you're analyzing trends, making predictions, or understanding data patterns, linear regression provides a straightforward approach to uncovering insights.

1.0What Is Linear Regression?

Linear Regression is a statistical method used to model the relationship between a dependent variable (target) and one or more independent variables (predictors). The goal is to fit a linear equation to observed data, allowing for predictions and trend analysis.

2.0Basic Linear Regression

In its simplest form, Simple Linear Regression involves two variables:

  • Dependent Variable (Y): The outcome you're trying to predict.
  • Independent Variable (X): The predictor or feature used to make predictions.

The relationship is modeled by the equation: Y=b0​+b1​X+ϵ

Where:

  • b0​ is the y-intercept,
  • b1​ is the slope of the line,
  • ϵ is the error term.

This method assumes a straight-line relationship between the variables and is typically used when there's a clear, linear association between them.

3.0Linear Regression Analysis

Linear Regression Analysis involves several key steps:

  1. Data Collection: Gather data for the dependent and independent variables.
  2. Model Fitting: Use statistical methods, such as the least squares method, to estimate the coefficients (b0​ and b1​). 
  3. Model Evaluation: Assess the model's performance using metrics like R-squared, which indicates the proportion of variance in the dependent variable explained by the independent variable.
  4. Prediction: Use the fitted model to predict new values of the dependent variable based on new data for the independent variable.

This process helps in understanding the strength and nature of the relationship between variables and in making informed predictions.

4.0Multiple Linear Regression

Multiple Linear Regression (MLR) extends simple linear regression by modeling the relationship between a dependent variable and two or more independent variables. The equation for MLR is:

Y=b0​+b1​X1​+b2​X2​+⋯+bn​Xn​+ϵ

Where:

  • X1​,X2​,X3​,....,Xn​ are the independent variables,
  • b1​,b2​,.....,b+​n are their corresponding coefficients.

MLR allows for a more nuanced understanding of how multiple factors simultaneously influence the dependent variable. For example, predicting house prices might involve variables like square footage, number of bedrooms, and location.

5.0Solved Example on Linear Regression 

Example 1: A company wants to predict its sales based on the amount spent on advertising. The data collected for 5 months is as follows:

Month

Advertising Spend (in thousands)

Sales (in thousands)

1

1.0

2.0

2

2.0

2.5

3

3.0

3.5

4

4.0

4.0

5

5.0

5.0

The task is to find the Linear Regression Equation that models the relationship between Advertising Spend and Sales, and use it to predict sales if the advertising spend is 6.0 thousand.

Solution:

Step 1: Calculate the Mean of X and Y

  • Mean of X (Advertising Spend):Xˉ=51.0+2.0+3.0+4.0+5.0​=3.0
  • Mean of Y (Sales):Yˉ=52.0+2.5+3.5+4.0+5.0​=3.4

Step 2: Calculate the Slope (m) using the formula

The formula to calculate the slope m is:

m=∑(Xi​−Xˉ)2∑(Xi​−Xˉ)(Yi​−Yˉ)​

Now, let’s compute the required values:

X (Advertising)

Y (Sales)


(Xi​−Xˉ)



(Yi​−Yˉ)



(Xi​−Xˉ)(Yi​−Yˉ)



(Xi​−Xˉ)2


1.0

2.0

-2.0

-1.4

2.8

4.0

2.0

2.5

-1.0

-0.9

0.9

1.0

3.0

3.5

0.0

0.1

0.0

0.0

4.0

4.0

1.0

0.6

0.6

1.0

5.0

5.0

2.0

1.6

3.2

4.0

  • Sum of (Xi​−Xˉ)(Yi​−Yˉ): 2.8 + 0.9 + 0.0 + 0.6 + 3.2 = 7.5 
  • Sum of (Xi​−Xˉ)2: 4.0 + 1.0 + 0.0 + 1.0 + 4.0 = 10.0 

Now, calculate the slope m: m=10.07.5​=0.75

Step 3: Calculate the Y-Intercept (c)

The formula for the y-intercept c is:

 c=Yˉ−mXˉ

Substitute the known values:

c=3.4−(0.75)(3.0)=3.4−2.25=1.15 

Step 4: Write the Linear Regression Equation

The linear regression equation is: y=0.75x+1.15

Where:

  • y is the predicted sales (dependent variable).
  • x is the advertising spend (independent variable).

Step 5: Predict Sales for an Advertising Spend of 6.0 Thousand

To predict the sales when the advertising spend is 6.0 thousand, substitute x = 6.0 into the regression equation:

y=0.75(6.0)+1.15=4.5+1.15=5.65 

Thus, the predicted sales for an advertising spend of 6.0 thousand is 5.65 thousand.

Final Answer:

  • Linear Regression Equation: y = 0.75x + 1.15
  • Predicted Sales for Advertising Spend of 6.0 Thousand: 5.65 thousand


Example 2: The following data shows the number of hours studied and the corresponding marks obtained by a student:

Hours Studied (X)

Marks Obtained (Y)

1

20

2

35

3

50

4

65

5

80

Find the linear regression equation and predict the marks when a student studies for 6 hours.

Solution:

  1. Find the mean of X and Y:
  • Xˉ=51+2+3+4+5​=3
  • Yˉ=520+35+50+65+80​=50
  1. Calculate the slope (m) using the formula:

m=∑(Xi​−Xˉ)2∑(Xi​−Xˉ)(Yi​−Yˉ)​

Compute the values:

X

Y


(Xi​−Xˉ)



(Yi​−Yˉ)



(Xi​−Xˉ)(Yi​−Yˉ)



(Xi​−Xˉ)2


1

20

-2

-30

60

4

2

35

-1

-15

15

1

3

50

0

0

0

0

4

65

1

15

15

1

5

80

2

30

60

4

  • Sum of (Xi​−Xˉ)(Yi​−Yˉ)= 150
  • Sum of (Xi​−Xˉ)2 = 10

Therefore, m=10150​=15

  1. Calculate the intercept (c):

c=Yˉ−mXˉ

 =50−15×3=5

  1. Regression equation: y=15x+5 
  2. Predict marks for 6 hours of study: y=15×6+5=90+5=95 

Answer: The predicted marks for 6 hours of study is 95.


Example 3: The following data shows the amount spent on advertising and the corresponding sales:

Advertising Spend (X)

Sales (Y)

1

2

2

4

3

5

4

6

5

8

Find the linear regression equation and predict sales for an advertising spend of 6.

Solution:

  1. Calculate the means:
  • Xˉ=51+2+3+4+5​=3
  • Yˉ=52+4+5+6+8​=5
  1. Calculate the slope (m): m=∑(Xi​−Xˉ)2∑(Xi​−Xˉ)(Yi​−Yˉ)​

X

Y


(Xi​−Xˉ)



(Yi​−Yˉ)



(Xi​−Xˉ)(Yi​−Yˉ)



(Xi​−Xˉ)2


1

2

-2

-3

6

4

2

4

-1

-1

1

1

3

5

0

0

0

0

4

6

1

1

1

1

5

8

2

3

6

4

  • Sum of (Xi​−Xˉ)(Yi​−Yˉ)=14
  • Sum of (Xi​−Xˉ)2=10

Therefore, m=1014​=1.4

  1. Intercept (c): c=Yˉ−mXˉ =5−1.4×3=1.8
  2. Regression equation: y=1.4x+1.8 
  3. Predict sales for 6 units of advertising spend: y=1.4×6+1.8=8.4+1.8=10.2

Answer: Predicted sales for an advertising spend of 6 is 10.2.


Example 4: The following data shows the number of hours a person watches TV and their productivity at work:

Hours of TV (X)

Productivity (Y)

1

90

2

85

3

80

4

70

5

50

Find the linear regression equation and predict productivity when a person watches 6 hours of TV.

Solution:

  1. Calculate the means:
  • Xˉ=51+2+3+4+5​=3
  • Yˉ=590+85+80+70+50​=75
  1. Calculate the slope (m): m=∑(Xi​−Xˉ)2∑(Xi​−Xˉ)(Yi​−Yˉ)​

X

Y


(Xi​−Xˉ)



(Yi​−Yˉ)



(Xi​−Xˉ)(Yi​−Yˉ)



(Xi​−Xˉ)2


1

90

-2

15

-30

4

2

85

-1

10

-10

1

3

80

0

5

0

0

4

70

1

-5

-5

1

5

50

2

-25

-50

4

  • Sum of (Xi​−Xˉ)(Yi​−Yˉ)=−95
  • Sum of (Xi​−Xˉ)2=10

Therefore: m=10−95​=−9.5

  1. Intercept (c):

c=Yˉ−mXˉ

=75−(−9.5×3)=75+28.5=103.5

  1. Regression equation: y=–9.5x+103.5 
  2. Predict productivity for 6 hours of TV: y=−9.5×6+103.5=−57+103.5=46.5 

Answer: Predicted productivity for 6 hours of TV is 46.5.

6.0Practice Questions on Linear Regression 

Question 1: The data below shows the number of hours studied and the marks obtained by a student: Find the Linear Regression Equation (i.e., y = mx + c) and use it to predict the marks if a student studies for 6 hours.

Hours Studied (X)

Marks Obtained (Y)

1

30

2

40

3

50

4

60

5

70

Question 2: A company collects the following data on the amount spent on advertising and the sales generated. Find the Linear Regression Equation for predicting sales based on advertising spend, and predict the sales if the advertising spend is 6.

Advertising Spend (X)

Sales (Y)

2

6

3

8

5

12

7

16

8

20

Question 3: The following data shows the number of years of experience and the corresponding salaries. Find the Linear Regression Equation to predict salary based on years of experience. Then, predict the salary for someone with 6 years of experience.

Years of Experience (X)

Salary (Y) (in thousands)

1

30

2

35

3

40

4

45

5

50

Question 4: The table below shows the number of books sold by a bookstore in a week and the number of advertisements they ran. Find the Linear Regression Equation for predicting the number of books sold based on the number of advertisements run, and predict the number of books sold if 3 ads are run.

Ads Run (X)

Books Sold (Y)

1

2

2

3

4

6

5

8

6

9

Question 5: The data below shows the number of products produced by a factory and the number of workers employed. Find the Linear Regression Equation for predicting the number of products produced based on the number of workers employed. Predict the number of products produced when 25 workers are employed.

Workers Employed (X)

Products Produced (Y)

10

50

20

80

30

110

40

140

50

170

7.0Sample Question on Linear Regressions

1. How do you calculate the slope and intercept?

Ans: Use the formulas:

  • m=∑(Xi​−Xˉ)2∑(Xi​−Xˉ)(Yi​−Yˉ)​
  • c=Yˉ−mXˉ

Table of Contents


  • 1.0What Is Linear Regression?
  • 2.0Basic Linear Regression
  • 3.0Linear Regression Analysis
  • 4.0Multiple Linear Regression
  • 5.0Solved Example on Linear Regression 
  • 6.0Practice Questions on Linear Regression 
  • 7.0Sample Question on Linear Regressions

Frequently Asked Questions

The intercept cc is the value of y when x = 0, representing where the line crosses the y-axis.

Linear regression predicts the dependent variable y based on the independent variable(s) x.

It minimizes the sum of squared residuals to find the best-fitting regression line.

R-squared indicates the proportion of variance in yy explained by xx; closer to 1 means a better fit.

No, linear regression is for linear relationships. Non-linear data needs other models (e.g., polynomial regression).

Remove, transform, or use robust methods like Ridge or Lasso regression.

Multicollinearity occurs when independent variables are highly correlated, affecting regression results.

Residuals are the differences between observed and predicted values, showing model errors.

Join ALLEN!

(Session 2025 - 26)


Choose class
Choose your goal
Preferred Mode
Choose State
  • About
    • About us
    • Blog
    • News
    • MyExam EduBlogs
    • Privacy policy
    • Public notice
    • Careers
    • Dhoni Inspires NEET Aspirants
    • Dhoni Inspires JEE Aspirants
  • Help & Support
    • Refund policy
    • Transfer policy
    • Terms & Conditions
    • Contact us
  • Popular goals
    • NEET Coaching
    • JEE Coaching
    • 6th to 10th
  • Courses
    • Online Courses
    • Distance Learning
    • Online Test Series
    • International Olympiads Online Course
    • NEET Test Series
    • JEE Test Series
    • JEE Main Test Series
  • Centers
    • Kota
    • Bangalore
    • Indore
    • Delhi
    • More centres
  • Exam information
    • JEE Main
    • JEE Advanced
    • NEET UG
    • CBSE
    • NCERT Solutions
    • Olympiad
    • NEET 2025 Results
    • NEET 2025 Answer Key
    • NEET College Predictor
    • NEET 2025 Counselling

ALLEN Career Institute Pvt. Ltd. © All Rights Reserved.

ISO