Quantitative Analysis/ Regression
Building models in stages

What is hierarchical regression? Theory, calculation and application

Hierarchical regression adds predictors in planned blocks and shows how much each block improves the model. This guide explains when the approach helps, how to read the change in R-squared, and how to run it in AnalyZ Solutions.

10 min read Regression Intermediate

01What is hierarchical regression?

Hierarchical regression is a way of building a regression model in planned steps. Instead of adding every predictor at once, you add them in groups, called blocks, and check after each block how much more of the outcome the model explains.

It builds on multiple regression, which describes how a numeric outcome, such as a test score, relates to several factors at the same time. If that is new, the linear regression guide explains it from the start. The new idea here is the order. Each block is judged by what it adds to the blocks that came before.

An example

Suppose you have exam scores for 250 students. You want to know three things. How much of the difference in scores can background alone explain, such as age and gender? Do study habits, meaning weekly study hours and attendance, explain more once background is accounted for? And does taking part in a tutoring scheme add anything beyond all of that? Hierarchical regression answers these in order. Background goes in first, study habits second, and tutoring last.

Why not put everything into one model?

A single model with every predictor gives the effect of each variable among people who are the same on all the others. It cannot tell you what a whole group of variables adds beyond what you already knew, and it ignores a sequence you chose in advance. A planned order lets you ask questions such as whether tutoring matters once background and study habits are allowed for.

What you get out of it

  1. Fit by block
    The share of the variation in the outcome that the model explains after each block, called R-squared.
  2. Contribution of each block
    How much that share rises when a block is added, called the change in R-squared.
  3. Significance
    Whether a block adds more than chance would, using an F test on the change, which this guide shows how to calculate.
  4. Coefficients
    The effect of each predictor at every step, so you can see how effects shift as blocks are added.
"Hierarchical" refers to the order of entry only. It has nothing to do with data that is nested in groups, such as students in schools. That is the job of multilevel regression.

02When to use it

Use it when your research question has a natural sequence. Common patterns include controlling for demographics first and then testing the variable of interest, testing whether attending a course explains outcomes beyond background characteristics, and comparing the contribution of conceptually distinct groups of predictors such as individual, family, and community factors.

The order of blocks is a research decision that should come from theory or from your analysis plan, and never from what produces the most impressive result. It affects the story: a variable entered last is judged by what it adds after everything else, while one entered first receives credit for any overlap with later variables.

For a single-step model, use linear regression. For clustered data, use multilevel regression.

03The building blocks: R-squared, blocks and the change in R-squared

Hierarchical regression rests on three ideas: how much of the variation a model explains, what a block is, and what it means for a block to add something.

R-squared: the share explained

Exam scores differ from student to student. R-squared is the share of those differences that the predictors account for, from 0% to 100%. A value of 0% means the predictors explain nothing, and 100% means they explain everything. Scores are never fully predictable, so real models land well below 100%.

R² = 1 - (unexplained variation) / (total variation)

Total variation is how far the scores spread around their average. Unexplained variation is how far they still spread around the model's predictions.

Blocks

A block is a group of predictors entered together because they belong together conceptually, such as background characteristics, study habits, or a programme or treatment. You choose the blocks and their order before looking at the results, from theory or from your analysis plan.

What a block adds

Each step fits a regression that contains every predictor entered so far. Because the earlier predictors stay in the model, R-squared can only rise or stay the same when a block is added. The size of the rise is the change in R-squared, and it is the contribution of the new block over and above everything before it. In the example, background alone explains about 5% of the variation in exam scores. Adding study habits lifts that to about 30%, and adding tutoring lifts it to about 33%.

