0% found this document useful (0 votes)
5 views3 pages

Multiple Linear Regression Example

Uploaded by

poojithachougani
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)
5 views3 pages

Multiple Linear Regression Example

Uploaded by

poojithachougani
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

Multiple Linear Regression Example

Explain Multiple Linear Regression with suitable example


like price of house

Multiple Linear Regression is a statistical technique used to model the relationship between
one dependent variable and two or more independent variables. It extends simple linear
regression by allowing for multiple predictors, providing a more nuanced understanding of
the relationship between variables.

Key Concepts:
Dependent Variable (Y): The variable we are trying to predict or explain.

Independent Variables (X₁, X₂, ... Xₖ): The variables that are used to predict the
dependent variable.

The formula for multiple linear regression is:

Y = β0 + β1 X1 + β2 X2 + ... + βk Xk + ϵ
​ ​ ​ ​ ​ ​ ​

Where:

Y is the dependent variable (e.g., price of the house).


β0 is the intercept (constant term).

β1 , β2 , ..., βk are the coefficients (slopes) of the independent variables X1 , X2 , ..., Xk .


​ ​ ​ ​ ​ ​

ϵ is the error term (residuals).

Example: Predicting House Price


Let's consider a real-life example where we want to predict the price of a house based on
several factors like:

Size of the house (in square feet): X1 ​

Number of bedrooms: X2 ​

Age of the house: X3 ​

Distance to the city center (in kilometers): X4 ​

The dependent variable Y is the price of the house.

The multiple linear regression equation would look like this:

1/3
Price of House = β0 + β1 ⋅ Size + β2 ⋅ Bedrooms + β3 ⋅ Age + β4 ⋅ Distance + ϵ
​ ​ ​ ​ ​

Steps in the Model:

1. Data Collection: Gather data for the price of houses, including all the independent
variables (size, number of bedrooms, age, distance).

2. Model Fitting: Use a training dataset to find the best values for β0 , β1 , β2 , β3 , β4 that
​ ​ ​ ​ ​

minimize the error term ϵ.

3. Prediction: Once the model is trained, you can predict the house price by plugging in
values for the independent variables.

4. Evaluation: Assess the performance of the model using metrics like Mean Squared Error
(MSE), R-squared, etc.

Example Data:

Size (sq ft) Bedrooms Age (years) Distance (km) Price (in $1000)

2000 3 10 5 300

1500 2 15 8 250

2500 4 5 3 400

1800 3 8 6 280

2200 3 12 4 350

Model Training:

The model will use this data to determine the coefficients β0 , β1 , β2 , β3 , β4 . For example,
​ ​ ​ ​ ​

after training, the model might determine that:

Price of House = 50 + 0.1 ⋅ Size + 5 ⋅ Bedrooms − 1.2 ⋅ Age − 2.5 ⋅ Distance

Prediction:

For a house of size 1800 sq ft, with 3 bedrooms, 10 years old, and 5 km away from the city
center:

\text{Predicted Price} = 50 + 0.1 \cdot 1800 + 5 \cdot 3 - 1.2 \cdot 10 - 2.5 \cdot 5 = 50 + 180 +
15 - 12 - 12.5 = 220.5 \text{ (in $1000)}

So, the predicted price of the house is $220,500.

2/3
Summary:
Multiple Linear Regression allows you to model the relationship between multiple predictors
and a target variable. It is widely used for tasks like predicting house prices, sales, or any
other outcome that depends on several factors.

3/3

You might also like