What is Simple Linear Regression?

Simple linear regression is used to study the statistical relationship between two quantitative variables.

  • X is called the predictor variable.
  • Y is called the response variable.
  • It is called simple linear regression because it uses only one predictor variable.
  • The relationship between X and Y is studied using a linear model.

The Simple Linear Regression Model

The simple linear regression model is:

\[ y = \beta_0 + \beta_1 x + \epsilon \]

Where:

  • \(y\) = response variable
  • \(x\) = predictor variable
  • \(\beta_0\) = intercept
  • \(\beta_1\) = slope
  • \(\epsilon\) = random error

The Estimated Regression Line

The estimated regression line is:

\[ \hat{y} = b_0 + b_1 x \]

Where:

  • \(\hat{y}\) = predicted value of the response
  • \(b_0\) = estimated intercept
  • \(b_1\) = estimated slope
  • \(x\) = value of the predictor variable

Example: Exercise Time and Calories Burned

For this example, we will study the relationship between exercise time and calories burned.

  • \(x\) = exercise time in minutes
  • \(y\) = calories burned
  • We want to see whether more exercise time is associated with more calories burned.

These data are made up for this example.

Exercise Time and Calories Burned

Exercise Time and Calories Burned Trend

Exercise Time and Calories Burned

R Code

model = lm(calories_burned ~ exercise_time, data = exercise_data)
model
## 
## Call:
## lm(formula = calories_burned ~ exercise_time, data = exercise_data)
## 
## Coefficients:
##   (Intercept)  exercise_time  
##        19.606          5.012

Interpretation

The regression model shows a positive relationship between exercise time and calories burned.

  • The estimated slope is 5.012.
  • For each additional minute of exercise, the model predicts about 5 more calories burned.
  • In this example, longer exercise time is associated with more calories burned.

These were the results obtained based on the data we created for this example.

References

Penn State Department of Statistics. (n.d.). Simple linear regression. STAT 501: Regression Methods.

Wickham, H., Navarro, D., & Pedersen, T. L. (n.d.). ggplot2 reference. ggplot2.

Plotly. (n.d.). Scatter and line plots in R. Plotly R.