Qualitative Predictors

ECON 3209 · Week 13, Lecture 1 · Kerala Agricultural University

Department of Development Economics, KAU

Autumn 2026

Learning Outcomes

By the end of this lecture, you will be able to:

  1. define binary and categorical dummy variables
  2. interpret dummy coefficients relative to a reference category
  3. explain the dummy variable trap
  4. create dummies with pandas.get_dummies() and formula syntax
  5. apply qualitative predictors to Kerala agricultural categories

Why Dummy Variables Matter

Many important economic predictors are qualitative rather than numeric: - crop type - gender - irrigated vs rainfed land - pre- vs post-policy period

Dummy variables allow us to include these categories inside a regression model.

Binary Dummy Variables

A binary dummy takes values 0 or 1.

\[Y_i = \beta_0 + \beta_1 D_i + \varepsilon_i\]

  • If \(D_i=0\), expected outcome is \(\beta_0\).
  • If \(D_i=1\), expected outcome is \(\beta_0 + \beta_1\).
  • So \(\beta_1\) is the difference in average outcome between the two groups.

Reference Category

For multiple categories, one group must be omitted and treated as the reference.

Example: crop type = rice, coconut, rubber. - If rice is the reference, include dummies for coconut and rubber. - Their coefficients show differences relative to rice.

Dummy Variable Trap

If we include: - an intercept - a dummy for rice - a dummy for coconut - a dummy for rubber

then the dummies sum to one for every observation, creating perfect multicollinearity.

Rule: with an intercept, include one fewer dummy than the number of categories.

Python Demo: Create Dummies with pandas

Python Demo: Dummy Regression with a Binary Predictor

Python Demo: Categorical Predictor in Formula Syntax

Python Demo: Spot the Trap with Matrix Rank

How to Interpret Dummy Coefficients

  • The intercept is the predicted outcome for the reference group.
  • Each dummy coefficient measures the difference from that reference group.
  • Sign and significance tell us whether that difference is positive, negative, and precise.

Dummies shift the level of the regression line unless they also appear in interaction terms.

Kerala Examples

  • irrigated = 1 for irrigated plots, 0 for rainfed plots.
  • C(crop) for rice, coconut, and rubber categories.
  • post_scheme = 1 for years after a cooperative credit reform.
  • female_headed = 1 for female-headed households.

Each of these captures a meaningful categorical difference in the data-generating process.

🏋️ Exercise

  1. Create a dataset with crop type, irrigation status, and fertilizer use.
  2. Make dummy variables for crop type with rice as the reference.
  3. Fit a regression with a binary irrigated dummy and interpret its coefficient.
  4. Explain why including all crop dummies together with an intercept causes a problem.

Summary

✅ Dummy variables allow categorical information to enter a regression model.

✅ One category must be omitted as the reference when an intercept is included.

✅ The dummy coefficient is interpreted relative to the reference group.

✅ Including all category dummies with an intercept creates the dummy variable trap.

✅ Python supports dummy-variable work through both get_dummies() and formula syntax.

Next Lecture

Lecture 2 — Interaction Terms

We will cover: - dummy × continuous interactions - intercept and slope shifts - graphical interpretation - marginal effects by group