Latest build deployed.
This commit is contained in:
+109
-5
@@ -101,15 +101,15 @@ eBookConfig.allow_pairs = false;
|
||||
eBookConfig.enableScratchAC = false;
|
||||
eBookConfig.build_info = "";
|
||||
eBookConfig.python3 = null;
|
||||
eBookConfig.runestone_version = '7.11.15';
|
||||
eBookConfig.runestone_version = '7.11.19';
|
||||
eBookConfig.jobehost = '';
|
||||
eBookConfig.proxyuri_runs = '';
|
||||
eBookConfig.proxyuri_files = '';
|
||||
eBookConfig.enable_chatcodes = false;
|
||||
</script>
|
||||
<!--*** Runestone Services ***-->
|
||||
<script src="_static/prefix-runtime.529fd9398bfbd03e.bundle.js"></script><script src="_static/prefix-723.3e6434f80549315a.bundle.js"></script><script src="_static/prefix-runestone.1d6e4aba17c2c7f2.bundle.js"></script><link rel="stylesheet" type="text/css" href="_static/prefix-723.3bccd435914aa0ff.css">
|
||||
<link rel="stylesheet" type="text/css" href="_static/prefix-runestone.6ec5960970d8b364.css">
|
||||
<script src="_static/prefix-runtime.998c9d9ee2a5e7ac.bundle.js"></script><script src="_static/prefix-723.3e6434f80549315a.bundle.js"></script><script src="_static/prefix-runestone.98ef3b0c170cd180.bundle.js"></script><link rel="stylesheet" type="text/css" href="_static/prefix-723.3bccd435914aa0ff.css">
|
||||
<link rel="stylesheet" type="text/css" href="_static/prefix-runestone.b12a7b3f0773ebcd.css">
|
||||
<script src="_static/pretext/js/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/pretext_search.js"></script><script src="_static/pretext/js/knowl.js"></script><!--knowl.js code controls Sage Cells within knowls--><script>sagecellEvalName='Evaluate (Sage)';
|
||||
</script>
|
||||
</head>
|
||||
@@ -309,9 +309,113 @@ eBookConfig.enable_chatcodes = false;
|
||||
<main class="ptx-main"><div id="ptx-content" class="ptx-content"><section class="section" id="sec-One-Sample-Tests"><h2 class="heading hide-type">
|
||||
<span class="type">Section</span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="codenumber">5.1</span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="title">One Sample Tests</span>
|
||||
</h2>
|
||||
<div class="para" id="sec-One-Sample-Tests-2">Text of section.<div class="autopermalink" data-description="Paragraph"><a href="#sec-One-Sample-Tests-2" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||||
<article class="example example-like" id="sec-One-Sample-Tests-2"><h3 class="heading">
|
||||
<span class="type">Example</span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="codenumber">5.1.1</span><span class="period heading-divison-mark heading-divison-mark__period">.</span>
|
||||
</h3>
|
||||
<div class="para" id="sec-One-Sample-Tests-2-1-1">Suppose 10% of the general population is left-handed. In a sample of 100 patients with carpal tunnel syndrome, 16 are found to be left-handed. Is this evidence that the proportion of left-handedness is higher among carpal tunnel syndrome patients than among the general population?<div class="autopermalink" data-description="Paragraph"><a href="#sec-One-Sample-Tests-2-1-1" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||||
</div>
|
||||
<section class="exercises" id="exercises-One-Sample-Tests"><h3 class="heading hide-type">
|
||||
<div class="autopermalink" data-description="Example 5.1.1"><a href="#sec-One-Sample-Tests-2" title="Copy heading and permalink for Example 5.1.1" aria-label="Copy heading and permalink for Example 5.1.1">🔗</a></div></article><div class="para" id="sec-One-Sample-Tests-3">We would like to develop a framework through which we can analyze whether data we’ve collected provides evidence for a particular hypothesis. In fact, we will generally consider two hypotheses:<div class="autopermalink" data-description="Paragraph"><a href="#sec-One-Sample-Tests-3" 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-null-hypothesis"><h3 class="heading">
|
||||
<span class="type">Definition</span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="codenumber">5.1.2</span><span class="period heading-divison-mark heading-divison-mark__period">.</span>
|
||||
</h3>
|
||||
<div class="para" id="def-null-hypothesis-1-1">The <dfn class="terminology">null hypothesis</dfn>, often denoted <span class="process-math">\(H_0\text{,}\)</span> is the assumption that an effect being studied or proposed does not exist. The <dfn class="terminology">alternative hypothesis</dfn>, <span class="process-math">\(H_a\text{,}\)</span> is the claim that the effect does exist.<div class="autopermalink" data-description="Paragraph"><a href="#def-null-hypothesis-1-1" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||||
</div>
|
||||
<div class="autopermalink" data-description="Definition 5.1.2"><a href="#def-null-hypothesis" title="Copy heading and permalink for Definition 5.1.2" aria-label="Copy heading and permalink for Definition 5.1.2">🔗</a></div></article><div class="para logical" id="sec-One-Sample-Tests-5">
|
||||
<div class="para">In the previous example, if we write <span class="process-math">\(\theta\)</span> for the true proportion of left-handed people among the population with carpal tunnel syndrome, the null hypothesis would be that this proportion is the same as the general population. The alternative hypothesis might be, for example, that the proportion is higher than among the general population:</div>
|
||||
<div class="displaymath process-math" id="sec-One-Sample-Tests-5-2">
|
||||
\begin{align*}
|
||||
H_0: \theta \amp = 0.1 \\
|
||||
H_a: \theta \amp \gt 0.1
|
||||
\end{align*}
|
||||
</div>
|
||||
<div class="autopermalink" data-description="Paragraph"><a href="#sec-One-Sample-Tests-5" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||||
</div>
|
||||
<div class="para" id="sec-One-Sample-Tests-6">After performing an experiment, we will either accept or reject the null hypothesis based on the data we collect. Consider the following scenarios:<div class="autopermalink" data-description="Paragraph"><a href="#sec-One-Sample-Tests-6" 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>
|
||||
<td class="c m b0 r0 l0 t0 lines"></td>
|
||||
<td class="c m b1 r0 l0 t0 lines">accept <span class="process-math">\(H_0\)</span>
|
||||
</td>
|
||||
<td class="c m b1 r0 l0 t0 lines">reject <span class="process-math">\(H_0\)</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="c m b0 r1 l0 t0 lines">
|
||||
<span class="process-math">\(H_0\)</span> true</td>
|
||||
<td class="c m b0 r0 l0 t0 lines">correct</td>
|
||||
<td class="c m b0 r0 l0 t0 lines">type I error</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="c m b0 r1 l0 t0 lines">
|
||||
<span class="process-math">\(H_0\)</span> false</td>
|
||||
<td class="c m b0 r0 l0 t0 lines">type II error</td>
|
||||
<td class="c m b0 r0 l0 t0 lines">correct</td>
|
||||
</tr>
|
||||
</table></div>
|
||||
<div class="para" id="sec-One-Sample-Tests-8">We’ll use the notation <span class="process-math">\(\alpha\)</span> for the probability of making a type I error, also called the <dfn class="terminology">significance level</dfn>, and <span class="process-math">\(\beta\)</span> for the probability of making a type II error. The <dfn class="terminology">power</dfn> of a test is the probability of correctly rejecting <span class="process-math">\(H_0\text{,}\)</span> i.e., <span class="process-math">\(1 - \beta\text{.}\)</span><div class="autopermalink" data-description="Paragraph"><a href="#sec-One-Sample-Tests-8" 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-p-value"><h3 class="heading">
|
||||
<span class="type">Definition</span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="codenumber">5.1.3</span><span class="period heading-divison-mark heading-divison-mark__period">.</span>
|
||||
</h3>
|
||||
<div class="para" id="def-p-value-1-1">The <dfn class="terminology"><span class="process-math">\(p\)</span>-value</dfn> is the probability of observing a result at least as extreme as measured if <span class="process-math">\(H_0\)</span> is true.<div class="autopermalink" data-description="Paragraph"><a href="#def-p-value-1-1" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||||
</div>
|
||||
<div class="autopermalink" data-description="Definition 5.1.3"><a href="#def-p-value" title="Copy heading and permalink for Definition 5.1.3" aria-label="Copy heading and permalink for Definition 5.1.3">🔗</a></div></article><article class="example example-like" id="sec-One-Sample-Tests-10"><h3 class="heading">
|
||||
<span class="type">Example</span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="codenumber">5.1.4</span><span class="period heading-divison-mark heading-divison-mark__period">.</span>
|
||||
</h3>
|
||||
<div class="para logical" id="sec-One-Sample-Tests-10-1-1">
|
||||
<div class="para">Continuing the previous example, under <span class="process-math">\(H_0\)</span> that <span class="process-math">\(\theta = 0.1\text{,}\)</span> the probability of seeing at least 16 left-handed people in a sample of 100 people would be:</div>
|
||||
<div class="displaymath process-math" id="sec-One-Sample-Tests-10-1-1-3">
|
||||
\begin{gather*}
|
||||
\sum_{k = 16}^{100} {100 \choose k} (0.1)^k (1 - 0.1)^{100 - k} \approx 0.04,
|
||||
\end{gather*}
|
||||
</div>
|
||||
<div class="para">which is our <span class="process-math">\(p\)</span>-value.</div>
|
||||
<div class="autopermalink" data-description="Paragraph"><a href="#sec-One-Sample-Tests-10-1-1" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||||
</div>
|
||||
<div class="autopermalink" data-description="Example 5.1.4"><a href="#sec-One-Sample-Tests-10" title="Copy heading and permalink for Example 5.1.4" aria-label="Copy heading and permalink for Example 5.1.4">🔗</a></div></article><div class="para" id="sec-One-Sample-Tests-11">The goal of our calculation is to control the chance of making a type I error by choosing a significance level cutoff, often 0.05. If our calculated <span class="process-math">\(p\)</span>-value is below the cutoff, then reject <span class="process-math">\(H_0\text{.}\)</span> Otherwise, accept <span class="process-math">\(H_0\text{.}\)</span> In the previous example, we would reject <span class="process-math">\(H_0\text{,}\)</span> because it appears that the data we collected is pretty unlikely to see if the null hypothesis were true. We would accept that, about 4% of the time if the null hypothesis <em class="emphasis">is</em> true, we would see data at least this extreme, and therefore make a mistake by rejecting <span class="process-math">\(H_0\text{.}\)</span><div class="autopermalink" data-description="Paragraph"><a href="#sec-One-Sample-Tests-11" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||||
</div>
|
||||
<div class="para logical" id="sec-One-Sample-Tests-12">
|
||||
<div class="para">The test we just applied is called <dfn class="terminology">1-tailed</dfn>. The alternative hypothesis <span class="process-math">\(\theta \gt 0.1\)</span> proposed that <span class="process-math">\(\theta\)</span> was different from 0.1 in a specific direction. For a <dfn class="terminology">2-tailed</dfn> test, we could use the alternative hypothesis that <span class="process-math">\(\theta \neq 0.1\text{.}\)</span> In this setting, the idea of data "at least as extreme" as what was measured is reframed. We measured 16 left-handed people in a sample of 100, which is 6 more than we would expect under the null hypothesis. So we should also include the possibility of seeing at least 6 fewer left-handed people in the sample than expected:</div>
|
||||
<div class="displaymath process-math" id="sec-One-Sample-Tests-12-6">
|
||||
\begin{align*}
|
||||
p\text{-value} \amp = \Pr(\geq 16 \text{ left-handed people}) + \Pr(\leq 4 \text{ left-handed people}) \\
|
||||
\amp = \left(\sum_{k = 16}^{100} {100 \choose k} (0.1)^k (0.9)^{100 - k}\right) + \left(\sum_{k = 0}^{4} {100 \choose k} (0.1)^k (0.9)^{100 - k}\right) \\
|
||||
\amp \approx 0.064 \gt 0.05,
|
||||
\end{align*}
|
||||
</div>
|
||||
<div class="para">so, using a 2-tailed test, we would fail to reject the null hypothesis.</div>
|
||||
<div class="autopermalink" data-description="Paragraph"><a href="#sec-One-Sample-Tests-12" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||||
</div>
|
||||
<div class="para" id="sec-One-Sample-Tests-13">In suitable situations, we can also use a normal approximation via <a href="sec-CLT.html#thm-CLT" class="xref" data-knowl="./knowl/xref/thm-CLT.html" data-reveal-label="Reveal" data-close-label="Close" title="Theorem 4.2.1">Theorem 4.2.1</a> to calculate the <span class="process-math">\(p\)</span>-value.<div class="autopermalink" data-description="Paragraph"><a href="#sec-One-Sample-Tests-13" 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-One-Sample-Tests-14"><h3 class="heading">
|
||||
<span class="type">Example</span><span class="space heading-divison-mark heading-divison-mark__space"> </span><span class="codenumber">5.1.5</span><span class="period heading-divison-mark heading-divison-mark__period">.</span>
|
||||
</h3>
|
||||
<div class="para" id="sec-One-Sample-Tests-14-1-1">We find a coin on the street and wonder if it’s a fair coin. We flip it 100 times and see 62 heads. Is this strong evidence to reject the null hypothesis of a fair coin at a 0.05 significance level?<div class="autopermalink" data-description="Paragraph"><a href="#sec-One-Sample-Tests-14-1-1" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||||
</div> <div class="para logical" id="sec-One-Sample-Tests-14-1-2">
|
||||
<div class="para">Let <span class="process-math">\(S\)</span> be the random variable which counts the number of heads in 100 flips. The null hypothesis <span class="process-math">\(H_0\)</span> of a fair coin would mean the parameter <span class="process-math">\(\theta = \Pr(\text{heads}) = 0.5\text{.}\)</span> (We’ll avoid the letter <span class="process-math">\(p\)</span> for the parameter to prevent confusion with the new term, <span class="process-math">\(p\)</span>-value.) So:</div>
|
||||
<div class="displaymath process-math" data-contains-math-knowls="./knowl/xref/thm-CLT.html" id="sec-One-Sample-Tests-14-1-2-6">
|
||||
\begin{align*}
|
||||
\E(S) \amp = n\theta = 100(0.5) = 50 \\
|
||||
\Var(S) \amp = n\theta(1-\theta) = 100(0.5)(0.5) = 25
|
||||
\end{align*}
|
||||
</div>
|
||||
<div class="para">Then, by <a href="sec-CLT.html#thm-CLT" class="xref" data-knowl="./knowl/xref/thm-CLT.html" data-reveal-label="Reveal" data-close-label="Close" title="Theorem 4.2.1">Theorem 4.2.1</a>, <span class="process-math">\(S \approx \Norm(50, 25)\text{.}\)</span> So, using a 2-tailed test, the <span class="process-math">\(p\)</span>-value is:</div>
|
||||
<div class="displaymath process-math" data-contains-math-knowls="./knowl/xref/thm-CLT.html" id="sec-One-Sample-Tests-14-1-2-10">
|
||||
\begin{align*}
|
||||
\Pr(S \geq 62) + \Pr(S \leq 38) \amp \approx \Pr\left(Z \geq \frac{61.5 - 50}{\sqrt{25}}\right) + \Pr\left(Z \leq \frac{38.5 - 50}{\sqrt{25}}\right) \\
|
||||
\amp = (1 - \Phi(2.3)) + \Phi(-2.3) \\
|
||||
\amp \approx (1 - 0.9893) + 0.0107 \\
|
||||
\amp = 0.0214 \lt 0.05,
|
||||
\end{align*}
|
||||
</div>
|
||||
<div class="para">so this is strong enough evidence to reject <span class="process-math">\(H_0\text{.}\)</span>
|
||||
</div>
|
||||
<div class="autopermalink" data-description="Paragraph"><a href="#sec-One-Sample-Tests-14-1-2" title="Copy heading and permalink for Paragraph" aria-label="Copy heading and permalink for Paragraph">🔗</a></div>
|
||||
</div>
|
||||
<div class="autopermalink" data-description="Example 5.1.5"><a href="#sec-One-Sample-Tests-14" title="Copy heading and permalink for Example 5.1.5" aria-label="Copy heading and permalink for Example 5.1.5">🔗</a></div></article><section class="exercises" id="exercises-One-Sample-Tests"><h3 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>
|
||||
</h3>
|
||||
<article class="exercise exercise-like" id="exercises-One-Sample-Tests-1"><h4 class="heading"><span class="codenumber">1<span class="period heading-divison-mark heading-divison-mark__period">.</span></span></h4>
|
||||
|
||||
Reference in New Issue
Block a user