Regression

 

What is Regression?

Regression is a statistical method used to examine the relationship between a dependent variable and one or more independent variables.

  • It helps us understand how the typical value of the dependent variable changes when any one of the independent variables is varied.

  • It is often used for prediction and forecasting.


๐Ÿ”ข Types of Regression

TypeDescription
Linear RegressionModels a straight-line relationship
Multiple Linear RegressionUses more than one independent variable
Polynomial RegressionFits a curve instead of a straight line
Logistic RegressionUsed when the dependent variable is categorical
Ridge/Lasso RegressionUsed when multicollinearity exists


๐Ÿ“Š 1. Simple Linear Regression

๐Ÿ” Goal:

Predict a continuous dependent variable using one independent variable.

๐Ÿ”ข Equation:

y=a+bxy = a + bx

Where:

  • yy = dependent variable (output)

  • xx = independent variable (input)

  • aa = intercept (value of yy when x=0x = 0)

  • bb = slope (change in yy for a one-unit change in xx)


Example: Predict Student Marks from Study Hours

Hours Studied (x)Marks Obtained (y)
250
460
665
870
1085
You want to predict marks based on hours studied.

✅ Regression Output (e.g., via Excel or Python):

After applying regression, you might get:

y = 45 + 4x

So, if a student studies 7 hours:

y = 45 + 4×7 = 73

๐ŸŽฏ Prediction: The student will score 73 marks.


๐Ÿ“Š 2. Multiple Linear Regression

Used when more than one independent variable is used to predict a dependent variable.

๐Ÿ”ข Equation:

y=a+b1x1+b2x2++bnxny = a + b_1x_1 + b_2x_2 + \dots + b_nx_n

 Example:

Predicting house price using:

  • x1x_1: size of house (sq ft)

  • x2x_2: number of bedrooms

Price=50000+300×(sq ft)+10000×(bedrooms)\text{Price} = 50000 + 300×(\text{sq ft}) + 10000×(\text{bedrooms})

๐Ÿ“‰ 3.Logistic Regression (for classification)

Used when the output is categorical, like Yes/No, 0/1, True/False.

Example:

Predict whether a student passes (1) or fails (0) based on study hours.

Output: Probability → if above 0.5, we classify as "pass".

Comments

Popular posts from this blog

Statistical Methods Lab ( R Language) PCCBL308 Semester 3 KTU BTech CB 2024 Scheme - Dr Binu V P

Statistical Methods Lab ( R Language) PCCBL308 Course Details and Syllabus

t -test