Skip to content

Dummy variables and interaction

Add a 0/1 dummy variable for store location to a sales model, read its coefficient as a shift between two parallel lines, and test an interaction term.

It opens on

At the same advertising spend, do Marlowe's mall stores sell about the same as its street stores, or more, or less?

Why it matters

Many drivers of business results are categories, such as location, channel or season, and a dummy variable lets a regression compare them while controlling for the numeric predictors.

Good to know first

  • multiple regression coefficients

Step by step

  1. Two kinds of store on one plot

    Code location as a 0/1 dummy, and see that the fitted model draws two parallel lines.

    A common mix-up

    A dummy variable gives each group its own slope.

    In fact: a dummy shifts the line up or down, and the slope stays the same unless we add an interaction term.

  2. Reading the dummy's coefficient

    Read Excel's output for the model with the dummy, interpret the dummy's coefficient and test it.

    It is sales = 20.4738 + 5.0429 × ad + 11.8333 × mall. For a street store, sales = 20.47 + 5.04 × ad. For a mall store the intercept is 20.4738 + 11.8333 = 32.3071.

    street 20.47; mall 32.31

    A common mix-up

    The dummy's coefficient is the sales of a mall store.

    In fact: It is the difference between mall and street stores at the same advertising, not the level of mall sales.

  3. The interaction term

    Add an interaction between advertising and location, read its coefficient and test whether the slopes differ.

    A common mix-up

    A non-significant interaction means location does not matter.

    In fact: It means the advertising slope does not differ by location, and the dummy's own shift is still highly significant.

Try it

A model for pay has a dummy coded 1 for managers and 0 for others. What does the coefficient of the dummy measure?Answer

How much higher the pay of managers is than that of others at the same values of the other predictors

Hint: The gap between the two lines

Predict weekly sales for a street store that spends 6 thousand dollars on advertising.Answer

20.4738 + 5.0429 × 6 = 50.7 thousand dollars

Hint: The dummy is 0

An interaction model gives b₃ = 2.0 with p = 0.01. State what that says about the slopes.Answer

The slope for the group coded 1 is 2.0 higher than for the reference group, and the difference is statistically significant

Hint: Slope for group 1 is b₁ + b₃

What do the two lines have in common, and how do they differ?Answer

The same slope b₁, and the mall line's intercept is higher by b₂

Predict weekly sales for a mall store that spends 5 thousand dollars on advertising.Answer

20.4738 + 5.0429 × 5 + 11.8333 = 57.5 thousand dollars

Dummy variables and interaction

30 minutes every month. No card.