Statistical Tutorial ·

Hierarchical Regression With Categorical Controls: Dummy Coding and Reference Groups, Handled

A walkthrough of a two-block hierarchical regression online: what one plain-English prompt left out, the treatment coding and reference categories ChatSRS named on its own, and the R squared change rows that answer the actual question. Demo data, N = 290.

If you feed five majors into a regression as the numbers 1 to 5, the model believes Arts & Design is one unit less than Business & Economics. Categorical controls have to be dummy-coded against a named reference category first — and in this run ChatSRS did it, and said which categories it used, without being asked. Below is the full walkthrough on demo data (N = 290).

What This Walkthrough Covers

A hierarchical regression is one model run twice: controls first, then the variables you actually care about. The number that matters is not either R² on its own, it is the change between them and whether that change survives a test.

But before any of that can run, three categorical controls — gender, year and major — have to be turned into something a regression can use. That step has a name (dummy coding, or treatment coding), a required decision (which category is the reference), and a reporting obligation (naming that reference in your methods section). It is the step most student regressions get wrong silently.

This is a walkthrough on demo data — not real thesis data. A simulated survey, uploaded as mock-data-b3-en.xlsx, cleaned down to a working sample of 290 respondents before any model ran. The outcome is behavioral intention.

The Prompt, and What It Left Out

I uploaded the file and typed one line: "Run a hierarchical regression. The outcome is behavioral intention. Put gender, year and major in as control variables in the first block, then add perceived usefulness, perceived ease of use, social influence and attitude in the second block. I want to see how much the second block improves the explanatory power and whether that improvement holds up."

Note what is not in it: no dummy coding, no reference categories, no mention of an F-change test. Those are the parts I would have had to look up.

It set out the plan before running anything: "I'll run the hierarchical model on the same 290-person cleaned sample. Because gender, year, and major are categorical controls, I'll encode them with reference categories and enter the resulting dummy variables in Block 1, then add PU, PEOU, SI, and ATT in Block 2. I'll report R², the change in R², the block F-change test, coefficients, and diagnostics."

The plain-English prompt naming the outcome and the two blocks, with the reply below it confirming reference-category encoding and the fit statistics it will report The prompt end to end, and the plan it confirmed — the encoding step appears in the reply, not in the request.

The Step I Didn't Ask For: Treatment Coding, With Its References Named

Then the part a menu would not have handed me: "For the categorical controls, I'll use treatment coding with these reference categories: Female, Freshman, and Arts & Design. The first block will therefore contain the remaining gender, year, and major indicator variables; this keeps the model from imposing an artificial numeric order on nominal categories."

That is the decision that quietly breaks most student regressions — feeding five majors in as 1 to 5 and letting the model believe Arts & Design is one unit less than Business & Economics. It named its reference categories out loud, which is exactly what a methods section has to state.

Categorical controlReference categoryIndicator variables entered in Block 1
GenderFemaleGender_Male
YearFreshmanYear_Graduate, Year_Junior, Year_Senior, Year_Sophomore
MajorArts & DesignMajor_Business & Economics, Major_Health Sciences, Major_Humanities & Social Sciences, Major_STEM

Source: the reference categories stated by ChatSRS before the model ran, and the predictor rows printed in its "Hierarchical Regression Results" grid, N = 290 (demo data, not real thesis data).

Every coefficient on those indicator rows is read against its reference: Gender_Male is relative to Female, each Year row is relative to Freshman, each Major row is relative to Arts & Design. Without the reference named, the rows have no interpretation at all.

The reference-category message arriving unprompted between two completed steps, naming treatment coding and the three reference categories with its justification The coding decision stated in full — three reference categories plus the reason, arriving in a run where nobody asked for it.

The Two-Block Table: Where the Answer Actually Lives

The table comes back as one grid with both models side by side, under the header "Dependent variable: BI Layer 1 | Layer 2". The left half is the control block, the right half the full model, row by row. The fit rows sit at the bottom.

Fit rowLayer 1 (controls only)Layer 2 (full model)
0.0290.326
Adjusted R²-0.0030.295
F valueF(9,280)=0.916, p=0.511F(13,276)=10.281, p=<0.001**
ΔR²0.0290.298
ΔF valueF(9,280)=0.916, p=0.511F(4,276)=30.484, p=<0.001**

Source: ChatSRS "Hierarchical Regression Results" output on simulated survey data, N = 290 (demo data, not real thesis data). Values reproduced as printed, including the output's own p=<0.001** format.

The last two rows are the ones that answer the question the model was built for. Everything above them is context.

The full Hierarchical Regression Results grid with both layers side by side, every predictor row, and the five fit rows at the bottom including R squared change and F change The complete grid — the same predictor list priced twice, with PU, PEOU, SI and ATT left blank in the Layer 1 half, which is the visual proof block 1 genuinely excluded them.

Reading the Blocks in Plain Terms

Block 1 is the baseline you are trying to beat. Block 2 is the model with your constructs added. ΔR² is how much more variance the constructs explain, and the ΔF test is what says that improvement is more than noise.

A negative adjusted R² in block 1, -0.003, is not a bug — it is what an adjusted figure does when a model explains less than its own parameter count would predict by chance. Check the AI's reasoning yourself before any of this becomes a sentence in your thesis.

What This Walkthrough Doesn't Cover

Frequently Asked Questions

Do I have to dummy-code categorical controls myself before running a hierarchical regression?

Not in this run. The prompt named gender, year and major as controls and nothing else; the encoding decision came back in the plan: "Because gender, year, and major are categorical controls, I'll encode them with reference categories and enter the resulting dummy variables in Block 1."

What is a reference category, and why does it have to be named in my methods section?

It is the category every other level of that variable is compared against. Here they were Female, Freshman, and Arts & Design. Without naming them, a coefficient like Gender_Male has no defined meaning — a reader cannot tell what it is relative to.

What happens if I just enter five majors as the numbers 1 to 5?

The model treats them as an ordered scale with equal spacing, so it believes Arts & Design sits one unit below Business & Economics. The output's own justification for coding them instead: "this keeps the model from imposing an artificial numeric order on nominal categories."

Which rows in the table answer the hierarchical question?

ΔR² and ΔF value, the last two rows. In this run Layer 2 shows ΔR² 0.298 and ΔF value F(4,276)=30.484, p=<0.001**. R² on its own says how much the full model explains, not what the second block added.

Is a negative adjusted R² an error?

No. Block 1 here shows R² 0.029 and Adjusted R² -0.003. The adjusted figure penalises a model for its parameter count, so it can go below zero when the model explains less than that count would buy by chance.

Bottom Line

A hierarchical regression starts before the blocks do. Categorical controls need coding, that coding needs a named reference category, and the reference belongs in your write-up — in this run all three were decided, justified, and stated out loud in a prompt that never mentioned them.

Run your own hierarchical regression in ChatSRS — name your controls and your predictors in plain English; the coding decision, the reference categories, and the change test come back in the same pass.