Figure 1. How the explained share grows as each block is addedFour bars. Block 1 explains about 5 percent. Block 2 adds about 24 points. Block 3 adds about 4 points. Together the three blocks explain about 33 percent.0%10%20%30%40%5.35%Block 1Background+24.40 pointsBlock 2adds study habitsR-squarednow 29.75%+3.56 pointsBlock 3adds tutoring33.31%All three blocksexplained in totalShare of the variation in exam scores explained, built up one block at a time. The rest, 66.69%, is not explained.
Figure 1. How the explained share grows as each block is added

The order matters for the story. A block entered first gets credit for any overlap with later blocks, while a block entered last is judged only by what it adds after the others. The next section writes the model in symbols and shows how to test whether a block's contribution is more than chance.

04The model and how it is calculated

The model

Each block produces an ordinary linear regression that contains all the predictors entered so far. Block 1 contains the first set. Block 2 contains the first and second sets. Block 3 contains all three, and so on.

outcome = b0 + (block 1 predictors) + (block 2 predictors) + ... + error

Each model is fitted by least squares, exactly as in linear regression. What is special is the comparison between neighbouring models. Because the earlier predictors are still in the model, R² can only rise or stay the same, and the rise is the contribution of the new block over and above what came before.

Testing whether a block adds anything

The F test in each row of the module's block summary tests the whole model against a model with no predictors. It does not test the step from one block to the next. That step can be tested with an F test for the change in R²:

F change = ( (R² new - R² old) / number of predictors added ) / ( (1 - R² new) / (n - k - 1) )

Here k is the total number of predictors in the larger model. The result is compared with an F curve with those two degrees of freedom. Spreadsheet programs give the p-value with their F-distribution function.

For the exam-score example in the results below, with n = 250:

The F test for the change in R² at each step
StepAddedR² beforeR² afterChangeF changedfp-value
Block 1 to 2Study hours, Attendance0.05350.29750.244042.552, 245< 0.001
Block 2 to 3Tutoring0.29750.33310.035513.001, 244< 0.001

Block 2 adds 0.244 to R² with 2 predictors, giving F = ((0.2975 - 0.0535) ÷ 2) ÷ ((1 - 0.2975) ÷ 245) = 42.55. Block 3 adds 0.036 with 1 predictor, giving F = 13.00. Both steps are significant, so each block improves the model beyond chance. The module does not print these values, so calculate them from the R² column when you need to report them.

Adjusted R²

adjusted R² = 1 - (1 - R²) × (n - 1) / (n - k - 1)

Adjusted R² is the better figure for comparing blocks, because it drops when a block adds predictors that explain little.

05Reading the output

The block summary

A summary table has one row per block. It shows the variables added at that step, the R-squared of the model at that point, the adjusted R-squared, the change in R-squared relative to the previous block, the F test for the model at that step with its significance level, AIC, and the number of cases.

The change in R-squared is the headline number. If the first block explains 12% of the variation and the second brings the total to 21%, the second block adds 9 percentage points. Whether that is worthwhile depends on your field, but a change of 1 or 2 points from a block of several variables is usually not substantial.

Coefficients per block

Each block also has its own coefficient table, showing every predictor in the model at that step. Watching how a coefficient changes between blocks is informative. If the effect of taking part in a course shrinks sharply once income enters, part of what looked like a course effect was really an income difference.

Checking the size of the increase

The F test in the summary refers to the model at that step as a whole, and does not test whether the increase from the previous block is itself significant. To judge what a block adds, look at the change in R-squared alongside the significance of the newly added predictors in that block's coefficient table. If none of the new predictors is significant and R-squared barely moves, the block adds little. You can also calculate the F change test described in the model section.

06How to run it in AnalyZ Solutions

Open Inferential Analysis, choose Regression, then Hierarchical Regression.

  1. Select the dependent variable
    Choose a numeric outcome.
  2. Fill in Block 1
    Choose the predictors for the first step. Numeric and categorical variables can be mixed.
  3. Add further blocks
    Use the add block button for each additional step. Each block holds only the new variables, since earlier blocks carry over automatically.
  4. Set reference categories
    Categorical predictors are converted to comparisons against a reference category automatically. Pick the reference category you want each group compared with, usually the largest or the most natural comparison group.
  5. Apply a subsample filter if needed.
  6. Click Run regression
    The output has the block summary, a coefficient table for each block that you can expand, a coefficient plot, and a plain-language interpretation of the final model.

