Unit 09.02: Same fit, different comparisons
The reference category is chosen alphabetically unless you choose it. It should be the baseline your reader has in mind.
Same fit, different comparisons
Changing the reference level does not change the model. The fitted values, the residuals and R-squared are all identical — only which comparisons are reported changes.
That makes it a purely presentational choice, and an important one. If the business baseline is the standard tier, then coefficients relative to 'basic' force every reader to do subtraction in their head.
It follows that a coefficient table is meaningless without the reference level, which is why it belongs in the caption rather than in the analyst's memory.
This block fits the same model with two different references.
suppressPackageStartupMessages(library(broom))
set.seed(603)
d <- data.frame(
tier = factor(rep(c("basic", "premium", "standard"), each = 60)),
spend = c(rnorm(60, 40, 9), rnorm(60, 72, 9), rnorm(60, 55, 9))
)
cat("Alphabetical reference:", levels(d$tier)[1], "\n")
print(tidy(lm(spend ~ tier, data = d))[, c("term", "estimate", "p.value")])
d$tier <- relevel(d$tier, ref = "standard")
cat("\nReference set to standard (the business baseline):\n")
print(tidy(lm(spend ~ tier, data = d))[, c("term", "estimate", "p.value")])
cat("\nBoth models fit identically -- same fitted values, same residuals:\n")
m1 <- lm(spend ~ tier, data = data.frame(tier = factor(rep(c("basic","premium","standard"), each=60)),
spend = d$spend))
cat(" R-squared:", round(summary(m1)$r.squared, 5), "and",
round(summary(lm(spend ~ tier, data = d))$r.squared, 5), "\n\n")
cat("A coefficient table is unreadable without knowing the reference. Put it\n")
cat("in the caption of every regression table you publish.\n")
With the alphabetical reference basic, premium reads +31.9 and standard +14.7. Relevelled to standard, the same model reports basic at −14.7 and premium at +17.2. R-squared is 0.67117 in both cases — identical to five decimal places, because it is the same fit. Only the comparisons moved, and the second set is the one a business reader can use directly.
The mistake this prevents
The mistake is publishing a coefficient table without naming the reference. Every number in it is a difference from something the reader cannot see.
Takeaway
Set the reference to the meaningful baseline with relevel(), and state it in the table caption. Remember that changing it is presentation, not modelling — the fit is untouched.
