AI Glossary / Statistics and probability / Intermediate

Hierarchical (sequential) sums of squares

Definition

Hierarchical (sequential) sums of squares measure how much residual squared error decreases as terms enter a linear model in a specified order. In this glossary's usage, they are Type I sums of squares: each term receives credit after the preceding terms have been fitted, but before later terms are added. The allocation can therefore depend on the order of entry.

What it means

Imagine explaining an outcome with baseline information first and a new predictor second. The second predictor is credited with the additional fit it provides beyond the baseline model. Reversing the order asks a different question.
The word hierarchical is ambiguous across statistical sources. Some use it for Type II sums of squares or for multilevel models. Here, the parenthetical sequential and the supplied seed definition identify Type I allocation. State that explicitly in reports.

How it works

Begin with a baseline model, often an intercept-only model. Add a term or a prespecified block of terms and refit using the same observations and outcome. The reduction in residual sum of squares is that addition's sequential sum of squares.
If SSE(M) denotes residual squared error for model M, the contribution of B after A is SSE(A) - SSE(A,B), with the intercept included in both when appropriate. The models must be nested: the smaller model's fitted-value space must be contained in the larger model's space.
Continue adding terms in the planned order. For ordinary least squares on the same data, these reductions are nonnegative apart from numerical rounding. Their sum equals the reduction from the baseline model to the final model because the intermediate differences cancel.
When predictors overlap in the variation they explain, earlier terms can receive credit that later terms might have received in another ordering. A large first-entry contribution is therefore not an intrinsic measure of a predictor's importance or causal effect.
Orthogonal term spaces avoid this allocation conflict. In suitable balanced factorial designs, sequential contributions for comparable effects can be unaffected by order. Balance alone should not replace checking the actual model structure, especially with covariates, missing cells, or different terms.
A term can require several coefficients. Its degrees of freedom reflect the increase in model rank, rather than automatically equaling one. Classical F calculations compare a term's mean square with an appropriate residual mean square, subject to model assumptions and the intended hypothesis.
Keep all compared models on identical records. If adding a predictor drops observations with missing values, the change in residual error combines a change of model with a change of data and is not the intended sequential comparison.
Distinguish the arithmetic partition from inferential interpretation. Type I, II, and III procedures can target different hypotheses. Choose the hypothesis first and verify the term ordering.

Three practical examples

  • An AI evaluation study enters established task descriptors before measuring the additional contribution of a proposed complexity score.
  • An experiment accounts for prespecified blocks before allocating variation to treatments.
  • A training analysis compares a baseline model with successive, scientifically motivated blocks of predictors.

Think of it this way

Think of filling a shared container in a chosen sequence. The first contributor can occupy space that another might otherwise fill. The final total can stay unchanged while the credit assigned to each contributor changes with the order.

Worked example

Consider four observations with x = -1, -1, 1, 1; z = -2, 0, 0, 2; and y = -2, -2, 0, 4. Fit every model with an intercept and use all four records.
The mean of y is zero, so the intercept-only residual sum of squares is 4 + 4 + 0 + 16 = 24. Fitting x alone gives predictions 2x and residual sum of squares 8. Fitting z alone gives predictions 1.5z and residual sum of squares 6.
The full model predicts y as x + z, giving predictions -3, -1, 1, 3. Its residuals are 1, -1, -1, 1, whose squared sum is 4.
Entering x then z allocates 24 - 8 = 16 to x and 8 - 4 = 4 to z after x. Entering z then x allocates 24 - 6 = 18 to z and 6 - 4 = 2 to x after z.
Both orderings explain 20 units of squared variation and end with the same full-model fit. The different allocations answer different sequential questions. With only one residual degree of freedom in the full model, this constructed dataset illustrates decomposition rather than dependable real-world inference.

Illustrative case study

Fictional case: Maple Insights tests whether a new task-difficulty score helps explain AI response quality beyond established task categories. The analysis plan specifies categories first and the new score second.
An analyst notices that the score receives much more sequential credit when entered first. Rather than treating this as contradictory software output, the team explains that the score overlaps with existing category information. The planned second-entry result answers the incremental-value question.
The report includes the model sequence, record count, residual sums of squares, and held-out predictive checks. It avoids calling sequential explained variation causal impact or assuming better training fit guarantees better deployment performance.

Common misconceptions and mistakes

Common mistakes include treating Type I sums of squares as order invariant, confusing hierarchical terminology across references, and comparing models fitted to different observations.
Do not assume each term has one degree of freedom or that a predictor's sequential contribution is a unique share of causal responsibility. Changing order to obtain significance changes the question and can encourage selective reporting.

Business use

Sequential sums of squares are useful when there is a meaningful order, such as adding new information beyond an existing operational baseline. They make incremental fit explicit. Business reports should disclose the entry order and avoid presenting the resulting allocation as an objective ranking independent of the model.

People also ask

Does changing order change the final fit?

Not if the final model space and data remain identical.

Can the contributions change?

Yes, when terms explain overlapping variation.

Are these multilevel-model variances?

No. Hierarchical here refers to the supplied sequential terminology, not a model with nested random effects.

Check your understanding

How much does z add after x in the example?

Answer: Four squared-outcome units.

How much does x add after z?

Answer: Two.

What remains the same in both orders?

Answer: The full-model residual sum of squares, four, and the total reduction, twenty.

Related terms

  • Analysis of variance
  • Type I sums of squares
  • residual sum of squares
  • nested models
  • model rank
  • orthogonality
  • incremental R-squared
  • partial F-test

Learn next

Fit the same two predictors in both orders and compare the sequential tables. Then write the precise reduced and expanded models for each comparison before studying Type II and Type III hypotheses.

More in Statistics and probability

  • Heterogeneous subsamples - Heterogeneous subsamples are distinct subsets within a dataset whose characteristics or statistical relationships differ.
  • Heteroskedasticity-consistent standard errors - Heteroskedasticity-consistent standard errors estimate regression-coefficient uncertainty while allowing error variance to differ across observations.
  • Hidden Markov model - A Hidden Markov model (HMM) is a probabilistic model for a sequence of observations generated by an unobserved sequence of states.
  • Hierarchical log-linear model - A hierarchical log-linear model describes expected counts in a contingency table through a linear model for their logarithms, with a hierarchy rule for...
  • High-dimensional statistics - High-dimensional statistics studies estimation, prediction, and inference when the number of variables or model parameters is large relative to the...
  • High frequency data - High frequency data are observations recorded at short time intervals relative to the process being studied.

Work in finance? Get the free CFO AI Prompt Pack: 7 prompts for finance leaders.

Sources

David Howell, glossary: https://www.uvm.edu/~statdhtx/methods8/Glossary/Glossary.html R stats, ANOVA for linear model fits: https://search.r-project.org/R/refmans/stats/html/anova.lm.html Types of Sums of Squares, University of Toronto-hosted teaching reference: https://utstat.utoronto.ca/reid/sta442f/2009/typeSS.pdf

Previous: Hierarchical reinforcement learning Next: Hierarchical softmax

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer