ECON 3209 · Week 13, Lecture 1 · Kerala Agricultural University
Autumn 2026
By the end of this lecture, you will be able to:
pandas.get_dummies() and formula syntaxMany 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.
A binary dummy takes values 0 or 1.
\[Y_i = \beta_0 + \beta_1 D_i + \varepsilon_i\]
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.
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.
Dummies shift the level of the regression line unless they also appear in interaction terms.
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.
✅ 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.
Lecture 2 — Interaction Terms
We will cover: - dummy × continuous interactions - intercept and slope shifts - graphical interpretation - marginal effects by group
ECON 3209 — Kerala Agricultural University