2024-02-04

Simple Linear Regression

Simple linear regression is a common statistical method used evaluate the relationship between two variables. This method is most effectively used where there is a linear relationship between the independent variable \(X\) and the dependent variable \(Y\).

The basic form of this type of linear equation is as follows:

\[ Y = \beta_0 + \beta_1 X + \epsilon \]

Linear Equation Definition

\[ Y = \beta_0 + \beta_1 X + \epsilon \]

  • \(Y\) is the dependent variable you are trying to predict or explain.
  • \(X\) is the independent variable you are using to make predictions.
  • \(\beta_0\) is the y-intercept, representing the expected value of \(Y\) when \(X\) is 0.
  • \(\beta_1\) is the slope of the line, representing the change in \(Y\) for a one-unit change in \(X\).
  • \(\epsilon\) is the error term, accounting for the variability in \(Y\) that cannot be explained by the linear relationship with \(X\).

Slide with R Output

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

Slide with Plot