{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Chapter 20: Functional Forms, Dummy Variables, and Interactions\n",
        "**Economic question:** When is a one-unit change not the right way to describe an economic relationship?\n",
        "\nFunctional form determines what a coefficient means, so interpretation must match the transformation.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "import numpy as np, pandas as pd, statsmodels.formula.api as smf\n",
        "rng=np.random.default_rng(20)\n",
        "n=300\n",
        "experience=rng.uniform(0,10,n); group=rng.integers(0,2,n)\n",
        "wage=20+2*experience+5*group+1.2*experience*group+rng.normal(0,3,n)\n",
        "df=pd.DataFrame({'wage':wage,'experience':experience,'group':group})\n",
        "print(smf.ols('wage ~ experience * group',data=df).fit().summary())\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Interpretation checklist\n",
        "- State the unit of observation and units of every variable.\n",
        "- Separate association, prediction, and causation.\n",
        "- Report magnitude and uncertainty.\n",
        "- Identify the most important threat to validity.\n"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "name": "python",
      "version": "3.13"
    },
    "ceteris_lab": {
      "course_slug": "fundamentals-python-econometrics",
      "course_title": "Fundamentals of Python for Financial Econometrics",
      "chapter": 20,
      "source_origin": "supplied"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}
