2024-04-08

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)

Mathematical Formulation (1)

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

Mathematical Formulation (2)

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

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

ggplot Plot

## `geom_smooth()` using formula = 'y ~ x'

Residual Plot

3D Plot