Regression Analysis (AI)
Regression Analysis (AI)
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.
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
Weather Forecasting
Predicting temperature based on humidity, wind speed, and previous day’s temperature.
4|P age
Predicting electricity usage based on time of day, outside temperature, and number of
people in a building.
Y i = β 0 + β1 X i + ε i
If more than two variables are involved in the study Then model can be
extended as:
"Bell-shaped errors"
4 Normality
constant variance at all levels of X.
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.
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
Y =2000+300X1+800X2
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).
Prediction:
An employee with 4 years of experience and a Master's degree is predicted to earn $4800 per
month.