Encoding Categories with Indicator Variables

Turn membership into a predictor

An indicator variable takes value one for membership in a stated category and zero otherwise. In a linear regression, its coefficient compares that category with a reference category while holding the other included predictors fixed. The intercept is the prediction for the reference combination when any continuous predictors are at their coded zero.

Choose a reference deliberately

For a categorical predictor with k levels and an intercept, use k minus one indicators. The omitted level is the reference.


Including an intercept and one indicator for every level creates exact linear dependence: each row's indicators sum to one, so the coefficients are not uniquely identified. Changing the reference changes coefficient labels but not fitted values.

Interpret a coefficient as a conditional contrast

With no interaction term, an indicator coefficient is an additive difference from the reference at the same values of the other covariates. It is not automatically a causal effect, and it is not a statement about every individual. Its interpretation relies on model specification, coding, and the conditional comparison actually represented by the data.

Separate coding from interaction

Indicators encode categories. If a category is expected to change the slope of another predictor, add the appropriate product term and interpret the resulting simple slopes. That extension is an interaction-model question; the basic indicator structure still establishes the reference group and contrasts.

A regression model is score = 70 + 4D, where D = 1 for students in an evening section and D = 0 for students in the daytime reference section. Holding other omitted factors aside, how does the model compare the two sections?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A categorical predictor has four mutually exclusive program types, and a linear regression includes an intercept. How many indicator variables are ordinarily included to represent program type?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

In a regression with an intercept and three indicators for four treatment groups, what does the intercept represent if all continuous covariates are coded as zero?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors