Skip to main content

Linear Regression – Straight Line Problems

 

Linear Regression – Straight Line Problems

Linear regression is used to find the best-fitting straight line that shows the relationship between two variables.

The general equation of a straight line:

Y=a+bXY = a + bX

Where:

  • a = Intercept

  • b = Slope (regression coefficient)

  • Y = Dependent variable

  • X = Independent variable


1️⃣ Example 1: Find Regression Equation (Y on X)

🔹 Question

Find the regression equation of Y on X for the following data:

X12345
Y24545

🔹 Step 1: Formula for Y on X

Y=a+bXY = a + bX b=nXYXYnX2(X)2b = \frac{n\sum XY - \sum X \sum Y}{n\sum X^2 - (\sum X)^2} a=YˉbXˉa = \bar{Y} - b\bar{X}

🔹 Step 2: Prepare Table

XYXY
1212
2448
35915
441616
552525

Now compute totals:

X=15\sum X = 15 Y=20\sum Y = 20 X2=55\sum X^2 = 55 XY=66\sum XY = 66 n=5n = 5

🔹 Step 3: Calculate b

b=5(66)(15)(20)5(55)(15)2b = \frac{5(66) - (15)(20)}{5(55) - (15)^2} =330300275225= \frac{330 - 300}{275 - 225} =3050= \frac{30}{50} b=0.6b = 0.6

🔹 Step 4: Calculate a

Xˉ=15/5=3\bar{X} = 15/5 = 3 Yˉ=20/5=4\bar{Y} = 20/5 = 4 a=4(0.6)(3)a = 4 - (0.6)(3) a=41.8a = 4 - 1.8 a=2.2a = 2.2

✅ Regression Equation

Y=2.2+0.6XY = 2.2 + 0.6X

🔹 Step 5: Prediction Example

If X = 6, then:

Y=2.2+0.6(6)Y = 2.2 + 0.6(6) Y=2.2+3.6Y = 2.2 + 3.6 Y=5.8Y = 5.8

2️⃣ Example 2: Find Both Regression Lines

🔹 Given:

X10203040
Y15253545

Observation

Notice:

Y=X+5Y = X + 5

So:

Regression of Y on X:

Y=X+5Y = X + 5

Regression of X on Y:

X=Y5X = Y - 5

📌 Important Points for Exams

  1. There are two regression lines:

    • Y on X

    • X on Y

  2. Both lines pass through:

(Xˉ,Yˉ)(\bar{X}, \bar{Y})
  1. If correlation (r) = ±1 → both regression lines coincide.

  2. Sign of regression coefficient is same as correlation coefficient.

Comments

Popular posts from this blog

APSET 2026 – Artificial Intelligence (AI) MCQs (50 Questions)

  APSET 2026 – Artificial Intelligence (AI) MCQs (50 Questions) (Computer Science & Applications – As per APSET / UGC NET Syllabus) 2. The father of AI is: A) Alan Turing B) John McCarthy C) Marvin Minsky D) Herbert Simon 👉  Answer:  B Below are 50 important MCQs for APSET 2026 preparation. 🔹 PART A: Basics of Artificial Intelligence 1. Artificial Intelligence was formally introduced in: A) 1943 B) 1956 C) 1965 D) 1972 👉 Answer: B 2. The father of AI is: A) Alan Turing B) John McCarthy C) Marvin Minsky D) Herbert Simon 👉 Answer: B 3. The Turing Test was proposed by: A) John McCarthy B) Alan Turing C) Newell D) Simon 👉 Answer: B 4. AI primarily deals with: A) Numerical computation B) Intelligent agents C) Hardware design D) Databases 👉 Answer: B 5. Rational agent acts to: A) Maximize performance measure B) Minimize input C) Reduce memory D) Increase speed 👉 Answer: A 🔹 PART B: Search Techniques 6. Breadth First Search...

Central Bank of India Recruitment 2026 – 275 Specialist Officer (SO) Posts

Central Bank of India Recruitment 2026 – 275 Specialist Officer (SO) Posts The Central Bank of India has officially invited applications for 275 Specialist Officer (SO) positions across various technical and risk-related streams. Online applications began recently and interested candidates can apply directly through the official portal. 📅 Key Dates 🟢 Application Start: 28 February 2026 ⏰ Last Date to Apply: 23 March 2026 🖥️ Online Exam: April 2026 (Tentative) 🎤 Interview: April 2026 (Tentative) 📌 Vacancy & Roles There are 275 vacancies in the Specialist Officer category, covering roles such as: IT Officer Software Developer (Java / .NET) Mobile Application Developer Database Administrator Cyber Security & Information Security Specialist Data Scientist / Data Engineer Cloud Manager Risk Manager Taxation / CA Specialist DevSecOps and more technical/risk disciplines 📋 Eligibility (General Overview) Educational Qualification: Relevant full-time degree like B.E./B....

Reserve Bank of India RBI Assistant Recruitment 2026 - Apply Online for 650 Posts

Reserve Bank of India RBI Assistant Recruitment 2026 - Apply Online for 650 Posts 🏦 Reserve Bank of India (RBI) Assistant Recruitment 2026 – 650 Posts The RBI Assistant Recruitment 2026 notification has been released for 650 Assistant vacancies across RBI offices in India. Eligible graduates can apply online through the official RBI website.  📋 Recruitment Overview Organization: Reserve Bank of India (RBI) Post Name: Assistant Total Vacancies: 650 Application Mode: Online Notification Release Date: 16 February 2026 Last Date to Apply: 8 March 2026 Job Location: Across India Official Website: rbi.org.in  🎓 Educational Qualification Candidates must have: Bachelor’s Degree in any discipline from a recognized university Minimum 50% marks (pass marks for SC/ST/PwBD candidates) Knowledge of word processing on computer Proficiency in the local language of the state/region applied for  🎂 Age Limit (as on 1 Feb 2026) Minimum Age: 20 years Maximum Age: 28 years Age ...