{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Chow-Style Group Difference Tests\n",
        "\n",
        "Module 7 notebook lab. This notebook uses an original Ceteris Lab synthetic teaching dataset and does not report real empirical findings.\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Learning goal\n",
        "Use interaction restrictions to test full group differences.\n",
        "\n",
        "Dataset: MODULE7_WAGE_GROUPS_SYNTHETIC. Variables: hourly_wage, female, education, experience.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "import pandas as pd\n",
        "import statsmodels.api as sm\n",
        "\n",
        "df = pd.read_csv(\"/data/module-7/module7_wage_groups_synthetic.csv\")\n",
        "df[\"female_educ\"] = df[\"female\"] * df[\"education\"]\n",
        "df[\"female_exper\"] = df[\"female\"] * df[\"experience\"]\n",
        "model = sm.OLS(df[\"hourly_wage\"], sm.add_constant(df[[\"female\", \"education\", \"experience\", \"female_educ\", \"female_exper\"]])).fit()\n",
        "print(model.f_test(\"female = 0, female_educ = 0, female_exper = 0\"))\n"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Reflection\n",
        "Write two sentences: one coefficient, group difference, or predicted-probability interpretation, and one limitation or coding choice that matters.\n"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "name": "python",
      "version": "3.11"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}