{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Chapter 25: Binary, Ordered, and Count Outcomes\n",
        "**Economic question:** How should we model outcomes that are probabilities, categories, or event counts?\n",
        "\nWhen the dependent variable is discrete, the conditional mean is constrained and interpretation shifts from slopes to probabilities or expected counts.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "import numpy as np, statsmodels.api as sm\n",
        "rng=np.random.default_rng(25); x=rng.normal(size=800); p=1/(1+np.exp(-(-.5+1.2*x))); y=rng.binomial(1,p)\n",
        "fit=sm.Logit(y,sm.add_constant(x)).fit(disp=False)\n",
        "print(fit.params); print(fit.get_margeff().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": 25,
      "source_origin": "supplied"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 5
}