The sample for each block uses cases with complete data on every variable entered so far. If a variable added in a later block has many missing values, the number of cases falls, and changes in R-squared then partly reflect a different sample. Check the case count for each block in the summary.

Decide the block order before you look at results. Write down the blocks and the reason for their order in your analysis plan. Reordering blocks after seeing the output is a way of choosing the story rather than testing it.

07Interpreting the result

The figures below are invented to show the steps, and they follow the results tables in AnalyZ Solutions, with a few columns left out to save space. Suppose exam scores for 250 students are modelled in three blocks: background characteristics first, then study habits, then participation in a tutoring scheme.

Block summary
BlockVariables addedR²Adj R²ΔR²FF p-valueAIC
1Age, Gender (Female)0.05350.04580.05356.980.00111865.60
2Weekly study hours, Attendance rate0.29750.28600.244025.94< 0.0011795.06
3Tutoring0.33310.31940.035524.37< 0.0011784.08

Reading it step by step

  1. Read block 1 as the starting point
    Age and gender explain about 5% of the variation in scores. This is a weak start, and it is the amount that is already explained before the variables of interest are added.
  2. Look at the jump in block 2
    Adding study hours and attendance lifts R² to 0.2975, a rise of 24.4 percentage points. Study habits explain far more than background alone. Adjusted R² also rises, from 0.046 to 0.286, so the gain is more than the automatic rise that comes from adding predictors.
  3. Judge the last block
    Tutoring adds 3.6 percentage points (R² from 0.2975 to 0.3331). This is small. Even so, the coefficient for tutoring in the final model is 4.09 (interval 1.86 to 6.33, p below 0.001), so tutored students score about 4 points higher, holding everything else constant.
  4. Read the F test correctly
    The F value in each row tests the whole model at that step against a model with no predictors. It does not test whether the block itself is an improvement. Judge a block by its change in R² and by the significance of its new predictors. All 250 cases were used in every block.

In plain words

Background characteristics explained little of the variation in exam scores. Study habits explained a great deal more, and tutoring added a small but clear amount on top. Attending tutoring was associated with about 4 more points after all other variables were accounted for. The block order came from the analysis plan, and it does not show that earlier variables cause later ones.

08Common mistakes

Reading the order as a causal order. Blocks organise the analysis. They do not prove that earlier variables cause later ones.

Ignoring changing sample sizes. Compare the case counts across blocks.

Overinterpreting small increases. With many predictors, R-squared always creeps up. Check adjusted R-squared and the significance of the new predictors.

Entering too many blocks. Two to four blocks with a clear rationale are easier to defend and explain than many small steps.

Frequently Asked Questions
How is hierarchical regression different from stepwise regression?
In hierarchical regression, you decide the order of entry based on theory. In stepwise regression, software chooses which variables to enter based on statistical criteria. The first is a planned analysis. The second is data-driven and tends to produce results that do not replicate.
Is hierarchical regression the same as multilevel modelling?
No. Hierarchical here means blocks entered in order. Multilevel models handle data in which respondents are nested in groups such as schools or workplaces.
What is a meaningful change in R-squared?
There is no universal threshold. A block that adds a few percentage points can matter if it contains your variable of interest and the effect is important in practice. Judge it by the size, the significance of the new predictors, and the context.
Can I put a single variable in a block?
Yes. Putting the variable of interest alone in the last block shows exactly what it adds beyond everything else.
Does the order of variables within a block matter?
No. Only the order of blocks matters, since all variables within a block enter at the same time.

Build a model in stages

Open Regression in AnalyZ Solutions. Free to sign up, free to analyze.

Get started
Related Guides