Skip to main content

Introduction to Simple Linear Regression and Least Squares

Learn the fundamentals of simple linear regression, including the linear model, intercept, slope, residuals, and the least squares estimate for finding the best-fit line. Understand how R-squared measures the model's explanatory power.

Save this reading to your study set

Sign up free

In statistics, we often want to understand how one variable influences another. For instance, does the amount of time spent studying predict an exam score? Does exam anxiety affect performance? To answer these questions, we use a mathematical framework known as Simple Linear Regression. This method allows us to model the relationship between an independent variable (xx) and a dependent variable (yy) using a straight line, helping us make predictions and quantify the strength of the connection.

The Linear Model: Intercept and Slope

A straight line can be described by two fundamental parameters: the intercept and the slope. In a perfect world, we would know the "true" relationship between our variables, but in reality, we only have sample data.

The model is expressed by the equation: y=β0+β1x+Errory = \beta_0 + \beta_1x + \text{Error} where:

  • β0\beta_0 is the true intercept. This is the value of yy when xx is zero—essentially, where the line hits the vertical axis.
  • β1\beta_1 is the true slope. This represents the rate of change: how much yy is expected to change for every one-unit increase in xx.

Because real-world data is messy, we cannot observe β0\beta_0 and β1\beta_1 directly. Instead, we use our sample data to calculate "estimates" (denoted as b0b_0 and b1b_1) that serve as our best guesses for these true values.

Modeling the "Misses": Residuals

No matter how good our line looks, it will rarely pass through every single data point perfectly. The vertical distance between an actual observed data point (yiy_i) and the value predicted by our regression line is called a residual.

Keep reading for free.

Create an account to finish this reading and make it part of your study routine.

Continue reading free

Already have an account? Log in

Updated

Study it your way.

Import this reading into your study set to get started with another study mode.

Make it your own.

Keep this reading in a new study set, or add it to one you already use.