# Hierarchical regression (/docs/analyses/hierarchical-regression)



## When to use it [#when-to-use-it]

Use hierarchical regression when you, not an algorithm, decide the order. For example: enter study hours first, then ask whether anxiety still explains exam score after hours are already in the model.

## Assumptions [#assumptions]

Same straight-line model as [linear regression](/docs/analyses/linear-regression). Tensr does not add residual plots or a collinearity table on this procedure.

## Running it in Tensr [#running-it-in-tensr]

<Steps>
  <Step>
    Analyze → Regression → Linear → Hierarchical. In chat: “Hierarchical regression of score, hours in block 1, hours and anxiety in block 2.”
  </Step>

  <Step>
    Dependent is the outcome. Blocks is a list of predictor lists, at least one block.
  </Step>

  <Step>
    Method is enter only. Confidence level starts at 0.95.
  </Step>
</Steps>

## Options [#options]

<TypeTable
  type="{
  dependent: {
    type: 'string',
    description: 'Numeric outcome.',
  },
  blocks: {
    type: 'string[][]',
    description: 'Each inner list is the predictor set for that block. At least one block.',
  },
  method: {
    type: 'string',
    description: 'Only enter is accepted.',
    default: 'enter',
  },
  confidence_level: {
    type: 'number',
    description: 'Confidence level for the final coefficients.',
    default: '0.95',
  },
  decimal_places: {
    type: '0–6',
    description: 'Report output. Decimal places.',
    default: '3',
  },
  apa_format: {
    type: 'boolean',
    description: 'Report output. APA-style p-values.',
    default: 'true',
  },
  include_charts: {
    type: 'boolean',
    description: 'Report output. Shared chart switch.',
    default: 'true',
  },
}"
/>

## Reading the output [#reading-the-output]

Hours go in first. Anxiety is added in a second block. Each block was built to add a slice of R², not to swallow the outcome.

| Block | Predictors |    R² | Adj R² |   ΔR² | F-change | p-change |
| ----: | ---------- | ----: | -----: | ----: | -------: | -------: |
|     1 | hours      | 0.107 |  0.097 |     — |        — |        — |
|     2 | anxiety    | 0.231 |  0.215 | 0.124 |   15.047 |  \< .001 |

| Variable |      B |    SE |      β | 95% CI            | p-value |
| -------- | -----: | ----: | -----: | ----------------- | ------: |
| hours    |  2.062 | 0.619 |  0.303 | \[0.832, 3.292]   |    .001 |
| anxiety  | -2.092 | 0.539 | -0.353 | \[-3.162, -1.021] | \< .001 |

Hierarchical regression for `score` with 2 block(s). Hierarchical regression for `score` with 2 block(s). Metrics: Final R² = 0.231; Adj R² = 0.215; N = 96.

## Reporting (APA 7) [#reporting-apa-7]

Hierarchical regression for `score` with 2 block(s). Report the estimate in the table. This procedure is not summarised by one p-value.

## Coming from SPSS [#coming-from-spss]

Analyze → Regression → Linear → Hierarchical.

SPSS hierarchical regression is the Block button in Linear Regression: you assign predictors to Block 1 of 1, then the next block. Tensr takes those blocks as a list.

## Related [#related]

Letting the software pick the order is the Stepwise regression section of [linear regression](/docs/analyses/linear-regression). A single block is that same page with method enter.
