In R,
lm(y ~ 1, data=d) fits an intercept-only linear model, lm(y ~ x1 + x2, data=d) adds quantitative predictors, and a factor predictor is expanded into indicator columns.Treatment coding sets one reference level in a regression factor to zero and represents each other level by an indicator column. With two interacting factors, a main-effect coefficient compares levels at the other factor's reference level; an interaction coefficient is a difference of these contrasts. A joint nested-model F-test can be significant even when some individual coefficient tests are not.
With an intercept present, a categorical predictor having represented levels adds linearly independent indicator columns and therefore model degrees of freedom.
Articles by others on the same topic
There are currently no matching articles.