Skip to content

Dummy variables

You are currently viewing a sample of the Cram Kit. Click here to unlock everything.

Dummy variables are used to represent categorical variables in linear regression.

Scenario: Crammer Nation University wants to develop a regression equation to predict the "Number of Recruits" a given fraternity will receive this rush season given the "Parties Thrown" by the fraternity last year and the average "GPA" of that fraternity. They take a random sample of 52 fraternities on campus, resulting in the regression output below.

Imagine you want to add "Chapter Meeting Location" into the model, which has the following values: chapter-house, annex-house, classroom. How many dummy variables would you need?

ClueInsight
We're adding "Chapter Meeting Location" to the model, which is categorial variable with 3 options (chapter-house, annex-house, classroom).We need to use dummy variables to represent this.

Dummy Variables = m - 1

m represents the number of options in the category.

We have 3 options:

  1. chapter-house
  2. annex-house
  3. classroom

Therefore...

m = 3

Dummy Variables = 3 - 1
Dummy Variables = 2

Okay... now actually explain how they work.

y-hat = 68.2912 + 22.6973(Parties) + 16.3921(GPA) + bAnnex(Annex) + bClassroom(Classroom)

bAnnex is the change in predicted response ("Number of Recruits") if a fraternity hosts chapter at an annex-house.
Annex equals 0 (if the chapter doesn't host at an annex-house) or 1 (if the chapter does host at an annex-house).
bClassroom is the change in predicted response ("Number of Recruits") if a fraternity hosts chapter in a classroom.
Classroom equals 0 (if the chapter doesn't host in a classroom) or 1 (if the chapter does host in a classroom).

Annex = 1
Classroom = 0

y-hat = 68.2912 + 22.6973(Parties) + 16.3921(GPA) + bAnnex(1) + bClassroom(0)
y-hat = 68.2912 + 22.6973(Parties) + 16.3921(GPA) + bAnnex(1) + bClassroom(0)
y-hat = 68.2912 + 22.6973(Parties) + 16.3921(GPA) + bAnnex

A fraternity who hosts chapter at an annex-house gets bAnnex more / less "Number of Recruits" than one who hosts at their chapter-house (baseline).

Annex = 0
Classroom = 1

y-hat = 68.2912 + 22.6973(Parties) + 16.3921(GPA) + bAnnex(0) + bClassroom(1)
y-hat = 68.2912 + 22.6973(Parties) + 16.3921(GPA) + bAnnex(0) + bClassroom(1)
y-hat = 68.2912 + 22.6973(Parties) + 16.3921(GPA) + bClassroom(1)

A fraternity who hosts chapter in a classroom gets bClassroom more / less "Number of Recruits" than one who hosts at their chapter-house (baseline).

Baseline explained

Why wasn't there a dummy variable for chapter-house, like bChapter House(Chapter House), included?

Each dummy variable is comparing itself to the baseline.

Remember when we said above...

A fraternity who hosts chapter at an annex-house gets bAnnex / Classroom more / less "Number of Recruits" than one who hosts at their chapter-house (baseline).

Annex = 0
Classroom = 0

y-hat = 68.2912 + 22.6973(Parties) + 16.3921(GPA) + bAnnex(0) + bClassroom(0)
y-hat = 68.2912 + 22.6973(Parties) + 16.3921(GPA) + bAnnex(0) + bClassroom(0)
y-hat = 68.2912 + 22.6973(Parties) + 16.3921(GPA)

The baseline is already accounted for in the regression!

Activate AutoScroll