*62*

**R-squared**, often written R^{2},Â is the proportion of the variance in the response variable that can be explained by the predictor variables in a linear regression model.

The value for R-squared can range from 0 to 1. A value of 0 indicates that the response variable cannot be explained by the predictor variable at all while a value of 1 indicates that the response variable can be perfectly explained without error by the predictor variables.

The **adjusted R-squared** is a modified version of R-squared that adjusts for the number of predictors in a regression model. It is calculated as:

**Adjusted R ^{2} = 1 â€“ [(1-R^{2})*(n-1)/(n-k-1)]**

where:

**R**: The R^{2}^{2}of the model**n**: The number of observations**k**: The number of predictor variables

Because R^{2} always increases as you add more predictors to a model, adjusted R^{2} can serve as a metric that tells you how useful a model is,Â *adjusted for the number of predictors in a model*.

This tutorial provides a step-by-step example of how to calculate adjusted R^{2}Â for a regression model in R.

**Step 1: Create the Data**

For this example, weâ€™ll create a dataset that contains the following variables for 12 different students:

- Exam Score
- Hours Spent Studying
- Current Grade

**Step 2: Fit the Regression Model**

Next, weâ€™ll fit a multiple linear regression model using *Exam Score* as the response variable andÂ *Study Hours* andÂ *Current Grade* as the predictor variables.

To fit this model, click the **Data** tab along the top ribbon and then click **Data Analysis**:

If you donâ€™t see this option available, you need to first load the Data Analysis ToolPak.

In the window that pops up, selectÂ **Regression**. In the new window that appears, fill in the following information:

Once you clickÂ **OK**, the output of the regression model will appear:

**Step 3: Interpret the Adjusted R-Squared**

The adjusted R-squared of the regression model is the number next to **Adjusted R Square**:

The adjusted R-squared for this model turns out to beÂ **0.946019**.

This value is extremely high, which indicates that the predictor variables *Study Hours* and *Current Grade* do a good job of predicting *Exam Score*.

**Additional Resources**

What is a Good R-squared Value?

How to Calculate Adjusted R-Squared in R

How to Calculate Adjusted R-Squared in Python