{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Chapter 19: Multiple Regression and the Ceteris Paribus Interpretation\n",
        "**Economic question:** How can we compare two people while holding other observed characteristics constant?\n",
        "\nMultiple regression estimates partial associations conditional on the controls included in the model.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "import numpy as np, statsmodels.api as sm\n",
        "rng=np.random.default_rng(19)\n",
        "ability=rng.normal(size=300)\n",
        "educ=.7*ability+rng.normal(size=300)\n",
        "wage=2+1.2*educ+1.5*ability+rng.normal(size=300)\n",
        "naive=sm.OLS(wage,sm.add_constant(educ)).fit()\n",
        "controlled=sm.OLS(wage,sm.add_constant(np.c_[educ,ability])).fit()\n",
        "print('naive',naive.params[1],'controlled',controlled.params[1])\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": 19,
      "source_origin": "supplied"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}
