Simple linear regression is a statistical method used to model the relationship between two variables, lets assume independent var. X and a dependent var. Y
For example, predicting house prices
Simple linear regression is a statistical method used to model the relationship between two variables, lets assume independent var. X and a dependent var. Y
For example, predicting house prices
linear regression fits into a straight line observed data points
The line basically represents the prediction of var. X from var. Y
For example:
X = House size
Y = House price
The objective is to find out how house sizes changes with price
Eqn . for linear regression
\[ Y = \beta_0 + \beta_1 X + \epsilon \]
\(Y\) = dependent variable
\(X\) = independent variable
\(\beta_0\) = intercept
\(\beta_1\) = slope
\(\epsilon\) = error
The slope \(\beta_1\) tells us how \(Y\) changes with \(X\):
\[ \Delta Y = \beta_1 \Delta X \]
For example, if \(\beta_1 = 120\), then increasing house size by 100 sqft increases the price by:
\[ \Delta Y = 120 \times 100 = 12000 \]
## House_size House_price ## 1 800 150000 ## 2 1000 180000 ## 3 1200 200000 ## 4 1500 240000 ## 5 1800 280000 ## 6 2000 310000 ## 7 2200 330000 ## 8 2500 370000
This plots shows the linear regression trend between house price and size