Illustrated · 1 min

###Residuals and a goodness-of-fit

Residuals are essentially the difference between the observed values and the line of best fit. In other words, they tell us how well the data fits the line of best fit or how good of a fit the data is.

Residual = observed value - expected value

The larger the residuals, the lower the goodness-of-fit. Similarly, the smaller the residuals, the better the goodness-of-fit.

##Residual Plots

Simple residual plot with residuals, observed values, and the line of best fit labeled.

Image source: by Trisha

Residual plots essentially show each of the observed values and the line of best fit, with the residuals being the difference between the two. The expected values are on the line of best fit.

Read · 2 min

Residuals and Goodness-of-Fit

We have already learned what linear regressions are and that they can tell us the relationship between two variables, much similar to correlation coefficients. Residuals can help us determine the strength of a relation between a datapoint and the line of best fit.

A residual is the distance between a datapoint and the line of best fit.

In statistics, residuals are the differences between what we expect to see in our data and what we actually observe. For example, if we make predictions based on a model, the residual tells us how far off our predictions are from actual results.

Positive residuals are above the line of best fit, while negative residuals are below it, and residuals of zero are when the point is on the line.

The formula for a residual is:

Residual = observed value - predicted value\text{Residual = observed value - predicted value}

An important point to know is that the sum and mean of the residuals equals 00.

####Residuals and Goodness-of-Fit

When we try to see how well our model explains the data, we perform a goodness of fit test. This test helps us understand if our model fits the categorical data we collected. These tests check if the observed counts (the data we collected) match what we expected. One common test is the chi square test.

We can look at the value of a residual to determine the goodness-of-fit. Essentially, we want smaller residual values, as that means the linear regression is a good fit as the residuals are close to the line of best fit. If the residuals are very large, the datapoints aren't close to the line, meaning the model is not as strong.

Overall, residuals can help us interpret linear regression models.

####Other Important Terms

  • The expected count is what we would expect to see if the null hypothesis were true. We calculate this based on the total number of observations and the proportions we expect in each category.
  • To understand how to use the chi square test, we also need to know about degrees of freedom. This tells us how many categories we have minus one. It helps us understand how many different ways our data can vary.
  • Another test we can use is the Kolmogorov Smirnov test. This test helps us compare the distribution of our observed data to a theoretical distribution. It's useful for checking if our data follows a certain pattern.

Video

(Video) Simple Linear Regressions: Checking Assumptions with Residual Plots

by jbstatistics

In this video by jbstatistics, you will learn about how to use a residual plot to understand linear regression.

Type a concept, like “slope” or “photosynthesis”.

↑ ↓ to choose · Enter to openSearch explanations and problems