0% found this document useful (0 votes)
2 views9 pages

Regression Analysis (AI)

The document provides an overview of regression analysis, explaining its purpose in predicting changes in a dependent variable based on independent variables. It covers different types of regression models, assumptions, and real-life examples such as predicting GDP growth and employee salaries. Additionally, it includes a practical example of calculating predicted salaries based on years of experience and education level.

Uploaded by

alimeer7888
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views9 pages

Regression Analysis (AI)

The document provides an overview of regression analysis, explaining its purpose in predicting changes in a dependent variable based on independent variables. It covers different types of regression models, assumptions, and real-life examples such as predicting GDP growth and employee salaries. Additionally, it includes a practical example of calculating predicted salaries based on years of experience and education level.

Uploaded by

alimeer7888
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

1|P age

SUPERIOR UNIVERSITY
SARGODHA CAMPUS

Regression Analysis
&
Examples

5TH TOPIC
2|P age

The Correlation tells how much strong the linear relationship among the
two variables is. But these can’t tell what changes would occur in variable
when unit change is made in other variable.
Then we move to
Regression analysis is used to interpret the amount of change in one
variable when changes are made in other variable. Regression allows
researchers to predict or explain the variation in one variable based on
another variable.

Regression is a statistical method used to examine the relationship


between a dependent (target) variable and one or more independent
(predictor) variables. It helps in predicting the outcome of the dependent
variable based on the values of the independent variables.
A study of measuring the relationship between associated variables, wherein one
variable is dependent on another independent variable, called as Regression. It is
developed by Sir Francis Galton in 1877 to measure the relationship of height
between parents and their children. Regression analysis is a statistical tool to study
the nature and extent of functional relationship between two or more variables
and to estimate (or predict) the unknown values of dependent variable from the
known values of independent variable.

The variable that researchers are trying to explain or predict is called the
response variable. It is also sometimes called the dependent variable
because it depends on another variable.
The variable that is used to explain or predict the response variable is
called the explanatory variable. It is also sometimes called the
independent variable because it is independent of the other variable.
3|P age

In regression, the order of the variables is very important.


 The explanatory variable (or the independent variable) always
belongs on the x-axis.
 The response variable (or the dependent variable) always belongs on
the y-axis.

Regression in Different dataset or for


1. Generalized Linear Models (GLM)
o Extends linear regression to non-normal distributions (e.g., logistic, Poisson).
2. Bayesian Regression
o Uses probability distributions for coefficients instead of fixed values.
3. Nonlinear Regression
o For complex relationships (e.g., exponential, logarithmic).
4. Time Series Regression (ARIMA, SARIMA)
o For forecasting with temporal dependencies.
5. Machine Learning Extensions
o XGBoost, LightGBM, Neural Networks for regression tasks.

Real-Life Example of Regression

Predicting GDP Growth

 Based on factors like inflation rate, unemployment rate, and exports.

Customer Lifetime Value Prediction

 Based on customer age, purchase history, and frequency of buying.

Weather Forecasting

 Predicting temperature based on humidity, wind speed, and previous day’s temperature.
4|P age

Energy Consumption Prediction

 Predicting electricity usage based on time of day, outside temperature, and number of
people in a building.

Predicting Traffic Accidents

 Based on time of day, weather conditions, and traffic volume.

The model for linear regression is given by:


 If only one independent variables are involved in the study also called simple
linear regression model

Y i = β 0 + β1 X i + ε i

 If more than two variables are involved in the study Then model can be
extended as:

Yi = β0 + β1X1i + β2X2i + ...... + βnXni + εi


This model is called as Multiple Linear Regression model.
5|P age

No. Assumption Easy keyword

1 Linearity "Straight line"

2 Independence Error "No pattern in errors"

3 Homoscedasticity "Equal spread of errors"

"Bell-shaped errors"
4 Normality
constant variance at all levels of X.

5 No Multicollinearity "X’s not duplicating each other"

6 No measurement error "Accurate X values"

Violation
 Non-linearity → Curved pattern in scatterplot of residuals.
 Autocorrelation → Residuals show a pattern over time (e.g., upward trend).
 Heteroscedasticity → "Funnel shape" (errors widen or narrow) in residual plot.
 Non-normality → Residual histogram not bell-shaped.
 Multicollinearity → High Variance Inflation Factor (VIF > 5 or 10).
 Error in X → If X has large errors, the regression coefficients become biased.

Feature Regression Classification


Goal Predict a continuous Predict a category or class label
numerical value
Output Type Real numbers (e.g., 3.75, 120.6) Discrete labels (e.g., "Yes"/"No",
0/1)
Examples Predicting house prices, Email spam detection, disease
temperatures diagnosis
Algorithms Used Linear regression, Lasso, SVR, Logistic regression, decision
etc. trees, SVM
Evaluation MSE, RMSE, R² score Accuracy, precision, recall, F1-
Metrics score
6|P age
7|P age
8|P age

A company wants to predict employee monthly salary (Y) based on:

 Years of Experience (X₁)


 Education Level (X₂)

Employee Y X₁ X₂
1 3000 2 1
2 4500 5 2
3 5200 7 2
4 2800 1 1
5 7000 10 3
6 4800 6 2

Y=β0+β1(Experience)+β2(Education Level)+ϵ

Intercept β0=2000

Experience coefficient β1=300

Education coefficient β2=800

Y =2000+300X1+800X2

Predict salary for an employee:

 4 years experience
 Master's degree (Level = 2)

Substituting:

Y = 2000+300(4) + 800(2)

Y=2000+1200+1600

Y=4800

 Intercept (2000):
An employee with 0 experience and a Bachelor's degree would have a base salary of $2000
(theoretical, probably not practical).

 Experience coefficient (+300):


For each additional year of experience, the monthly salary increases by $300, assuming
education level is fixed.
9|P age

 Education Level coefficient (+800):


For each higher level of education (e.g., Bachelor → Master, or Master → PhD), salary
increases by $800, assuming experience is fixed.

 Prediction:
An employee with 4 years of experience and a Master's degree is predicted to earn $4800 per
month.

You might also like