{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "afff6479",
   "metadata": {},
   "source": [
    "# Two Samples\n",
    "\n",
    "This chapter compares two groups. You will use A/B testing, randomized experiments, and causal reasoning to decide whether an observed difference is meaningful.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "094d9265",
   "metadata": {},
   "source": [
    "<h2>Chapter Video</h2>\n",
    "\n",
    "<iframe width=\"560\" height=\"315\" style=\"width: 100%; max-width: 560px; aspect-ratio: 16 / 9; height: auto;\" src=\"https://www.youtube-nocookie.com/embed/AGh66ZPpOSQ\" title=\"T-Tests: A Matched Pair Made in Heaven: Crash Course Statistics #27\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen referrerpolicy=\"strict-origin-when-cross-origin\"></iframe>\n",
    "\n",
    "<div class=\"video-credit\">\n",
    "<p><strong>Video credit:</strong> CrashCourse. (2018, August 15). <em>T-Tests: A Matched Pair Made in Heaven: Crash Course Statistics #27</em>. YouTube. <a href=\"https://youtube.com/watch?v=AGh66ZPpOSQ\">Watch on YouTube</a>.</p>\n",
    "<p class=\"video-rights\">This embedded video is provided for educational reference only. All rights are retained by the respective copyright holder.</p>\n",
    "</div>\n",
    "\n",
    "The video introduces t-tests. This chapter develops a simulation-based permutation approach; focus on the shared question of how to interpret a difference between groups.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "57b113b6",
   "source": [
    "```{contents}\n",
    ":local:\n",
    ":depth: 2\n",
    "```"
   ],
   "metadata": {}
  },
  {
   "cell_type": "markdown",
   "id": "fca71477",
   "metadata": {},
   "source": [
    "<h2>Learning Objectives</h2>\n",
    "\n",
    "By the end of this chapter, you will be able to:\n",
    "\n",
    "1. Frame two-sample questions in terms of groups, outcomes, and differences.\n",
    "2. Distinguish random sampling from random assignment and use permutations to simulate a null comparison.\n",
    "3. Run and interpret A/B tests for management and product decisions.\n",
    "4. Explain how experimental design supports causal claims.\n",
    "5. Separate association, causation, statistical evidence, and practical impact.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7c9dd390",
   "metadata": {},
   "source": [
    "<h2>Chapter Flow</h2>\n",
    "\n",
    "```{div} chapter-flow\n",
    "{doc}`A/B Testing <1001-ab-testing>`\n",
    "\n",
    "{doc}`Deflategate <1002-deflategate>`\n",
    "\n",
    "{doc}`Causality <1003-causality>`\n",
    "```\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4eda9d0e",
   "metadata": {},
   "source": [
    "<h2>Glossary</h2>\n",
    "\n",
    "| # | Term | Explanation |\n",
    "|---:|---|---|\n",
    "| 1 | Two-sample comparison | An analysis that compares outcomes from two groups. |\n",
    "| 2 | A/B test | A randomized comparison of two conditions or versions. |\n",
    "| 3 | Treatment group | The group receiving the intervention or new condition. |\n",
    "| 4 | Control group | The comparison group receiving the baseline condition. |\n",
    "| 5 | Outcome | The measured result used to compare groups. |\n",
    "| 6 | Difference in means | The mean of one group minus the mean of another. |\n",
    "| 7 | Difference in proportions | The proportion of one group minus the proportion of another. |\n",
    "| 8 | Random sampling | Selecting observations from a population by chance. |\n",
    "| 9 | Random assignment | Assigning units to conditions by chance. |\n",
    "| 10 | Permutation | A rearrangement used to simulate group labels under a null model. |\n",
    "| 11 | Null model | A stated reference model describing how group differences could arise through a specified chance mechanism. |\n",
    "| 12 | Test statistic | A summary used to measure the group difference. |\n",
    "| 13 | P-value | The probability, under the null model, of a statistic at least as extreme as observed. |\n",
    "| 14 | Causality | A claim that changing one factor changes an outcome. |\n",
    "| 15 | Confounding | Mixing of effects that makes causal interpretation difficult. |\n",
    "| 16 | Blinding | Hiding treatment status to reduce bias. |\n",
    "| 17 | Placebo | An inactive treatment used as a comparison. |\n",
    "| 18 | Sample size | The number of observations in a study or group. |\n",
    "| 19 | Effect size | The magnitude of a difference in practical units. |\n",
    "| 20 | Statistical power | The chance that a specified test detects an effect of a specified size under a given study design. |\n",
    "| 21 | Business experiment | A structured test used to support a management decision. |\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fe5ba261",
   "metadata": {},
   "source": [
    "<h2><a href=\"overview.html\" target=\"_blank\" rel=\"noopener noreferrer\" style=\"color: var(--pst-color-link, #176de8);\">Chapter Overview Slides</a></h2>\n"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
