{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Binary Variables\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",
        "Create and audit binary indicators from transparent rules.\n",
        "\n",
        "Dataset: MODULE7_STUDENT_COMPLETION_SYNTHETIC. Variables: completed_module, study_hours, learning_format, mobile_user.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "import pandas as pd\n",
        "import numpy as np\n",
        "\n",
        "df = pd.read_csv(\"/data/module-7/module7_student_completion_synthetic.csv\")\n",
        "df[\"high_study\"] = np.where(df[\"study_hours\"] >= 8, 1, 0)\n",
        "df[\"online\"] = (df[\"learning_format\"] == \"online\").astype(int)\n",
        "print(df[[\"study_hours\", \"high_study\", \"learning_format\", \"online\"]].head())\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
}