Simple linear regression is Simple linear regression is a powerful tool for predicting a dependent variable (Y) based on an independent variable (X).
The simple linear regression model can be represented as:
\(\text{Y}\) = \(\beta_0\) + \(\beta_1{X}\) + \(\varepsilon\)
Where:
\(Y\) is the predicted value of the dependent variable.
\(\beta_0\) is the intercept of the regression line.
\(\beta_1\) is the slope of the regression line.
\(X\) is the independent variable.
\(\varepsilon\) is the error term.
Example: Depicting the correlation between the Income (average) and Happiness for 111 countries. Dataset can be found here –> Kaggle
## Loading required package: ggplot2
## ## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2': ## ## last_plot
## The following object is masked from 'package:stats': ## ## filter
## The following object is masked from 'package:graphics': ## ## layout