CalcWorldHub
Statistics · CalcWorldHub

Adjusted R-squared from R-squared, Sample Size, and Predictors

An adjusted R-squared calculator applies a degrees-of-freedom adjustment to a model’s R-squared using sample size and predictor count. It helps compare fitted models with different numbers of predictors, but it does not refit a model or determine whether its assumptions are appropriate.

Open calculator
A regression summary card shows R-squared adjusted using sample size and predictor count.

Share this article

Raw R-squared is adjusted using observation count and residual degrees of freedom.
The adjustment accounts for predictor count

Apply the degrees-of-freedom adjustment

The calculator uses R²adj = 1 − (1 − R²)(n − 1)/(n − p − 1). Here R² is the fitted model’s coefficient of determination, n is the number of observations used to fit that model, and p is the number of predictor variables, excluding the intercept. The denominator n − p − 1 is the residual degrees-of-freedom term for the conventional model with an intercept.

R-squared and adjusted R-squared are dimensionless. Enter R² as a decimal, not as a percentage value. The result is displayed to four decimal places. Preserve the unrounded calculation when comparing models so small differences are not obscured by display rounding.

Use counts from the same fitted model

The sample size must refer to observations actually used in the fitted regression, after exclusions or missing-data handling. The predictor count should reflect the model terms, not simply the number of column names in a file. A categorical variable represented by multiple indicator terms can contribute more than one fitted coefficient; follow the model specification used by the analysis software.

The formula assumes the conventional degrees-of-freedom setup. In the standard model with an intercept, n should be an integer and greater than p + 1 so the residual denominator is positive. The page labels R-squared as 0 to 1 and accepts numeric inputs, but its calculation does not enforce whole-number counts or that range. Use valid model quantities; a finite answer from an out-of-domain input is not meaningful.

Interpret the adjustment without overstating fit

Ordinary R-squared does not decrease merely because additional predictors are added to a conventional fitted model. Adjusted R-squared changes the comparison by accounting for the predictor count relative to the observations. It may be lower than raw R-squared, and it can be negative for a poor fit. A negative result does not mean a negative proportion of observations were predicted correctly.

A higher adjusted R-squared is not proof that a model is causally correct, well calibrated, or likely to predict new data accurately. It is one in-sample summary and does not replace residual checks, validation on held-out data, subject-matter reasoning, or a suitable model-selection plan. Compare models fitted to the same response and compatible observations before drawing a conclusion.

Compare models on a fair basis

When two models use the same outcome and observations, adjusted R-squared can help describe whether the added complexity is accompanied by enough improvement in fit to offset its degrees-of-freedom penalty. It is not a universal score for ranking every model across different outcomes, populations, transformations, or missing-data subsets. The context of each model must remain visible.

For a nested model comparison, inspect the chosen inferential test and the scientific question as well as adjusted R-squared. For prediction, cross-validation or a held-out evaluation can answer a different question from in-sample fit. The calculator receives only three summary values; it cannot inspect residual patterns, influential points, dependence, nonlinear terms, or the model-building procedure.

Worked examples

Enter R-squared as a decimal from 0 to 1, with the sample size and predictor count from the same fitted model.

A model with five predictors

Inputs: R² = 0.72; n = 100 observations; p = 5 predictors.

Calculation: R²adj = 1 − (1 − 0.72)(100 − 1)/(100 − 5 − 1) = 1 − 0.28 × 99/94 = 0.705106… ≈ 0.7051.

The adjustment reduces the raw 0.72 value to about 0.7051 for this model size.

A lower raw R-squared with three predictors

Inputs: R² = 0.35; n = 40 observations; p = 3 predictors.

Calculation: R²adj = 1 − (1 − 0.35)(40 − 1)/(40 − 3 − 1) = 1 − 0.65 × 39/36 = 0.295833… ≈ 0.2958.

The adjusted value is slightly below the raw 0.35 after accounting for the three predictors.

Two compatible regression models can be compared using raw and adjusted R-squared together.
Compare like-for-like fitted models

Check the inputs and keep precision

Use a model-reported R-squared, an integer observation count, and an integer number of predictors from one regression output. Avoid copying percentages without converting them to decimals. The calculator checks whether the final expression is finite, but it does not verify that n and p are valid counts or that the reported R² belongs to the stated model. Review the labels and source report before interpreting the answer.

Rounding should happen after the formula is evaluated. If the two models’ displayed values are close, compare their full-precision results and the uncertainty in the underlying model, not only four displayed decimals. Retain the software output, model formula, analysis sample, and any intercept convention so another analyst can reproduce the adjustment.

Sources and further reading

Share this article

Browse all articles · Calculator: Adjusted R-squared calculator