Unit 2:
Linear Regression
Objectives
▪ How to use regression analysis to predict the value of a dependent
variable based on a value of an independent variable
▪ To understand the meaning of the regression coefficients b0 and b1
▪ To evaluate the assumptions of regression analysis and know what to
do if the assumptions are violated
▪ To make inferences about the slope and correlation coefficient
Use Cases
• Real Estate: Residential home prices as a function of the homes living
area
• Demand Forecasting: Business and Governments can use linear
regression models
• Medical: A linear regression model can be used to analyse the effect
of a proposed radiation treatment on reducing tumour size
Correlation vs. Regression
▪ A scatter plot can be used to show the relationship
between two variables
▪ Correlation analysis is used to measure the strength of the
association (linear relationship) between two variables
▪ Correlation is only concerned with strength of the relationship
▪ No causal effect is implied with correlation
Regression Models
Types of Relationships
Introduction to Regression Analysis
▪ Regression analysis is used to:
▪ Predict the value of a dependent variable based on the value of at least one
independent variable
▪ Explain the impact of changes in an independent variable on the dependent
variable
▪ Dependent variable: the variable we wish to
predict or explain
▪ Independent variable: the variable used to
predict or explain the dependent variable
Simple Linear Regression Model
• Only one independent variable, X
• Relationship between X and Y is described by a linear function
• Changes in Y are assumed to be related to changes in X
Types of Relationships
Simple Linear Regression
(Only one independent variable).
Application of LR-Simple LR
Dependent and Independent Variable
Profit Estimation of a Company(Multiple
independent variables)
Simple Linear Regression
Simple Linear Regression Model
Simple Linear Regression Prediction Equation
y=c+mx
The Least Squares Method
b0 and b1 are obtained by finding the values that minimize the sum of
the squared differences between Y and Y ^
min (Yi −Ŷi ) = min (Yi − (b0 + b1Xi ))
2 2
Example-Linear Regression
Linear Regression