Simple linear Regression

Simple linear regression is used to estimate the relationship between two quantitative variables (Numeric). You can use simple linear regression when you want to know:

  1. How strong the relationship is between two variables (e.g., the relationship between rainfall and soil erosion)
  2. The value of the dependent variable at a certain value of the independent variable (e.g., the amount of soil erosion at a certain level of rainfall).

Example:

You are a social researcher interested in the relationship between income and happienies. You survey 500 people whoose incomes range from 15K to 75K and ask them to rank thier happiness on a scale from 1 to 10.

Your independent variable (income) and dependent variable (happiness) are both quantitative, so you can do a regression analysis to see if there is a linear relationship between them. (Linearity)

Formula:

The formula for aa simple linear regression is:

                                                         *Y* = B0 + B1X + ε 

Y : is the predicted value of the dependent variable (Y) for any given value of the independent variable (x).

B0 : is the intercept, the predicted value of Y when X ****is 0.

B1 : is the regression coefficient - how much we expect Y ****to change as X increase.

X : is the independent variable ( the variable we expect is influencing Y).

E : is the error of the estimate, or how much variation there is in our estimate of the regression coefficient.

NOTE : Simple linear regression consider the data you have is One To One thats mean the dataset be just one independent variable (feature) and one dependent variable (target).