We use math to guess what happens next.
We use math to guess what happens next.
Math helps us make guesses about the world.
Think of it as a score for a guess. A score of 1 means the guess is perfect. It matches the real facts exactly. A score of 0 means the guess does not help at all. Most scores fall between 0 and 1. You can even write the score as a percentage. For example, a score of 0.7 means the model explains 70 percent of the changes in the data.
Sometimes, the score can even be less than zero. This happens if the model is a very poor fit. It might happen if a wrong model was chosen. Adding more facts to a model usually makes the R squared score go up. But this does not always mean the model is better. It might just be a lucky guess. 
Imagine you are trying to guess how much a car costs based on its gas mileage. You might make a math model to help you predict the price. But how do you know if your guess is actually good?
To understand how it works, think about the differences in your data. In math, we call these differences variation. Some of that variation comes from the things we are studying. Other parts of the variation come from things we cannot see or explain. R squared looks at the total variation and compares it to the variation the model explains.
There are different ways to calculate this score depending on the math used. In simple linear regression, R squared is just the square of the correlation coefficient. This is a number that shows how two things are related. 
It is important to be careful when using R squared to judge a model. One tricky thing is that adding more information almost always makes the score go up. You could add silly things like the height of an engineer to a car model. The R squared score would likely increase just by chance.
Finally, always remember a very important rule in statistics. Just because two things have a high R squared score does not mean one causes the other. This is often called the difference between correlation and causation.
In statistics, the coefficient of determination is a vital tool for evaluating mathematical models. It is often written as $R^2$ or $r^2$ and is pronounced "R squared." This statistic measures the proportion of variation in a dependent variable that a model can predict using independent variables.
To understand the mechanism, we must look at how variation is divided. Every dataset has a total amount of variation, which is the total sum of squares. When we create a model, we calculate the residual sum of squares, which represents the errors or the parts the model missed.
There are different types of $R^2$ depending on the complexity of the model. In simple linear regression, which uses one explanatory variable and an intercept, $R^2$ is the square of the sample correlation coefficient ($r$).
Historically and mathematically, the value of $R^2$ usually falls between 0 and 1. An $R^2$ of 0.70 suggests that 70 percent of the variance is explained by the model. The remaining 30 percent is attributed to unknown variables or inherent variability. 
One significant aspect of $R^2$ is its relationship to other error measures. Unlike Mean Absolute Error (MAE) or Root Mean Square Error (RMSE), $R^2$ can be expressed as a percentage. This makes it more intuitively informative for many researchers.
To solve this inflation problem, statisticians use the adjusted $R^2$. This version of the statistic penalizes the score as extra, unnecessary variables are added. This allows for a more meaningful comparison between models with different numbers of independent variables.
Finally, it is crucial to remember that $R^2$ does not prove causation. A high correlation between two variables does not mean one causes the other.
🖼️ Images & Media (6)
More to explore
✨ What else?
Related topics you might enjoy
🪜 Step back
Simpler topics to build understanding
What is Nepedia?
A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.