2024-04-08

Slide 1: Linear Regression

Introduction to Linear Regression

  • Sabina
  • Date: April 7, 2024

Slide 2: Overview of Linear Regression

  • Simple linear regression is a statistical method to model the relationship between two variables.
  • It assumes a linear relationship between the predictor variable (X) and the response variable (Y)

Slide 3: Mathematical Formulation (1)

  • Equation of simple linear regression: \[y = \beta_0 + \beta_1 x + \epsilon\]

Slide 4: Mathematical Formulation (2)

  • Equation of multiple linear regression: \[y = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + ... + \beta_n x_n + \epsilon\]

Slide 5: Assumptions of Linear Regression

  • Linearity: The relationship between X and Y is linear.
  • Independence: Observations are independent of each other.
  • Homoscedasticity: Constant variance of residuals.
  • Normality: Residuals follow a normal distribution

Slide 6: ggplot Plot (1)

  • Scatter plot with regression line
## `geom_smooth()` using formula = 'y ~ x'

##Slide 7:Residual Plot -Residual Plot

## 
## 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

##Slide 8:3D Plot -3D Plot