# Using R Squared and Adjusted R Squared for Model Selection

When it comes to evaluating the quality of a regression model, R squared and adjusted R squared are two commonly used metrics. Both of these metrics provide a measure of how well the model fits the data, but they differ in how they handle the complexity of the model. In this article, we will explore the key differences between R squared and adjusted R squared, and discuss when each metric is appropriate to use.

## Table of Contents

- Introduction
- What is R squared?
- Limitations of R squared
- What is adjusted R squared?
- How is adjusted R squared calculated?
- Limitations of adjusted R squared
- When to use R squared
- When to use adjusted R squared
- How to interpret R squared and adjusted R squared
- Examples of using R squared and adjusted R squared
- Conclusion
- FAQs

## 1. Introduction

Regression analysis is a commonly used statistical technique for modeling the relationship between a dependent variable and one or more independent variables. The goal of regression analysis is to find the best-fitting line or curve that describes the relationship between the variables. R squared and adjusted R squared are two metrics used to evaluate the goodness of fit of a regression model.

## 2. What is R squared?

R squared, also known as the coefficient of determination, is a statistical measure that represents the proportion of the variance in the dependent variable that is explained by the independent variable(s) in the model. In other words, R squared indicates how much of the variation in the dependent variable can be explained by the independent variable(s).

R squared values range from 0 to 1, with a higher value indicating a better fit. A value of 0 indicates that the model explains none of the variation in the dependent variable, while a value of 1 indicates that the model explains all of the variation.

## 3. Limitations of R squared

While R squared is a useful metric for evaluating the goodness of fit of a model, it has some limitations. One limitation is that it can be misleading when the model includes too many independent variables. In this case, R squared may increase even if the additional variables do not significantly improve the model’s predictive power. This is known as overfitting, and it can lead to a model that performs well on the training data but poorly on new data.

## 4. What is adjusted R squared?

Adjusted R squared is a modified version of R squared that takes into account the number of independent variables in the model. As the number of independent variables increases, R squared will always increase, even if the additional variables do not significantly improve the model’s predictive power. Adjusted R squared penalizes the inclusion of irrelevant variables by adjusting for the number of independent variables in the model.

## 5. How is adjusted R squared calculated?

Adjusted R squared is calculated using the following formula:

Adjusted R squared = 1 – [(1 – R squared) * (n – 1) / (n – k – 1)]

where n is the sample size and k is the number of independent variables in the model.

## 6. Limitations of adjusted R squared

While adjusted R squared addresses some of the limitations of R squared, it also has some limitations of its own. One limitation is that it can be too conservative, penalizing the inclusion of relevant variables that may improve the model’s predictive power. Another limitation is that it assumes that all independent variables have equal effects on the dependent variable, which may not always be the case.

## 7. When to use R squared

R squared is useful when the model has a small number of independent variables and there is no concern about over fitting. It is also appropriate when the goal is simply to explain as much of the variation in the dependent variable as possible, without concern for the number of independent variables in the model.

## 8. When to use adjusted R squared

Adjusted R squared is appropriate when the model has a large number of independent variables or when there is concern about overfitting. It is also useful when comparing models with different numbers of independent variables, as it takes into account the complexity of the model.

## 9. How to interpret R squared and adjusted R squared

Both R squared and adjusted R squared provide a measure of how well the model fits the data, but they differ in how they handle the complexity of the model. A high R squared or adjusted R squared value indicates a good fit, but it does not necessarily mean that the model is the best possible model for the data.

It is important to consider other factors when evaluating a regression model, such as the statistical significance of the independent variables, the presence of outliers, and the distribution of the residuals.

## 10. Examples of using R squared and adjusted R squared

Suppose we are trying to predict the price of a house based on its size, number of bedrooms, and neighborhood. We fit a regression model using these three variables and obtain an R squared value of 0.75. This indicates that 75% of the variation in house prices can be explained by the size, number of bedrooms, and neighborhood.

However, suppose we add a fourth independent variable, such as the year the house was built. The R squared value increases to 0.80, suggesting that the additional variable improves the model’s predictive power. However, if we calculate the adjusted R squared value, we may find that the increase in R squared is not significant given the added complexity of the model.

## Conclusion

In conclusion, R squared and adjusted R squared are two commonly used metrics for evaluating the goodness of fit of a regression model.