542 lines
58 KiB
HTML
542 lines
58 KiB
HTML
<!DOCTYPE html>
|
||
<!--********************************************-->
|
||
<!--* Generated from PreTeXt source *-->
|
||
<!--* *-->
|
||
<!--* https://pretextbook.org *-->
|
||
<!--* *-->
|
||
<!--********************************************-->
|
||
<html lang="en-US" dir="ltr">
|
||
<!--******************************************-->
|
||
<!--* Authored with PreTeXt *-->
|
||
<!--* pretextbook.org *-->
|
||
<!--* Theme: boulder *-->
|
||
<!--* Palette: *-->
|
||
<!--******************************************-->
|
||
<head xmlns:og="http://ogp.me/ns#" xmlns:book="https://ogp.me/ns/book#">
|
||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||
<title>\chi^2 Test</title>
|
||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="">
|
||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0">
|
||
<link href="_static/pretext/css/theme.css" rel="stylesheet" type="text/css">
|
||
<script type="module">import { startMathJax } from './_static/pretext/js/dist/mathjax_startup.js';
|
||
startMathJax({
|
||
hasWebworkReps: false,
|
||
hasSage: false,
|
||
isReact: false,
|
||
htmlPresentation: false,
|
||
});
|
||
</script><script defer src="https://cdn.jsdelivr.net/npm/mathjax@4/tex-mml-chtml.js"></script><meta name="Keywords" content="Authored in PreTeXt">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<meta property="og:type" content="book">
|
||
<meta name="twitter:title" content="Math 1044 Notes">
|
||
<meta property="og:title" content="Math 1044 Notes">
|
||
<meta property="book:title" content="Math 1044 Notes">
|
||
<meta name="twitter:card" content="summary">
|
||
<script src="_static/pretext/js/jquery.min.js"></script><script src="_static/pretext/js/dist/pretext-core.js?v=2.45"></script><!--** eBookCongig is necessary to configure interactive **-->
|
||
<!--** Runestone components to run locally in reader's browser **-->
|
||
<!--** No external communication: **-->
|
||
<!--** log level is 0, Runestone Services are disabled **-->
|
||
<script type="text/javascript">
|
||
eBookConfig = {};
|
||
eBookConfig.useRunestoneServices = false;
|
||
eBookConfig.host = 'http://127.0.0.1:8000';
|
||
eBookConfig.course = 'PTX_Course_Title_Here';
|
||
eBookConfig.basecourse = 'PTX_Base_Course';
|
||
eBookConfig.isLoggedIn = false;
|
||
eBookConfig.email = '';
|
||
eBookConfig.isInstructor = false;
|
||
eBookConfig.logLevel = 0;
|
||
eBookConfig.username = '';
|
||
eBookConfig.readings = null;
|
||
eBookConfig.activities = null;
|
||
eBookConfig.downloadsEnabled = false;
|
||
eBookConfig.allow_pairs = false;
|
||
eBookConfig.enableScratchAC = false;
|
||
eBookConfig.build_info = "";
|
||
eBookConfig.python3 = null;
|
||
eBookConfig.runestone_version = '8.2.0';
|
||
eBookConfig.jobehost = '';
|
||
eBookConfig.proxyuri_runs = '';
|
||
eBookConfig.proxyuri_files = '';
|
||
eBookConfig.enable_chatcodes = false;
|
||
</script>
|
||
<!--*** Runestone Services ***-->
|
||
<script src="_static/prefix-runtime.82b0f3334d1d4a05.bundle.js"></script><script src="_static/prefix-926.5c7038c8ef173faf.bundle.js"></script><script src="_static/prefix-runestone.5555907f139e2014.bundle.js"></script><link rel="stylesheet" type="text/css" href="_static/prefix-926.229729d09512acc9.css">
|
||
<link rel="stylesheet" type="text/css" href="_static/prefix-runestone.8086b62682b271d1.css">
|
||
<script src="_static/pretext/js/dist/lti_iframe_resizer.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/lunr.js/2.3.9/lunr.min.js" integrity="sha512-4xUl/d6D6THrAnXAwGajXkoWaeMNwEKK4iNfq5DotEbLPAfk6FSxSP3ydNxqDgCw1c/0Z1Jg6L8h2j+++9BZmg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script><script src="lunr-pretext-search-index.js" async=""></script><script src="_static/pretext/js/dist/pretext_search.js"></script><!--knowl.js code controls Sage Cells within knowls--><script>sagecellEvalName='Evaluate (Sage)';
|
||
</script>
|
||
</head>
|
||
<body class="pretext book ignore-math">
|
||
<a class="assistive" href="#ptx-content">Skip to main content</a><header id="ptx-masthead" class="ptx-masthead" role="banner"><div class="ptx-banner"><div class="title-container">
|
||
<div class="heading ptx-banner-heading"><a href="my-great-book.html"><span class="title">Math 1044 Notes</span></a></div>
|
||
<p class="byline">Andy Eisenberg (testing)</p>
|
||
</div></div></header><nav id="ptx-navbar" class="ptx-navbar navbar"><div class="ptx-navbar-contents">
|
||
<button id="ptx-toc-toggle" type="button" aria-controls="ptx-sidebar" class="toc-toggle button" title="Contents"><span class="icon material-symbols-outlined" aria-hidden="true"></span><span class="name">Contents</span></button><div class="ptx-search-box">
|
||
<div class="ptx-search-widget"><button id="ptx-search-button" type="button" class="ptx-search-button button" title="Search Book"><span class="icon material-symbols-outlined" aria-hidden="true"></span><span class="name">Search Book</span></button></div>
|
||
<dialog id="ptx-search-dialog" class="ptx-dialog ptx-search-dialog"><div class="ptx-search-dialog-controls">
|
||
<input aria-label="Search term" id="ptx-search-terms" class="ptx-search-terms" type="text" name="terms" placeholder="Search terms"><button aria-label="Close" id="ptx-search-close" class="ptx-search-close"><span class="icon material-symbols-outlined" aria-hidden="true"></span></button>
|
||
</div>
|
||
<div id="ptx-search-status" class="ptx-search-status" aria-live="polite" aria-atomic="true"></div>
|
||
<h2 class="heading ptx-search-results-heading">Search Results: </h2>
|
||
<div id="ptx-search-empty" class="ptx-search-empty"><span>No results.</span></div>
|
||
<ol id="ptx-search-results" class="ptx-search-results"></ol></dialog>
|
||
</div>
|
||
<span class="nav-other-controls"><button id="ptx-embed-button" class="ptx-embed-button button" title="Embed this page"><span class="icon material-symbols-outlined" aria-hidden="true"></span><span class="name">Embed</span></button><dialog class="ptx-dialog ptx-embed-popup" id="ptx-embed-popup"><div class="ptx-embed-popup-controls">
|
||
<p>Copy the code below to embed this page in your own website or LMS page.</p>
|
||
<button class="ptx-embed-close-button button" id="ptx-embed-close-button" title="Close"><span class="icon material-symbols-outlined" aria-hidden="true"></span></button>
|
||
</div>
|
||
<div class="ptx-embed-code-container">
|
||
<textarea class="ptx-embed-code-textbox" id="ptx-embed-code-textbox" readonly aria-label="Embed"><iframe src="https://example.com/embed" width="100%" height="1000"></iframe></textarea><button autofocus="autofocus" class="ptx-embed-copy-button button" id="ptx-embed-copy-button" title="Copy"><span class="icon material-symbols-outlined" aria-hidden="true"></span><span class="name">Copy</span></button>
|
||
</div></dialog><button id="ptx-readability-options-button" class="ptx-readability-options-button button" title="Readability settings"><span class="icon material-symbols-outlined" aria-hidden="true"></span><span class="name">Readability settings</span></button><dialog class="ptx-dialog ptx-readability-options-popup" id="ptx-readability-options-popup"><div class="ptx-readability-options-popup-controls">
|
||
<h2 class="heading">Readability settings</h2>
|
||
<button class="ptx-readability-options-close-button button" id="ptx-readability-options-close-button" title="Close"><span class="icon material-symbols-outlined" aria-hidden="true"></span></button>
|
||
</div>
|
||
<div class="ptx-readability-options-group">
|
||
<label class="ptx-readability-slider-label" for="ptx-readability-line-height"><span class="icon material-symbols-outlined" aria-hidden="true"></span><span>Line height</span><output id="ptx-readability-line-height-value" for="ptx-readability-line-height">1.35</output></label><input type="range" id="ptx-readability-line-height" min="1.10" max="3" step="0.05" value="1.35">
|
||
</div>
|
||
<div class="ptx-readability-options-group">
|
||
<label class="ptx-readability-slider-label" for="ptx-readability-font-size"><span class="icon material-symbols-outlined" aria-hidden="true"></span><span>Content font size</span><output id="ptx-readability-font-size-value" for="ptx-readability-font-size">100%</output></label><input type="range" id="ptx-readability-font-size" min="0.8" max="1.5" step="0.05" value="1">
|
||
</div>
|
||
<fieldset class="ptx-readability-options-group ptx-readability-options-group-theme">
|
||
<legend>Theme</legend>
|
||
<label for="ptx-readability-theme-system"><input type="radio" name="ptx-readability-theme" id="ptx-readability-theme-system" value="system"><span class="icon material-symbols-outlined" aria-hidden="true"></span><span>System</span></label><label for="ptx-readability-theme-light"><input type="radio" name="ptx-readability-theme" id="ptx-readability-theme-light" value="light"><span class="icon material-symbols-outlined" aria-hidden="true"></span><span>Light</span></label><label for="ptx-readability-theme-dark"><input type="radio" name="ptx-readability-theme" id="ptx-readability-theme-dark" value="dark"><span class="icon material-symbols-outlined" aria-hidden="true"></span><span>Dark</span></label>
|
||
</fieldset>
|
||
<fieldset class="ptx-readability-options-group">
|
||
<legend>Assistive technologies</legend>
|
||
<label for="ptx-readability-accessible-permalinks"><input type="checkbox" id="ptx-readability-accessible-permalinks"><span>🔗</span><span>Expose permalinks</span></label>
|
||
</fieldset>
|
||
<div class="ptx-readability-options-group"><button type="button" class="ptx-readability-reset-button button" id="ptx-readability-reset-button"><span class="icon material-symbols-outlined" aria-hidden="true"></span><span class="name">Reset All</span></button></div></dialog></span><span class="treebuttons"><a class="previous-button button" href="sec-Power.html" title="Previous"><span class="icon material-symbols-outlined" aria-hidden="true"></span><span class="name">Prev</span></a><a class="up-button button" href="ch-Hypothesis-Testing.html" title="Up"><span class="icon material-symbols-outlined" aria-hidden="true"></span><span class="name">Up</span></a><a class="next-button button" href="ch-Linear-Regression.html" title="Next"><span class="name">Next</span><span class="icon material-symbols-outlined" aria-hidden="true"></span></a></span>
|
||
</div></nav><div id="latex-macros" class="hidden-content process-math" style="display:none"><span class="process-math">\(\newcommand{\N}{\mathbb N}
|
||
\newcommand{\Z}{\mathbb Z}
|
||
\newcommand{\Q}{\mathbb Q}
|
||
\newcommand{\R}{\mathbb R}
|
||
|
||
|
||
\DeclareMathOperator{\Bin}{Bin}
|
||
\DeclareMathOperator{\Geom}{Geom}
|
||
\DeclareMathOperator{\Poiss}{Poiss}
|
||
\DeclareMathOperator{\Exp}{Exp}
|
||
\DeclareMathOperator{\Norm}{N}
|
||
|
||
|
||
\DeclareMathOperator{\E}{E}
|
||
\DeclareMathOperator{\Var}{Var}
|
||
\DeclareMathOperator{\Cov}{Cov}
|
||
\renewcommand{\L}{\mathcal{L}}
|
||
|
||
\newcommand{\est}{\widehat}
|
||
\newcommand{\lt}{<}
|
||
\newcommand{\gt}{>}
|
||
\newcommand{\amp}{&}
|
||
\definecolor{fillinmathshade}{gray}{0.9}
|
||
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
|
||
\)</span></div>
|
||
<div class="ptx-page">
|
||
<div id="ptx-sidebar" role="complementary" class="ptx-sidebar"><nav id="ptx-toc" tabindex="-1" aria-label="Contents" class="ptx-toc depth2"><ul class="structural toc-item-list contains-active">
|
||
<li class="toc-item toc-frontmatter"><div class="toc-title-box"><a href="frontmatter.html" class="internal"><span class="title">Front Matter</span></a></div></li>
|
||
<li class="toc-item toc-chapter">
|
||
<div class="toc-title-box"><a href="ch-Introduction.html" class="internal"><span class="codenumber">0</span> <span class="title">Introduction</span></a></div>
|
||
<ul id="ptx-toc-group-ch-Introduction" class="structural toc-item-list"><li class="toc-item toc-section"><div class="toc-title-box"><a href="sec-Introduction.html" class="internal"><span class="codenumber">0.1</span> <span class="title">Introduction</span></a></div></li></ul>
|
||
</li>
|
||
<li class="toc-item toc-chapter">
|
||
<div class="toc-title-box"><a href="ch-Probability.html" class="internal"><span class="codenumber">1</span> <span class="title">Probability Theory</span></a></div>
|
||
<ul id="ptx-toc-group-ch-Probability" class="structural toc-item-list">
|
||
<li class="toc-item toc-introduction"><div class="toc-title-box"><a href="ch-Probability-2.html" class="internal"><span class="title">Introduction</span></a></div></li>
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-Set-Theory.html" class="internal"><span class="codenumber">1.1</span> <span class="title">Set Theory</span></a></div>
|
||
<ul id="ptx-toc-group-sec-Set-Theory" class="structural toc-item-list"><li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-Set-Theory.html#exercises-Set-Theory" class="internal"><span class="codenumber">1.1</span> <span class="title">Exercises</span></a></div></li></ul>
|
||
</li>
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-Probability.html" class="internal"><span class="codenumber">1.2</span> <span class="title">Definition of Probability</span></a></div>
|
||
<ul id="ptx-toc-group-sec-Probability" class="structural toc-item-list"><li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-Probability.html#exercises-Probability" class="internal"><span class="codenumber">1.2</span> <span class="title">Exercises</span></a></div></li></ul>
|
||
</li>
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-Conditional-Probability.html" class="internal"><span class="codenumber">1.3</span> <span class="title">Conditional Probability</span></a></div>
|
||
<ul id="ptx-toc-group-sec-Conditional-Probability" class="structural toc-item-list">
|
||
<li class="toc-item toc-subsection"><div class="toc-title-box"><a href="sec-Conditional-Probability.html#subsec-conditional-probability" class="internal"><span class="codenumber">1.3.1</span> <span class="title">Conditional Probability</span></a></div></li>
|
||
<li class="toc-item toc-subsection"><div class="toc-title-box"><a href="sec-Conditional-Probability.html#subsec-diagnostic-testing" class="internal"><span class="codenumber">1.3.2</span> <span class="title">Diagnostic Testing</span></a></div></li>
|
||
<li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-Conditional-Probability.html#exercises-Conditional-Probability" class="internal"><span class="codenumber">1.3.3</span> <span class="title">Exercises</span></a></div></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-Independent-Events.html" class="internal"><span class="codenumber">1.4</span> <span class="title">Independent Events</span></a></div>
|
||
<ul id="ptx-toc-group-sec-Independent-Events" class="structural toc-item-list"><li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-Independent-Events.html#exercises-Independent-Events" class="internal"><span class="codenumber">1.4</span> <span class="title">Exercises</span></a></div></li></ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="toc-item toc-chapter">
|
||
<div class="toc-title-box"><a href="ch-Random-Variables.html" class="internal"><span class="codenumber">2</span> <span class="title">Random Variables</span></a></div>
|
||
<ul id="ptx-toc-group-ch-Random-Variables" class="structural toc-item-list">
|
||
<li class="toc-item toc-introduction"><div class="toc-title-box"><a href="ch-Random-Variables-2.html" class="internal"><span class="title">Introduction</span></a></div></li>
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-Discrete-RVs.html" class="internal"><span class="codenumber">2.1</span> <span class="title">Discrete Random Variables</span></a></div>
|
||
<ul id="ptx-toc-group-sec-Discrete-RVs" class="structural toc-item-list">
|
||
<li class="toc-item toc-subsection"><div class="toc-title-box"><a href="sec-Discrete-RVs.html#subsec-Discrete-RVs" class="internal"><span class="codenumber">2.1.1</span> <span class="title">Discrete Random Variables</span></a></div></li>
|
||
<li class="toc-item toc-subsection"><div class="toc-title-box"><a href="sec-Discrete-RVs.html#subsec-binomial-distribution" class="internal"><span class="codenumber">2.1.2</span> <span class="title">The Binomial Distribution</span></a></div></li>
|
||
<li class="toc-item toc-subsection"><div class="toc-title-box"><a href="sec-Discrete-RVs.html#subsec-geometric-distribution" class="internal"><span class="codenumber">2.1.3</span> <span class="title">Geometric Distribution</span></a></div></li>
|
||
<li class="toc-item toc-subsection"><div class="toc-title-box"><a href="sec-Discrete-RVs.html#subsec-poisson-distribution" class="internal"><span class="codenumber">2.1.4</span> <span class="title">Poisson Distribution</span></a></div></li>
|
||
<li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-Discrete-RVs.html#exercises-Discrete-RVs" class="internal"><span class="codenumber">2.1.5</span> <span class="title">Exercises</span></a></div></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-Continuous-RVs.html" class="internal"><span class="codenumber">2.2</span> <span class="title">Continuous Random Variables</span></a></div>
|
||
<ul id="ptx-toc-group-sec-Continuous-RVs" class="structural toc-item-list">
|
||
<li class="toc-item toc-subsection"><div class="toc-title-box"><a href="sec-Continuous-RVs.html#subsec-pdfs" class="internal"><span class="codenumber">2.2.1</span> <span class="title">Probability Density Functions</span></a></div></li>
|
||
<li class="toc-item toc-subsection"><div class="toc-title-box"><a href="sec-Continuous-RVs.html#subsec-cdf" class="internal"><span class="codenumber">2.2.2</span> <span class="title">Cumulative Distribution Functions</span></a></div></li>
|
||
<li class="toc-item toc-subsection"><div class="toc-title-box"><a href="sec-Continuous-RVs.html#subsec-exponential-distribution" class="internal"><span class="codenumber">2.2.3</span> <span class="title">The Exponential Distribution</span></a></div></li>
|
||
<li class="toc-item toc-subsection"><div class="toc-title-box"><a href="sec-Continuous-RVs.html#subsec-normal-distribution" class="internal"><span class="codenumber">2.2.4</span> <span class="title">Normal Distribution</span></a></div></li>
|
||
<li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-Continuous-RVs.html#exercises-Continuous-RVs" class="internal"><span class="codenumber">2.2.5</span> <span class="title">Exercises</span></a></div></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-Joint-Distributions.html" class="internal"><span class="codenumber">2.3</span> <span class="title">Joint Distributions</span></a></div>
|
||
<ul id="ptx-toc-group-sec-Joint-Distributions" class="structural toc-item-list"><li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-Joint-Distributions.html#exercises-Joint-Distributions" class="internal"><span class="codenumber">2.3</span> <span class="title">Exercises</span></a></div></li></ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="toc-item toc-chapter">
|
||
<div class="toc-title-box"><a href="ch-Expected-Value.html" class="internal"><span class="codenumber">3</span> <span class="title">Expected Value and Variance</span></a></div>
|
||
<ul id="ptx-toc-group-ch-Expected-Value" class="structural toc-item-list">
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-Expected-Value.html" class="internal"><span class="codenumber">3.1</span> <span class="title">Expected Value</span></a></div>
|
||
<ul id="ptx-toc-group-sec-Expected-Value" class="structural toc-item-list">
|
||
<li class="toc-item toc-subsection"><div class="toc-title-box"><a href="sec-Expected-Value.html#subsec-discrete-EV" class="internal"><span class="codenumber">3.1.1</span> <span class="title">Discrete Expected Value</span></a></div></li>
|
||
<li class="toc-item toc-subsection"><div class="toc-title-box"><a href="sec-Expected-Value.html#subsec-continuous-EV" class="internal"><span class="codenumber">3.1.2</span> <span class="title">Continuous Expected Value</span></a></div></li>
|
||
<li class="toc-item toc-subsection"><div class="toc-title-box"><a href="sec-Expected-Value.html#subsec-linearity-EV" class="internal"><span class="codenumber">3.1.3</span> <span class="title">Linearity of Expected Value</span></a></div></li>
|
||
<li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-Expected-Value.html#exercises-Expected-Value" class="internal"><span class="codenumber">3.1.4</span> <span class="title">Exercises</span></a></div></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-Variance.html" class="internal"><span class="codenumber">3.2</span> <span class="title">Variance</span></a></div>
|
||
<ul id="ptx-toc-group-sec-Variance" class="structural toc-item-list"><li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-Variance.html#exercises-Variance" class="internal"><span class="codenumber">3.2</span> <span class="title">Exercises</span></a></div></li></ul>
|
||
</li>
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-Covariance.html" class="internal"><span class="codenumber">3.3</span> <span class="title">Covariance</span></a></div>
|
||
<ul id="ptx-toc-group-sec-Covariance" class="structural toc-item-list"><li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-Covariance.html#exercises-Covariance" class="internal"><span class="codenumber">3.3</span> <span class="title">Exercises</span></a></div></li></ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="toc-item toc-chapter">
|
||
<div class="toc-title-box"><a href="ch-Confidence-Intervals.html" class="internal"><span class="codenumber">4</span> <span class="title">Confidence Intervals</span></a></div>
|
||
<ul id="ptx-toc-group-ch-Confidence-Intervals" class="structural toc-item-list">
|
||
<li class="toc-item toc-introduction"><div class="toc-title-box"><a href="ch-Confidence-Intervals-2.html" class="internal"><span class="title">Introduction</span></a></div></li>
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-Likelihood.html" class="internal"><span class="codenumber">4.1</span> <span class="title">Likelihood</span></a></div>
|
||
<ul id="ptx-toc-group-sec-Likelihood" class="structural toc-item-list"><li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-Likelihood.html#sec-Likelihood-20" class="internal"><span class="codenumber">4.1</span> <span class="title">Exercises</span></a></div></li></ul>
|
||
</li>
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-CLT.html" class="internal"><span class="codenumber">4.2</span> <span class="title">Central Limit Theorem</span></a></div>
|
||
<ul id="ptx-toc-group-sec-CLT" class="structural toc-item-list"><li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-CLT.html#exercises-CLT" class="internal"><span class="codenumber">4.2</span> <span class="title">Exercises</span></a></div></li></ul>
|
||
</li>
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-Confidence-Intervals.html" class="internal"><span class="codenumber">4.3</span> <span class="title">Confidence Intervals</span></a></div>
|
||
<ul id="ptx-toc-group-sec-Confidence-Intervals" class="structural toc-item-list"><li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-Confidence-Intervals.html#exercises-Confidence-Intervals" class="internal"><span class="codenumber">4.3</span> <span class="title">Exercises</span></a></div></li></ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="toc-item toc-chapter contains-active">
|
||
<div class="toc-title-box"><a href="ch-Hypothesis-Testing.html" class="internal"><span class="codenumber">5</span> <span class="title">Hypothesis Testing</span></a></div>
|
||
<ul class="structural toc-item-list contains-active" id="ptx-toc-group-ch-Hypothesis-Testing">
|
||
<li class="toc-item toc-introduction"><div class="toc-title-box"><a href="ch-Hypothesis-Testing-2.html" class="internal"><span class="title">Introduction</span></a></div></li>
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-One-Sample-Tests.html" class="internal"><span class="codenumber">5.1</span> <span class="title">One Sample Tests</span></a></div>
|
||
<ul id="ptx-toc-group-sec-One-Sample-Tests" class="structural toc-item-list"><li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-One-Sample-Tests.html#exercises-One-Sample-Tests" class="internal"><span class="codenumber">5.1</span> <span class="title">Exercises</span></a></div></li></ul>
|
||
</li>
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-Two-Sample-Tests.html" class="internal"><span class="codenumber">5.2</span> <span class="title">Two Sample Tests</span></a></div>
|
||
<ul id="ptx-toc-group-sec-Two-Sample-Tests" class="structural toc-item-list"><li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-Two-Sample-Tests.html#exercises-Two-Sample-Tests" class="internal"><span class="codenumber">5.2</span> <span class="title">Exercises</span></a></div></li></ul>
|
||
</li>
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-Power.html" class="internal"><span class="codenumber">5.3</span> <span class="title">Power of a Test</span></a></div>
|
||
<ul id="ptx-toc-group-sec-Power" class="structural toc-item-list"><li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-Power.html#exercises-Power" class="internal"><span class="codenumber">5.3</span> <span class="title">Exercises</span></a></div></li></ul>
|
||
</li>
|
||
<li class="toc-item toc-section contains-active">
|
||
<div class="toc-title-box"><a href="sec-Chi-Squared.html" class="internal"><span class="codenumber">5.4</span> <span class="title"><span class="process-math">\(\chi^2\)</span> Test</span></a></div>
|
||
<ul class="structural toc-item-list active" id="ptx-toc-group-sec-Chi-Squared"><li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-Chi-Squared.html#exercises-Chi-Squared" class="internal"><span class="codenumber">5.4</span> <span class="title">Exercises</span></a></div></li></ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="toc-item toc-chapter">
|
||
<div class="toc-title-box"><a href="ch-Linear-Regression.html" class="internal"><span class="codenumber">6</span> <span class="title">Linear Regression</span></a></div>
|
||
<ul id="ptx-toc-group-ch-Linear-Regression" class="structural toc-item-list">
|
||
<li class="toc-item toc-introduction"><div class="toc-title-box"><a href="ch-Linear-Regression-2.html" class="internal"><span class="title">Introduction</span></a></div></li>
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-Correlation.html" class="internal"><span class="codenumber">6.1</span> <span class="title">Correlation</span></a></div>
|
||
<ul id="ptx-toc-group-sec-Correlation" class="structural toc-item-list"><li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-Correlation.html#exercises-Correlation" class="internal"><span class="codenumber">6.1</span> <span class="title">Exercises</span></a></div></li></ul>
|
||
</li>
|
||
<li class="toc-item toc-section">
|
||
<div class="toc-title-box"><a href="sec-Linear-Regression.html" class="internal"><span class="codenumber">6.2</span> <span class="title">Linear Regression</span></a></div>
|
||
<ul id="ptx-toc-group-sec-Linear-Regression" class="structural toc-item-list"><li class="toc-item toc-exercises"><div class="toc-title-box"><a href="sec-Linear-Regression.html#exercises-Linear-Regression" class="internal"><span class="codenumber">6.2</span> <span class="title">Exercises</span></a></div></li></ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="toc-item toc-backmatter">
|
||
<div class="toc-title-box"><a href="backmatter.html" class="internal"><span class="title">Backmatter</span></a></div>
|
||
<ul id="ptx-toc-group-backmatter" class="structural toc-item-list">
|
||
<li class="toc-item toc-appendix">
|
||
<div class="toc-title-box"><a href="backmatter-2.html" class="internal"><span class="codenumber">A</span> <span class="title"><span class="process-math">\(\Phi(z)\)</span> Table</span></a></div>
|
||
<ul id="ptx-toc-group-backmatter-2" class="structural toc-item-list"><li class="toc-item toc-section"><div class="toc-title-box"><a href="app-Phi-table.html" class="internal"><span class="codenumber">A.1</span> <span class="title"><span class="process-math">\(\Phi(z)\)</span> Table of Values</span></a></div></li></ul>
|
||
</li>
|
||
<li class="toc-item toc-appendix">
|
||
<div class="toc-title-box"><a href="backmatter-3.html" class="internal"><span class="codenumber">B</span> <span class="title"><span class="process-math">\(\chi^2\)</span> Critical Values Table</span></a></div>
|
||
<ul id="ptx-toc-group-backmatter-3" class="structural toc-item-list"><li class="toc-item toc-section"><div class="toc-title-box"><a href="app-Chi-squared-table.html" class="internal"><span class="codenumber">B.1</span> <span class="title"><span class="process-math">\(\chi^2\)</span> Critical Values</span></a></div></li></ul>
|
||
</li>
|
||
<li class="toc-item toc-colophon"><div class="toc-title-box"><a href="backmatter-4.html" class="internal"><span class="title">Colophon</span></a></div></li>
|
||
</ul>
|
||
</li>
|
||
</ul></nav></div>
|
||
<main class="ptx-main"><div id="ptx-content" class="ptx-content">
|
||
<section class="section" id="sec-Chi-Squared">
|
||
<h1 class="heading hide-type">
|
||
<span class="type">Section</span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="codenumber">5.4</span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="title"><span class="process-math">\(\chi^2\)</span> Test</span>
|
||
</h1>
|
||
<div class="para" id="sec-Chi-Squared-2">In our previous hypothesis tests, we’ve asked about the correct value of some distribution parameter. But we might also be interested in whether a particular type of distribution fits the data in the first place. In this situation, we can try to measure the extent to which the observed data differs from what would be expected under a particular distribution.<div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#sec-Chi-Squared-2" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div>
|
||
<article class="definition definition-like" id="def-chi-squared"><h2 class="heading">
|
||
<span class="type">Definition</span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="codenumber">5.4.1</span><span class="period heading-divison-mark heading-divison-mark__period">.</span>
|
||
</h2>
|
||
<div class="para logical" id="def-chi-squared-1-1">
|
||
<div class="para">Suppose <span class="process-math">\(O_1, \dotsc, O_n\)</span> are observed data with expected values <span class="process-math">\(E_1, \dotsc, E_n\text{.}\)</span> The <dfn class="terminology"><span class="process-math">\(\chi^2\)</span> statistic</dfn> is:</div>
|
||
<div class="displaymath process-math" id="def-chi-squared-1-1-4">
|
||
\begin{gather*}
|
||
\chi^2 = \sum_{i=1}^n \frac{(O_i - E_i)^2}{E_i}.
|
||
\end{gather*}
|
||
</div>
|
||
<div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#def-chi-squared-1-1" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div>
|
||
<div class="autopermalink" aria-hidden="true" data-description="Definition 5.4.1"><a tabindex="-1" href="#def-chi-squared" title="Copy heading and permalink for Definition 5.4.1" aria-label="Copy heading and permalink for Definition 5.4.1">🔗</a></div>
|
||
</article>
|
||
<div class="para" id="sec-Chi-Squared-4">The expression <span class="process-math">\(O_i - E_i\)</span> directly measures the difference between an observation and its expected value. However, if we simply summed up these differences, then one observation which is higher than its expected value and another that’s lower would have differences that cancel out. Squaring the term ensures that any difference contributes positively when summed together. And dividing by <span class="process-math">\(E_i\)</span> ensures that the differences are expressed relative to the size of the expected value. A difference of <span class="process-math">\(0.1\)</span> might sound like a small difference, but it would have a different interpretation if the expected value is <span class="process-math">\(100\)</span> than if the expected value is <span class="process-math">\(0.01\text{.}\)</span><div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#sec-Chi-Squared-4" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div>
|
||
<div class="para" id="sec-Chi-Squared-5">So the overall number <span class="process-math">\(\chi^2\)</span> is designed to be a measurement of how much the observed data differs from expectation. It seems like <span class="process-math">\(\chi^2\)</span> could be higher or lower simply as the result of the number of terms involved in the summation. How much difference is enough to reject the distribution which generated those expected values? It seems that it should depend on that number of terms.<div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#sec-Chi-Squared-5" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div>
|
||
<article class="definition definition-like" id="def-degrees-of-freedom-1"><h2 class="heading">
|
||
<span class="type">Definition</span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="codenumber">5.4.2</span><span class="period heading-divison-mark heading-divison-mark__period">.</span>
|
||
</h2>
|
||
<div class="para" id="def-degrees-of-freedom-1-1-1">If the data collected fall into <span class="process-math">\(n\)</span> categories, then we will say that there are <span class="process-math">\(n - 1\)</span> <dfn class="terminology">degrees of freedom</dfn>.<div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#def-degrees-of-freedom-1-1-1" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div>
|
||
<div class="autopermalink" aria-hidden="true" data-description="Definition 5.4.2"><a tabindex="-1" href="#def-degrees-of-freedom-1" title="Copy heading and permalink for Definition 5.4.2" aria-label="Copy heading and permalink for Definition 5.4.2">🔗</a></div>
|
||
</article>
|
||
<div class="para" id="sec-Chi-Squared-7">Suppose our data comes from polling <span class="process-math">\(100\)</span> respondents and arranging their responses into <span class="process-math">\(n\)</span> categories. Then, if we know how many people fall into categories <span class="process-math">\(1, 2, \dotsc, n-1\text{,}\)</span> we will automatically know how many people fall into the final category, simply because the total number of respondents is already known.<div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#sec-Chi-Squared-7" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div>
|
||
<div class="para" id="sec-Chi-Squared-8">For each different number of degrees of freedom, there will be a different critical value of the <span class="process-math">\(\chi^2\)</span> statistic, above which we’ll say that the data differs sufficiently from expectation for us to reject the distribution being tested. A table of critical <span class="process-math">\(\chi^2\)</span> values is provided in <a href="app-Chi-squared-table.html" class="internal" title="Section B.1: \chi^2 Critical Values">Section B.1</a>.<div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#sec-Chi-Squared-8" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div>
|
||
<article class="example example-like" id="sec-Chi-Squared-9"><h2 class="heading">
|
||
<span class="type">Example</span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="codenumber">5.4.3</span><span class="period heading-divison-mark heading-divison-mark__period">.</span>
|
||
</h2>
|
||
<div class="para" id="sec-Chi-Squared-9-1-1">Suppose <span class="process-math">\(100\)</span> people are surveyed about their favorite color among four choices. The results are below. Is this data consistent with the hypothesis that each of the four colors is equally likely to be a favorite?<div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#sec-Chi-Squared-9-1-1" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div> <div class="tabular-box natural-width"><table class="tabular">
|
||
<tr class="header-horizontal">
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">Color</th>
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">Chosen as Favorite</th>
|
||
</tr>
|
||
<tr>
|
||
<td class="c m b0 r0 l0 t0 lines">Blue</td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(37\)</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="c m b0 r0 l0 t0 lines">Green</td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(26\)</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="c m b0 r0 l0 t0 lines">Purple</td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(15\)</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="c m b0 r0 l0 t0 lines">Red</td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(22\)</span></td>
|
||
</tr>
|
||
</table></div>
|
||
<div class="para logical" id="sec-Chi-Squared-9-1-3">
|
||
<div class="para">In this case, if each color is equally likely to be a favorite, then we would expect <span class="process-math">\(25\)</span> respondents to choose each color. So the <span class="process-math">\(\chi^2\)</span> statistic is:</div>
|
||
<div class="displaymath process-math" data-contains-math-knowls="./knowl/xref/table-Chi-squared.html" id="sec-Chi-Squared-9-1-3-3">
|
||
\begin{gather*}
|
||
\chi^2 = \frac{(37 - 25)^2}{25} + \frac{(26 - 25)^2}{25} + \frac{(15 - 25)^2}{25} + \frac{(22 - 25)^2}{25} = 10.16.
|
||
\end{gather*}
|
||
</div>
|
||
<div class="para">Since the data fall into four categories, the number of degrees of freedom is <span class="process-math">\(4 - 1 = 3\text{.}\)</span> From the table in <a href="app-Chi-squared-table.html#table-Chi-squared" class="xref" data-knowl="./knowl/xref/table-Chi-squared.html" data-reveal-label="Reveal" data-close-label="Close" title="Table B.1.1: \chi^2 Critical Values">Table B.1.1</a>, the critical value is <span class="process-math">\(7.815\text{.}\)</span> Since <span class="process-math">\(10.16 \gt 7.815\text{,}\)</span> our collected data is sufficiently different to reject the hypothesis of equal color preferences.</div>
|
||
<div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#sec-Chi-Squared-9-1-3" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div>
|
||
<div class="autopermalink" aria-hidden="true" data-description="Example 5.4.3"><a tabindex="-1" href="#sec-Chi-Squared-9" title="Copy heading and permalink for Example 5.4.3" aria-label="Copy heading and permalink for Example 5.4.3">🔗</a></div>
|
||
</article>
|
||
<div class="para" id="sec-Chi-Squared-10">In the previous example, we’re testing an <dfn class="terminology">extrinsic hypothesis</dfn>, i.e., a hypothesis made entirely without reference to the data. Knowing that we planned to poll <span class="process-math">\(100\)</span> people, we could determine our expected values for this hypothesis before even conducting the survey. However, sometimes we need to use the collected data to estimate the value(s) of one or more parameters of a distribution. In such a situation, we say the hypothesis is <dfn class="terminology">intrinsic</dfn>, and we adjust our calculation of degrees of freedom.<div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#sec-Chi-Squared-10" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div>
|
||
<article class="definition definition-like" id="def-degrees-of-freedom-2"><h2 class="heading">
|
||
<span class="type">Definition</span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="codenumber">5.4.4</span><span class="period heading-divison-mark heading-divison-mark__period">.</span>
|
||
</h2>
|
||
<div class="para" id="def-degrees-of-freedom-2-1-1">Suppose it takes <span class="process-math">\(m\)</span> measurements to fully specify the collected data, and suppose there are <span class="process-math">\(k\)</span> parameters that are estimated using the data. Then the number of <dfn class="terminology">degrees of freedom</dfn> is <span class="process-math">\(m - k\)</span><div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#def-degrees-of-freedom-2-1-1" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div>
|
||
<div class="autopermalink" aria-hidden="true" data-description="Definition 5.4.4"><a tabindex="-1" href="#def-degrees-of-freedom-2" title="Copy heading and permalink for Definition 5.4.4" aria-label="Copy heading and permalink for Definition 5.4.4">🔗</a></div>
|
||
</article>
|
||
<article class="example example-like" id="sec-Chi-Squared-12"><h2 class="heading">
|
||
<span class="type">Example</span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="codenumber">5.4.5</span><span class="period heading-divison-mark heading-divison-mark__period">.</span>
|
||
</h2>
|
||
<div class="para" id="sec-Chi-Squared-12-1-1">Is the data below consistent with a geometric distribution?<div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#sec-Chi-Squared-12-1-1" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div> <div class="tabular-box natural-width"><table class="tabular">
|
||
<tr class="header-horizontal">
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">Number</th>
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">Observation</th>
|
||
</tr>
|
||
<tr>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(1\)</span></td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(59\)</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(2\)</span></td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(21\)</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(3\)</span></td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(11\)</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(4\)</span></td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(8\)</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(5\)</span></td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(1\)</span></td>
|
||
</tr>
|
||
</table></div>
|
||
<div class="para logical" id="sec-Chi-Squared-12-1-3">
|
||
<div class="para">In order to compare this data to a geometric distribution, we would need to know the value of the parameter <span class="process-math">\(\theta\)</span> for the distribution. Based on the collected data, we could provide a maximum likelihood estimate:</div>
|
||
<div class="displaymath process-math" data-contains-math-knowls="./knowl/xref/fact-geometric-probability-formula.html" id="sec-Chi-Squared-12-1-3-2">
|
||
\begin{align*}
|
||
\widehat{\theta} \amp = \frac{59 + 21 + 11 + 8 + 1}{1 \cdot 59 + 2\cdot 21 + 3\cdot 11 + 4\cdot 8 + 5\cdot 1} \\
|
||
\amp = \frac{100}{171} \\
|
||
\amp \approx 0.58.
|
||
\end{align*}
|
||
</div>
|
||
<div class="para">We can use <a href="sec-Discrete-RVs.html#fact-geometric-probability-formula" class="xref" data-knowl="./knowl/xref/fact-geometric-probability-formula.html" data-reveal-label="Reveal" data-close-label="Close" title="Fact 2.1.14: Geometric Probability Formula">Fact 2.1.14</a> with the parameter value <span class="process-math">\(0.58\)</span> to generate expected values for our data. For example:</div>
|
||
<div class="displaymath process-math" data-contains-math-knowls="./knowl/xref/fact-geometric-probability-formula.html" id="sec-Chi-Squared-12-1-3-5">
|
||
\begin{align*}
|
||
g(2; 0.58) \amp = (1 - 0.58)^{1}(0.58) = 0.2436,
|
||
\end{align*}
|
||
</div>
|
||
<div class="para">so we would expect <span class="process-math">\(0.2436 \times 100 = 24.36\)</span> observations for the number <span class="process-math">\(2\text{.}\)</span> The rest of the expected values are calculated similarly:</div>
|
||
<div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#sec-Chi-Squared-12-1-3" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div> <div class="tabular-box natural-width"><table class="tabular">
|
||
<tr class="header-horizontal">
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">Number</th>
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">Observation</th>
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">Expected</th>
|
||
</tr>
|
||
<tr>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(1\)</span></td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(59\)</span></td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(58\)</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(2\)</span></td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(21\)</span></td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(24.36\)</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(3\)</span></td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(11\)</span></td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(10.23\)</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(4\)</span></td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(8\)</span></td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(4.30\)</span></td>
|
||
</tr>
|
||
<tr>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(5\)</span></td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(1\)</span></td>
|
||
<td class="c m b0 r0 l0 t0 lines"><span class="process-math">\(1.80\)</span></td>
|
||
</tr>
|
||
</table></div>
|
||
<div class="para logical" id="sec-Chi-Squared-12-1-5">
|
||
<div class="para">Now we can calculate the <span class="process-math">\(\chi^2\)</span> statistic:</div>
|
||
<div class="displaymath process-math" id="sec-Chi-Squared-12-1-5-2">
|
||
\begin{align*}
|
||
\chi^2 \amp = \frac{(59 - 58)^2}{58} + \dotsb + \frac{(1 - 1.8)^2}{1.8} \approx 4.08.
|
||
\end{align*}
|
||
</div>
|
||
<div class="para">With <span class="process-math">\(5\)</span> categories, it takes <span class="process-math">\(4\)</span> measurements to fully specify the data. Then, we used the data itself to estimate the value of one parameter, <span class="process-math">\(\widehat{\theta}\text{.}\)</span> So the number of degrees of freedom is <span class="process-math">\(4 - 1 = 3\text{,}\)</span> with critical <span class="process-math">\(\chi^2\)</span> value <span class="process-math">\(7.815\text{.}\)</span> Since <span class="process-math">\(4.08 \lt 7.815\text{,}\)</span> our data is not sufficiently different from expected to reject the hypothesis of a geometric distribution.</div>
|
||
<div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#sec-Chi-Squared-12-1-5" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div>
|
||
<div class="autopermalink" aria-hidden="true" data-description="Example 5.4.5"><a tabindex="-1" href="#sec-Chi-Squared-12" title="Copy heading and permalink for Example 5.4.5" aria-label="Copy heading and permalink for Example 5.4.5">🔗</a></div>
|
||
</article>
|
||
<section class="exercises" id="exercises-Chi-Squared">
|
||
<h2 class="heading hide-type">
|
||
<span class="type">Exercises</span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="codenumber"></span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="title">Exercises</span>
|
||
</h2>
|
||
<article class="exercise exercise-like" id="exercises-Chi-Squared-1"><h3 class="heading"><span class="codenumber">1<span class="period heading-divison-mark heading-divison-mark__period">.</span></span></h3>
|
||
<div class="para" id="exercises-Chi-Squared-1-1-1">A store owner wants to determine how much shelf space to allocate to each of the drinks that they sell. They survey their customers about their favorite drinks. Is the data below consistent with the null hypothesis that each type of drink will be equally preferred?<div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#exercises-Chi-Squared-1-1-1" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div>
|
||
<figure class="table table-like" id="exercises-Chi-Squared-1-1-2"><figcaption><span class="type">Table</span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="codenumber">5.4.6<span class="period heading-divison-mark heading-divison-mark__period">.</span></span><span class="space heading-divison-mark heading-divison-mark__space"> </span><div class="autopermalink" aria-hidden="true" data-description="Table 5.4.6: "><a tabindex="-1" href="#exercises-Chi-Squared-1-1-2" title="Copy heading and permalink for Table 5.4.6: " aria-label="Copy heading and permalink for Table 5.4.6: ">🔗</a></div></figcaption><div class="tabular-box natural-width"><table class="tabular">
|
||
<tr class="header-horizontal">
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">drink type</th>
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">water</th>
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">soda</th>
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">tea</th>
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">coffee</th>
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">energy drinks</th>
|
||
</tr>
|
||
<tr>
|
||
<td class="c m b0 r0 l0 t0 lines">favorite</td>
|
||
<td class="c m b0 r0 l0 t0 lines">28</td>
|
||
<td class="c m b0 r0 l0 t0 lines">17</td>
|
||
<td class="c m b0 r0 l0 t0 lines">15</td>
|
||
<td class="c m b0 r0 l0 t0 lines">26</td>
|
||
<td class="c m b0 r0 l0 t0 lines">14</td>
|
||
</tr>
|
||
</table></div>
|
||
</figure><div class="autopermalink" aria-hidden="true" data-description="Exercise 5.4.1"><a tabindex="-1" href="#exercises-Chi-Squared-1" title="Copy heading and permalink for Exercise 5.4.1" aria-label="Copy heading and permalink for Exercise 5.4.1">🔗</a></div>
|
||
</article>
|
||
<article class="exercise exercise-like" id="exercises-Chi-Squared-2"><h3 class="heading"><span class="codenumber">2<span class="period heading-divison-mark heading-divison-mark__period">.</span></span></h3>
|
||
<div class="introduction" id="exercises-Chi-Squared-2-1">
|
||
<div class="para" id="exercises-Chi-Squared-2-1-1">A particular drug is administered in 100 independent trials. In each trial, the drug is administered to four people, and we count how many respond to the drug. The table below shows how many trials have each different count of people who respond to the drug.<div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#exercises-Chi-Squared-2-1-1" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div>
|
||
<figure class="table table-like" id="exercises-Chi-Squared-2-1-2"><figcaption><span class="type">Table</span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="codenumber">5.4.7<span class="period heading-divison-mark heading-divison-mark__period">.</span></span><span class="space heading-divison-mark heading-divison-mark__space"> </span><div class="autopermalink" aria-hidden="true" data-description="Table 5.4.7: "><a tabindex="-1" href="#exercises-Chi-Squared-2-1-2" title="Copy heading and permalink for Table 5.4.7: " aria-label="Copy heading and permalink for Table 5.4.7: ">🔗</a></div></figcaption><div class="tabular-box natural-width"><table class="tabular">
|
||
<tr class="header-horizontal">
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines"># who respond to drug</th>
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">0</th>
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">1</th>
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">2</th>
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">3</th>
|
||
<th scope="col" class="c m b1 r0 l0 t0 lines">4</th>
|
||
</tr>
|
||
<tr>
|
||
<td class="c m b0 r0 l0 t0 lines"># of trials</td>
|
||
<td class="c m b0 r0 l0 t0 lines">3</td>
|
||
<td class="c m b0 r0 l0 t0 lines">11</td>
|
||
<td class="c m b0 r0 l0 t0 lines">31</td>
|
||
<td class="c m b0 r0 l0 t0 lines">34</td>
|
||
<td class="c m b0 r0 l0 t0 lines">21</td>
|
||
</tr>
|
||
</table></div>
|
||
</figure>
|
||
</div>
|
||
<article class="task exercise-like" id="exercises-Chi-Squared-2-2"><h4 class="heading"><span class="codenumber">(a)</span></h4>
|
||
<div class="para" id="exercises-Chi-Squared-2-2-1-1">Is the data consistent with a binomial distribution with parameter <span class="process-math">\(p = 0.7\text{?}\)</span><div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#exercises-Chi-Squared-2-2-1-1" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div>
|
||
<div class="autopermalink" aria-hidden="true" data-description="Task 5.4.2.a"><a tabindex="-1" href="#exercises-Chi-Squared-2-2" title="Copy heading and permalink for Task 5.4.2.a" aria-label="Copy heading and permalink for Task 5.4.2.a">🔗</a></div>
|
||
</article>
|
||
<article class="task exercise-like" id="exercises-Chi-Squared-2-3"><h4 class="heading"><span class="codenumber">(b)</span></h4>
|
||
<div class="para" id="exercises-Chi-Squared-2-3-1-1">What is the total number of people who have been administered the drug? What is the total number who have responded to it? What is the maximum likelihood estimation for the probability <span class="process-math">\(p\)</span> that a person will respond to the drug?<div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#exercises-Chi-Squared-2-3-1-1" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div>
|
||
<div class="autopermalink" aria-hidden="true" data-description="Task 5.4.2.b"><a tabindex="-1" href="#exercises-Chi-Squared-2-3" title="Copy heading and permalink for Task 5.4.2.b" aria-label="Copy heading and permalink for Task 5.4.2.b">🔗</a></div>
|
||
</article>
|
||
<article class="task exercise-like" id="exercises-Chi-Squared-2-4"><h4 class="heading"><span class="codenumber">(c)</span></h4>
|
||
<div class="para" id="exercises-Chi-Squared-2-4-1-1">Is the data consistent with a binomial distribution with the MLE value of <span class="process-math">\(p\text{?}\)</span><div class="autopermalink" aria-hidden="true" data-description="Paragraph"><a tabindex="-1" href="#exercises-Chi-Squared-2-4-1-1" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||
</div>
|
||
<div class="autopermalink" aria-hidden="true" data-description="Task 5.4.2.c"><a tabindex="-1" href="#exercises-Chi-Squared-2-4" title="Copy heading and permalink for Task 5.4.2.c" aria-label="Copy heading and permalink for Task 5.4.2.c">🔗</a></div>
|
||
</article><div class="autopermalink" aria-hidden="true" data-description="Exercise 5.4.2"><a tabindex="-1" href="#exercises-Chi-Squared-2" title="Copy heading and permalink for Exercise 5.4.2" aria-label="Copy heading and permalink for Exercise 5.4.2">🔗</a></div>
|
||
</article><div class="autopermalink" aria-hidden="true" data-description="Exercises 5.4"><a tabindex="-1" href="#exercises-Chi-Squared" title="Copy heading and permalink for Exercises 5.4" aria-label="Copy heading and permalink for Exercises 5.4">🔗</a></div>
|
||
</section><div class="autopermalink" aria-hidden="true" data-description="Section 5.4: \chi^2 Test"><a tabindex="-1" href="#sec-Chi-Squared" title="Copy heading and permalink for Section 5.4: \chi^2 Test" aria-label="Copy heading and permalink for Section 5.4: \chi^2 Test">🔗</a></div>
|
||
</section>
|
||
</div>
|
||
<div id="ptx-content-footer" class="ptx-content-footer">
|
||
<a class="previous-button button" href="sec-Power.html" title="Previous"><span class="icon material-symbols-outlined" aria-hidden="true"></span><span class="name">Prev</span></a><a class="top-button button" href="#" title="Top"><span class="icon material-symbols-outlined" aria-hidden="true"></span><span class="name">Top</span></a><a class="next-button button" href="ch-Linear-Regression.html" title="Next"><span class="name">Next</span><span class="icon material-symbols-outlined" aria-hidden="true"></span></a>
|
||
</div></main>
|
||
</div>
|
||
<div id="ptx-page-footer" class="ptx-page-footer">
|
||
<a class="pretext-link" href="https://pretextbook.org" title="PreTeXt"><div class="logo"><svg xmlns="http://www.w3.org/2000/svg" height="100%" viewBox="338 3000 8772 6866" role="img"><title>PreTeXt logo</title><g style="stroke-width:.025in; stroke:currentColor; fill:none"><polyline points="472,3590 472,9732 " style="stroke-width:174; stroke-linejoin:miter; stroke-linecap:round; "></polyline><path style="stroke-width:126;stroke-linecap:butt;" d="M 4724,9448 A 4660 4660 0 0 1 8598 9259"></path><path style="stroke-width:174;stroke-linecap:butt;" d="M 4488,9685 A 4228 4228 0 0 0 472 9732"></path><path style="stroke-width:126;stroke-linecap:butt;" d="M 4724,3590 A 4241 4241 0 0 1 8598 3496"></path><path style="stroke-width:126;stroke-linecap:round;" d="M 850,3496 A 4241 4241 0 0 1 4724 3590"></path><path style="stroke-width:126;stroke-linecap:round;" d="M 850,9259 A 4507 4507 0 0 1 4724 9448"></path><polyline points="5385,4299 4062,8125" style="stroke-width:300; stroke-linejoin:miter; stroke-linecap:round;"></polyline><polyline points="8598,3496 8598,9259" style="stroke-width:126; stroke-linejoin:miter; stroke-linecap:round;"></polyline><polyline points="850,3496 850,9259" style="stroke-width:126; stroke-linejoin:miter; stroke-linecap:round;"></polyline><polyline points="4960,9685 4488,9685" style="stroke-width:174; stroke-linejoin:miter; stroke-linecap:round;"></polyline><polyline points="3070,4582 1889,6141 3070,7700" style="stroke-width:300; stroke-linejoin:miter; stroke-linecap:round;"></polyline><polyline points="6418,4582 7600,6141 6418,7700" style="stroke-width:300; stroke-linejoin:miter; stroke-linecap:round;"></polyline><polyline points="8976,3590 8976,9732" style="stroke-width:174; stroke-linejoin:miter; stroke-linecap:round;"></polyline><path style="stroke-width:174;stroke-linecap:butt;" d="M 4960,9685 A 4228 4228 0 0 1 8976 9732"></path></g></svg></div></a><a class="runestone-link" href="https://runestone.academy" title="Runestone Academy"><img class="logo" src="https://runestone.academy/runestone/static/images/RAIcon_cropped.png" alt="Runstone Academy logo"></a><a class="mathjax-link" href="https://www.mathjax.org" title="MathJax"><img class="logo" src="https://www.mathjax.org/badge/badge-square-2.png" alt="MathJax logo"></a>
|
||
</div>
|
||
</body>
|
||
</html>
|