Introduction

  • In this Presentation we will explore the different concepts of Simple linear regression.
  • we will also provide examples of Simple linear regression to plots and graphs.
  • The goal of this presentation is to get a general understanding of Simple linear regression.

What is Linear Regression

  • Simple Linear Regression is a analysis that is used predict the value of a variable based on the value of another variable.
  • Simple Linear Regression can be used to help identify relationships and predict values for different data.

Simple Linear Regression Formula

  • Formula:
    \[ Y = \beta_0 + \beta_1 X + \epsilon \] where:
    • \(Y\): Dependent Variable
    • \(X\): Independent Variable
    • \(\beta_0\): Intercept
    • \(\beta_1\): Slope

Sum of Squared Errors

  • This is the Sum of Squared Errors, it is a key metric in regression analysis so that you can measure how well your mode fits your data. \[ {SSE} = \sum_{i=1}^n (y_i - \hat{y}_i)^2 \]
    • \(y_i\): actual values
    • \(\hat{y}_i\): predicted values

Scatter Plot with Regression Line

the residual plot

The 3D scatter plot

  • This 3d scatter plot shows the relationship between the MPG weight and predicted MPG.

R Code for Scatter Plot with Regression Line

library(ggplot2)

ggplot(mtcars, aes(x = wt, y = mpg)) + 
  geom_point() + 
  geom_smooth(formula = y ~ x, method = "lm", se = FALSE, color = "blue") + 
  labs(
    title = "This Linear Regression model shows the Relationship between Car Weight and MPG", 
    x = "Car Weight (1000 lbs)", 
    y = "Miles per Gallon"
  )

Thank you slide

Thank you for going through my presentation.