Statistical Methods

Make Regression Reference Categories Explicit

Record the comparison before fitting

For each categorical predictor, list all permitted levels and the intended reference category. Preserve readable labels alongside stored codes. Alphabetical ordering or a software default can choose a reference that differs from the scientific comparison, especially after importing a new extract.

The official R relevel documentation explains that treatment contrasts use the first factor level as reference. Other coding systems use different coefficient interpretations, so record the contrast specification as well as the reference label.

Match coefficients to the design

With treatment coding and an intercept, a categorical predictor with three levels usually contributes two indicator columns. Each coefficient compares its level with the reference, conditional on the other modeled terms. If interactions are included, the comparison can additionally depend on the interacting variable's value.

Check whether zero is meaningful for continuous predictors that define an intercept or conditional comparison. Centering a predictor changes the reference value at which some coefficients are interpreted, even when it leaves fitted predictions unchanged under an equivalent model specification.

Re-express a fictional model

Suppose a fictional linear model with only group membership predicts means A = 10, B = 14, and C = 9. With A as reference, the intercept is 10, the B coefficient is 4, and the C coefficient is −1.

With B as reference, the intercept becomes 14, the A coefficient −4, and the C coefficient −5. The three predicted means remain 10, 14, and 9. Changed coefficient signs and magnitudes do not mean the observed comparison changed; the coordinate system used to describe it did.

Verify predictions and output labels

Construct a small prediction grid containing every category and any relevant modifier values. Confirm that its labels match the fitted factor levels and that equivalent recoding reproduces the expected fitted values. The logistic scenario tool provides a separate binary-predictor illustration on the probability scale; it does not infer your regression's coding from a coefficient table.

Use the logistic scenario worksheet when preparing a binary model's prediction grid. Record the outcome coded as one, the exposure and modifier coding, and the source of the coefficients. An exponentiated coefficient is especially easy to mislabel if the event or reference category was reversed.

Check what happens when a category is absent from a restricted sample or appears for the first time in validation data. Do not silently assign an unseen level to the reference group. Resolve the modeling and data-processing rule explicitly.

Finish by placing reference labels in the model table and preserving the contrast configuration with the analysis code. A reader should be able to reconstruct the intended comparison without guessing which category the software happened to place first.

Source checked on 4 November 2026; fictional coefficient re-expression independently checked.

Related reading

Reading path: Analyze data. Guide 4 of 30. Choose any guide to suit your project.

Statistical Methods

Audit Collinearity with the Actual Regression Design Matrix

Investigate variance inflation without automatically deleting scientifically necessary variables.

Statistical Methods

Summarize an Ordinal Scale Without Hiding Its Categories

Preserve ordered response labels, denominators, and scoring rules when describing ordinal research outcomes.

Browse this reading pathTools for this stageGuides and downloads for this stage