Skip to content
p.mba

Type to search tools, guides, glossary terms, frameworks, formula sheets and pages.

Menu

Glossary · Regression

Dummy Variable

Also called: indicator variable · binary variable · one-hot encoding

A 0/1 variable that lets a regression include a category, such as region or promotion week, as a predictor.

Definition

A dummy variable equals 1 when an observation belongs to a category and 0 otherwise, so its regression coefficient measures the average difference between that category and the baseline, holding other variables constant. A categorical variable with c categories needs c − 1 dummies; including all c alongside an intercept creates perfect multicollinearity, known as the dummy variable trap. Interacting a dummy with another predictor lets the slope, not just the level, differ between groups. In machine learning the same idea is called one-hot encoding.

Formula

y=β0+β1x+β2D+ε,D∈{0,1}y = \beta_0 + \beta_1 x + \beta_2 D + \varepsilon, \qquad D \in \{0, 1\}
TeX source
y = \beta_0 + \beta_1 x + \beta_2 D + \varepsilon, \qquad D \in \{0, 1\}

Worked example

Hypothetical: a weekly sales regression includes a holiday dummy with a coefficient of 3,200 units. Holding price and advertising constant, holiday weeks average 3,200 more units than other weeks.

Try it in a tool

  • Linear Regression: A statistical method that models an outcome as a linear combination of predictors, choosing coefficients that minimize the sum of squared errors.
  • Multicollinearity: High correlation among a regression's predictors, which makes individual coefficient estimates unstable and their standard errors large.
  • Logistic Regression: A regression model for yes-or-no outcomes that predicts the probability of an event by passing a linear score through an S-shaped logistic function.
  • R-Squared: The share of the variation in an outcome that a regression model explains, from 0 to 1.

Courses

More in Regression

All glossary terms