Some Chap 5 answers

This commit is contained in:
2026-11-05 11:53:32 +00:00
parent 570aaff1c5
commit 475cd681aa
3 changed files with 402 additions and 205 deletions
+143 -49
View File
@@ -5,29 +5,38 @@
<statement> <statement>
<p> <p>
Suppose 10% of the general population is left-handed. 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. In a sample of 100 patients with carpal tunnel syndrome, 16 are found to
Is this evidence that the proportion of left-handedness is higher among carpal tunnel syndrome patients than among the general population? be left-handed.
Is this evidence that the proportion of left-handedness is higher among
carpal tunnel syndrome patients than among the general population?
</p> </p>
</statement> </statement>
</example> </example>
<p> <p>
We would like to develop a framework through which we can analyze whether data we've collected provides evidence for a particular hypothesis. 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: In fact, we will generally consider two hypotheses:
</p> </p>
<definition xml:id="def-null-hypothesis"> <definition xml:id="def-null-hypothesis">
<statement> <statement>
<p> <p>
The <term>null hypothesis</term>, often denoted <m>H_0</m>, is the assumption that an effect being studied or proposed does not exist. The <term>null hypothesis</term>, often denoted <m>H_0</m>, is the
The <term>alternative hypothesis</term>, <m>H_a</m>, is the claim that the effect does exist. assumption that an effect being studied or proposed does not exist.
The <term>alternative hypothesis</term>, <m>H_a</m>, is the claim that
the effect does exist.
</p> </p>
</statement> </statement>
</definition> </definition>
<p> <p>
In the previous example, if we write <m>\theta</m> 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. In the previous example, if we write <m>\theta</m> for the true proportion
The alternative hypothesis might be, for example, that the proportion is higher than among the general population: 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:
<md> <md>
<mrow> H_0: \theta \amp = 0.1 </mrow> <mrow> H_0: \theta \amp = 0.1 </mrow>
<mrow> H_a: \theta \amp \gt 0.1 </mrow> <mrow> H_a: \theta \amp \gt 0.1 </mrow>
@@ -35,13 +44,14 @@
</p> </p>
<p> <p>
After performing an experiment, we will either accept or reject the null hypothesis based on the data we collect. After performing an experiment, we will either accept or reject the null
hypothesis based on the data we collect.
Consider the following scenarios: Consider the following scenarios:
</p> </p>
<tabular halign="center"> <tabular halign="center">
<row> <row>
<cell></cell> <cell/>
<cell bottom="minor">accept <m>H_0</m></cell> <cell bottom="minor">accept <m>H_0</m></cell>
<cell bottom="minor">reject <m>H_0</m></cell> <cell bottom="minor">reject <m>H_0</m></cell>
</row> </row>
@@ -60,14 +70,18 @@
</tabular> </tabular>
<p> <p>
We'll use the notation <m>\alpha</m> for the probability of making a type I error, also called the <term>significance level</term>, and <m>\beta</m> for the probability of making a type II error. We'll use the notation <m>\alpha</m> for the probability of making a type I
The <term>power</term> of a test is the probability of correctly rejecting <m>H_0</m>, i.e., <m>1 - \beta</m>. error, also called the <term>significance level</term>, and <m>\beta</m> for
the probability of making a type II error.
The <term>power</term> of a test is the probability of correctly rejecting
<m>H_0</m>, i.e., <m>1 - \beta</m>.
</p> </p>
<definition xml:id="def-p-value"> <definition xml:id="def-p-value">
<statement> <statement>
<p> <p>
The <term><m>p</m>-value</term> is the probability of observing a result at least as extreme as measured if <m>H_0</m> is true. The <term><m>p</m>-value</term> is the probability of observing a result
at least as extreme as measured if <m>H_0</m> is true.
</p> </p>
</statement> </statement>
</definition> </definition>
@@ -75,7 +89,9 @@
<example> <example>
<statement> <statement>
<p> <p>
Continuing the previous example, under <m>H_0</m> that <m>\theta = 0.1</m>, the probability of seeing at least 16 left-handed people in a sample of 100 people would be: Continuing the previous example, under <m>H_0</m> that
<m>\theta = 0.1</m>, the probability of seeing at least 16 left-handed
people in a sample of 100 people would be:
<md> <md>
<mrow> \sum_{k = 16}^{100} {100 \choose k} (0.1)^k (1 - 0.1)^{100 - k} \approx 0.04, </mrow> <mrow> \sum_{k = 16}^{100} {100 \choose k} (0.1)^k (1 - 0.1)^{100 - k} \approx 0.04, </mrow>
</md> </md>
@@ -85,20 +101,31 @@
</example> </example>
<p> <p>
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. The goal of our calculation is to control the chance of making a type I
If our calculated <m>p</m>-value is below the cutoff, then reject <m>H_0</m>. error by choosing a significance level cutoff, often 0.05.
If our calculated <m>p</m>-value is below the cutoff, then reject
<m>H_0</m>.
Otherwise, accept <m>H_0</m>. Otherwise, accept <m>H_0</m>.
In the previous example, we would reject <m>H_0</m>, because it appears that the data we collected is pretty unlikely to see if the null hypothesis were true. In the previous example, we would reject <m>H_0</m>, because it appears that
We would accept that, about 4% of the time if the null hypothesis <em>is</em> true, we would see data at least this extreme, and therefore make a mistake by rejecting <m>H_0</m>. 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>is</em> true, we would see data at least this extreme, and therefore
make a mistake by rejecting <m>H_0</m>.
</p> </p>
<p> <p>
The test we just applied is called <term>1-tailed</term>. The test we just applied is called <term>1-tailed</term>.
The alternative hypothesis <m>\theta \gt 0.1</m> proposed that <m>\theta</m> was different from 0.1 in a specific direction. The alternative hypothesis <m>\theta \gt 0.1</m> proposed that <m>\theta</m>
For a <term>2-tailed</term> test, we could use the alternative hypothesis that <m>\theta \neq 0.1</m>. was different from 0.1 in a specific direction.
In this setting, the idea of data "at least as extreme" as what was measured is reframed. For a <term>2-tailed</term> test, we could use the alternative hypothesis
We measured 16 left-handed people in a sample of 100, which is 6 more than we would expect under the null hypothesis. that <m>\theta \neq 0.1</m>.
So we should also include the possibility of seeing at least 6 fewer left-handed people in the sample than expected: 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:
<md> <md>
<mrow> p\text{-value} \amp = \Pr(\geq 16 \text{ left-handed people}) + \Pr(\leq 4 \text{ left-handed people}) </mrow> <mrow> p\text{-value} \amp = \Pr(\geq 16 \text{ left-handed people}) + \Pr(\leq 4 \text{ left-handed people}) </mrow>
<mrow> \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) </mrow> <mrow> \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) </mrow>
@@ -108,7 +135,8 @@
</p> </p>
<p> <p>
In suitable situations, we can also use a normal approximation via <xref ref="thm-CLT"/> to calculate the <m>p</m>-value. In suitable situations, we can also use a normal approximation via
<xref ref="thm-CLT"/> to calculate the <m>p</m>-value.
</p> </p>
<example> <example>
@@ -116,13 +144,17 @@
<p> <p>
We find a coin on the street and wonder if it's a fair coin. We find a coin on the street and wonder if it's a fair coin.
We flip it 100 times and see 62 heads. 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? Is this strong evidence to reject the null hypothesis of a fair coin at
a 0.05 significance level?
</p> </p>
<p> <p>
Let <m>S</m> be the random variable which counts the number of heads in 100 flips. Let <m>S</m> be the random variable which counts the number of heads in
The null hypothesis <m>H_0</m> of a fair coin would mean the parameter <m>\theta = \Pr(\text{heads}) = 0.5</m>. 100 flips.
(We'll avoid the letter <m>p</m> for the parameter to prevent confusion with the new term, <m>p</m>-value.) So: The null hypothesis <m>H_0</m> of a fair coin would mean the parameter
<m>\theta = \Pr(\text{heads}) = 0.5</m>.
(We'll avoid the letter <m>p</m> for the parameter to prevent confusion
with the new term, <m>p</m>-value.) So:
<md> <md>
<mrow> \E(S) \amp = n\theta = 100(0.5) = 50 </mrow> <mrow> \E(S) \amp = n\theta = 100(0.5) = 50 </mrow>
<mrow> \Var(S) \amp = n\theta(1-\theta) = 100(0.5)(0.5) = 25 </mrow> <mrow> \Var(S) \amp = n\theta(1-\theta) = 100(0.5)(0.5) = 25 </mrow>
@@ -144,46 +176,73 @@
<exercise> <exercise>
<introduction> <introduction>
<p> <p>
In each of the following scenarios, determine whether we should use a 1-tailed test or a 2-tailed test. In each of the following scenarios, determine whether we should use a
1-tailed test or a 2-tailed test.
</p> </p>
</introduction> </introduction>
<task> <task>
<statement> <statement>
<p> <p>
We have a coin which we've flipped many times, seeing an above-average number of heads. We have a coin which we've flipped many times, seeing an
We suspect the coin comes up heads more often than a fair coin would. above-average number of heads.
We suspect the coin comes up heads more often than a fair coin
would.
</p> </p>
</statement> </statement>
<answer>
<p>
1-tailed.
</p>
</answer>
</task> </task>
<task> <task>
<statement> <statement>
<p> <p>
We find a coin on the street and wonder whether or not it's a fair coin. We find a coin on the street and wonder whether or not it's a fair
coin.
</p> </p>
</statement> </statement>
<answer>
<p>
2-tailed.
</p>
</answer>
</task> </task>
<task> <task>
<statement> <statement>
<p> <p>
We suspect there will be a difference in average weight of mice caught during the summer versus during the winter. We suspect there will be a difference in average weight of mice
caught during the summer versus during the winter.
</p> </p>
</statement> </statement>
<answer>
<p>
2-tailed.
</p>
</answer>
</task> </task>
<task> <task>
<statement> <statement>
<p> <p>
In a medical study, a group of patients are gathered and the proportion experiencing particular symptoms is measured. In a medical study, a group of patients are gathered and the
A new drug intended to eliminate these symptoms is administered, after which the proportion experiencing symptoms is measured again. proportion experiencing particular symptoms is measured.
A new drug intended to eliminate these symptoms is administered,
after which the proportion experiencing symptoms is measured again.
</p> </p>
</statement> </statement>
<answer>
<p>
1-tailed.
</p>
</answer>
</task> </task>
</exercise> </exercise>
@@ -191,41 +250,76 @@
<statement> <statement>
<p> <p>
Suppose we find a coin and wonder whether it's fair. Suppose we find a coin and wonder whether it's fair.
As a first test, we decide to flip the coin 200 times and count the number of heads. As a first test, we decide to flip the coin 200 times and count the
If we see 112 heads, should we accept or reject the null hypothesis of a fair coin at a significance level of 0.05? number of heads.
If we see 112 heads, should we accept or reject the null hypothesis of
a fair coin at a significance level of 0.05?
</p> </p>
</statement> </statement>
<answer>
<p>
The <m>p</m>-value is <m>0.1032</m>, so we do not reject the null hypothesis.
</p>
</answer>
</exercise> </exercise>
<exercise> <exercise>
<statement> <statement>
<p> <p>
Suppose we have a coin which we suspect comes up heads more often than a fair coin would. Suppose we have a coin which we suspect comes up heads more often than
As a first test, we decide to flip the coin 200 times and count the number of heads. a fair coin would.
If we see 112 heads, should we accept or reject the null hypothesis of a fair coin at a significance level of 0.05? As a first test, we decide to flip the coin 200 times and count the
number of heads.
If we see 112 heads, should we accept or reject the null hypothesis of
a fair coin at a significance level of 0.05?
</p> </p>
</statement> </statement>
<answer>
<p>
The <m>p</m>-value is <m>0.0516</m>, so we do not reject the null hypothesis.
</p>
</answer>
</exercise> </exercise>
<exercise> <exercise>
<statement> <statement>
<p> <p>
Suppose we find a six-sided die and wonder whether it's fair. Suppose we find a six-sided die and wonder whether it's fair.
As a first test, we decide to roll the die 100 times and count the number of times it comes up 1. As a first test, we decide to roll the die 100 times and count the
If we roll 22 1's, should we accept or reject the null hypothesis of a fair die at a significance level of 0.05? number of times it comes up 1.
If we roll 22 1's, should we accept or reject the null hypothesis of a
fair die at a significance level of 0.05?
</p> </p>
</statement> </statement>
<answer>
<p>
The <m>p</m>-value is <m>0.1936</m>, so we do not reject the null hypothesis.
</p>
</answer>
</exercise> </exercise>
<exercise> <exercise>
<statement> <statement>
<p> <p>
Suppose a particular plant when grown outdoors has an average height of 39 in with a variance of 20 in<m>^2</m>. Suppose a particular plant when grown outdoors has an average height
We suspect that growing this plant in a greenhouse will increase its height. of 39 in with a variance of 20 in<m>^2</m>.
A sample of 50 plants grown in a greenhouse has an average height of 40 in. We suspect that growing this plant in a greenhouse will increase its
Is this significant enough data to reject the null hypothesis of equal means at the <m>p = 0.05</m> significance level? height.
A sample of 50 plants grown in a greenhouse has an average height of
40 in.
Is this significant enough data to reject the null hypothesis of equal
means at the <m>p = 0.05</m> significance level?
</p> </p>
</statement> </statement>
<answer>
<p>
The <m>p</m>-value is <m>0.0571</m>, so we do not reject the null hypothesis.
</p>
</answer>
</exercise> </exercise>
</exercises> </exercises>
</section> </section>
+90 -34
View File
@@ -2,7 +2,8 @@
<title>Power of a Test</title> <title>Power of a Test</title>
<p> <p>
Recall that the power of a test is the probability of rejecting a false null hypothesis. Recall that the power of a test is the probability of rejecting a false null
hypothesis.
To understand the power, we must know: To understand the power, we must know:
<ol> <ol>
<li> <li>
@@ -23,20 +24,25 @@
<statement> <statement>
<p> <p>
We find a coin and wonder if it's fair. We find a coin and wonder if it's fair.
Let <m>\theta</m> be the probability of the coin coming up heads on a flip. Let <m>\theta</m> be the probability of the coin coming up heads on a
flip.
Let <m>S</m> count the number of heads in 100 flips. Let <m>S</m> count the number of heads in 100 flips.
Under the null hypothesis that <m>\theta = 0.5</m>, <m>S</m> is binomial, with: Under the null hypothesis that <m>\theta = 0.5</m>, <m>S</m> is
binomial, with:
<md> <md>
<mrow> \E(S) \amp = (n)(\theta) = (100)(0.5) = 50 </mrow> <mrow> \E(S) \amp = (n)(\theta) = (100)(0.5) = 50 </mrow>
<mrow> \Var(S) \amp = (n)(\theta)(1 - \theta) = (100)(0.5)(0.5) = 25 </mrow> <mrow> \Var(S) \amp = (n)(\theta)(1 - \theta) = (100)(0.5)(0.5) = 25 </mrow>
</md> </md>
Using a normal approximation, <m>S \approx \Norm(50, 25)</m>. Using a normal approximation, <m>S \approx \Norm(50, 25)</m>.
In the calculation of the <m>p</m>-value for a 2-tailed test, we will eventually reach the expression: In the calculation of the <m>p</m>-value for a 2-tailed test, we will
eventually reach the expression:
<md> <md>
<mrow> \Pr(Z \geq z) + \Pr(Z \leq -z) </mrow> <mrow> \Pr(Z \geq z) + \Pr(Z \leq -z) </mrow>
</md> </md>
for some <m>z</m>-score. for some <m>z</m>-score.
To address the first question above, we can calculate, for a specified significance level <m>\alpha</m>, the <m>z</m>-score that represents data at the cutoff between accepting and rejecting the null hypothesis: To address the first question above, we can calculate, for a specified
significance level <m>\alpha</m>, the <m>z</m>-score that represents
data at the cutoff between accepting and rejecting the null hypothesis:
<md> <md>
<mrow> \alpha \amp = \Pr(Z \geq z) + \Pr(Z \leq -z) </mrow> <mrow> \alpha \amp = \Pr(Z \geq z) + \Pr(Z \leq -z) </mrow>
<mrow> \amp = \Phi(-z) + (1 - \Phi(z)) </mrow> <mrow> \amp = \Phi(-z) + (1 - \Phi(z)) </mrow>
@@ -44,27 +50,35 @@
<mrow> \Rightarrow \Phi(-z) \amp = \frac{\alpha}{2} </mrow> <mrow> \Rightarrow \Phi(-z) \amp = \frac{\alpha}{2} </mrow>
<mrow> -z \amp = \Phi^{-1}\left(\frac{\alpha}{2}\right) </mrow> <mrow> -z \amp = \Phi^{-1}\left(\frac{\alpha}{2}\right) </mrow>
</md> </md>
For the significance level <m>\alpha = 0.05</m>, we'll have <m>z = 1.96</m>. For the significance level <m>\alpha = 0.05</m>, we'll have
Now, we convert back to values of <m>S</m>, keeping in mind that a continuity correction would be involved: <m>z = 1.96</m>.
Now, we convert back to values of <m>S</m>, keeping in mind that a
continuity correction would be involved:
<md> <md>
<mrow> \frac{S - 0.5 - 50}{\sqrt{25}} \amp = 1.96 </mrow> <mrow> \frac{S - 0.5 - 50}{\sqrt{25}} \amp = 1.96 </mrow>
<mrow> S \amp = 50.5 + 1.96 \sqrt{25} = 60.3. </mrow> <mrow> S \amp = 50.5 + 1.96 \sqrt{25} = 60.3. </mrow>
</md> </md>
We can't flip a fractional number of heads, so it would take a result of 61 or more heads (or, equally extreme in the other direction, 39 heads or fewer) to reject the null hypothesis. We can't flip a fractional number of heads, so it would take a result of
61 or more heads (or, equally extreme in the other direction, 39 heads
or fewer) to reject the null hypothesis.
</p> </p>
</statement> </statement>
</example> </example>
<p> <p>
To address the second question, we find a obstacle. To address the second question, we find a obstacle.
How can we calculate the probability of seeing data extreme enough data to reject <m>H_0</m> without knowing the true value of <m>\theta</m>? In fact, the power is not a single number, but a function of <m>\theta</m>. How can we calculate the probability of seeing data extreme enough data to
For each hypothetical value of <m>\theta</m>, we'll calculate the probability of seeing extreme enough data to reject <m>H_0</m>. reject <m>H_0</m> without knowing the true value of <m>\theta</m>?
In fact, the power is not a single number, but a function of <m>\theta</m>.
For each hypothetical value of <m>\theta</m>, we'll calculate the
probability of seeing extreme enough data to reject <m>H_0</m>.
</p> </p>
<example> <example>
<statement> <statement>
<p> <p>
Continuing the previous example, we know that, if <m>S \geq 61</m> or <m>S \leq 39</m>, we would reject <m>H_0</m>. Continuing the previous example, we know that, if <m>S \geq 61</m> or
<m>S \leq 39</m>, we would reject <m>H_0</m>.
For a given value of <m>\theta</m>: For a given value of <m>\theta</m>:
<md> <md>
<mrow> \E(S) \amp = n\theta = 100\theta </mrow> <mrow> \E(S) \amp = n\theta = 100\theta </mrow>
@@ -83,17 +97,24 @@
<mrow> \amp \approx (1 - 0.5398) + 0 </mrow> <mrow> \amp \approx (1 - 0.5398) + 0 </mrow>
<mrow> \amp = 0.4602 </mrow> <mrow> \amp = 0.4602 </mrow>
</md> </md>
(Note: for the <m>z</m>-score <m>-4.18</m>, which is below the range covered by <xref ref="app-Phi-table"/>, we will treat the <m>\Phi</m> value as close enough to 0. (Note: for the <m>z</m>-score <m>-4.18</m>, which is below the range
For a <m>z</m>-score outside the range on the other side, we would treat the <m>\Phi</m> value as 1. covered by <xref ref="app-Phi-table"/>, we will treat the <m>\Phi</m>
If we needed more precision than that, we would consult an expanded table.) value as close enough to 0.
For a <m>z</m>-score outside the range on the other side, we would treat
the <m>\Phi</m> value as 1.
If we needed more precision than that, we would consult an expanded
table.)
</p> </p>
</statement> </statement>
</example> </example>
<p> <p>
We can see in the example that the power of the test was greater when <m>\theta = 0.6</m> than when <m>\theta = 0.55</m>. We can see in the example that the power of the test was greater when
<m>\theta = 0.6</m> than when <m>\theta = 0.55</m>.
The null hypothesis was <m>\theta = 0.5</m>. The null hypothesis was <m>\theta = 0.5</m>.
It is reasonable that, if the coin is <em>more different</em> from the null hypothesis, then it will have a higher probabiilty of producing data extreme enough to reject the null hypothesis. It is reasonable that, if the coin is <em>more different</em> from the null
hypothesis, then it will have a higher probabiilty of producing data extreme
enough to reject the null hypothesis.
</p> </p>
<exercises xml:id="exercises-Power"> <exercises xml:id="exercises-Power">
@@ -101,18 +122,43 @@
<statement> <statement>
<p> <p>
Suppose we find a coin and wonder whether it's fair. Suppose we find a coin and wonder whether it's fair.
As a first test, we decide to flip the coin 200 times and count the number of heads, <m>S</m>. As a first test, we decide to flip the coin 200 times and count the
What values of <m>S</m> would be extreme enough to reject the null hypothesis of a fair coin? If the coin actually has a 0.6 probability of coming up heads, what is the power of this test? number of heads, <m>S</m>.
What values of <m>S</m> would be extreme enough to reject the null
hypothesis of a fair coin?
If the coin actually has a <m>0.6</m> probability of coming up heads,
what is the power of this test?
</p> </p>
</statement> </statement>
<answer>
<p>
(Note: Normal approximation was used for these calculations.)
</p>
<p>
We can reject the null hypothesis if we see greater than or equal to
<m>115</m> heads, or if we see less than or equal to <m>85</m> heads.
</p>
<p>
If the coin has a <m>0.6</m> probability of coming up heads, then the
power of the test is <m>0.7852</m>.
</p>
</answer>
</exercise> </exercise>
<exercise> <exercise>
<statement> <statement>
<p> <p>
Suppose we have a coin which we suspect comes up heads more often than a fair coin would. Suppose we have a coin which we suspect comes up heads more often than
As a first test, we decide to flip the coin 200 times and count the number of heads, <m>S</m>. a fair coin would.
What values of <m>S</m> would be extreme enough to reject the null hypothesis of a fair coin? If the coin actually has a 0.6 probability of coming up heads, what is the power of this test? As a first test, we decide to flip the coin 200 times and count the
number of heads, <m>S</m>.
What values of <m>S</m> would be extreme enough to reject the null
hypothesis of a fair coin?
If the coin actually has a 0.6 probability of coming up heads, what is
the power of this test?
</p> </p>
</statement> </statement>
</exercise> </exercise>
@@ -121,45 +167,48 @@
<introduction> <introduction>
<p> <p>
Suppose we find a six-sided die and wonder whether it's fair. Suppose we find a six-sided die and wonder whether it's fair.
As a first test, we decide to roll the die 100 times and count the number of times it comes up 1. As a first test, we decide to roll the die 100 times and count the
number of times it comes up 1.
The expected number of 1's is 50/3, with a variance of 125/9. The expected number of 1's is 50/3, with a variance of 125/9.
</p> </p>
</introduction> </introduction>
<task> <task>
<statement> <statement>
<p> <p>
Using a normal approximation, what is the smallest number of 1's greater than 50/3 that would be extreme enough to reject the null hypothesis of a fair die? Using a normal approximation, what is the smallest number of 1's
greater than 50/3 that would be extreme enough to reject the null
hypothesis of a fair die?
</p> </p>
</statement> </statement>
</task> </task>
<task> <task>
<statement> <statement>
<p> <p>
Using a normal approximation, what is the greatest number of 1's less than 50/3 that would be extreme enough to reject the null hypothesis of a fair die? Using a normal approximation, what is the greatest number of 1's
less than 50/3 that would be extreme enough to reject the null
hypothesis of a fair die?
</p> </p>
</statement> </statement>
</task> </task>
<task> <task>
<statement> <statement>
<p> <p>
Suppose that this die is weighted so that it rolls a 1 with probability 0.2. Suppose that this die is weighted so that it rolls a 1 with
probability 0.2.
What would be the power of our test? What would be the power of our test?
</p> </p>
</statement> </statement>
</task> </task>
<task> <task>
<statement> <statement>
<p> <p>
Suppose we roll the die 100 times and see 23 1's. Suppose we roll the die 100 times and see 23 1's.
Use the maximum likelihood value for the probability of rolling a 1 to calculate the power of the test. Use the maximum likelihood value for the probability of rolling a 1
to calculate the power of the test.
</p> </p>
</statement> </statement>
</task> </task>
@@ -168,10 +217,17 @@
<exercise> <exercise>
<statement> <statement>
<p> <p>
Suppose a particular plant when grown outdoors has an average height of 39 in with a variance of 20 in<m>^2</m>. Suppose a particular plant when grown outdoors has an average height
We suspect that growing this plant in a greenhouse will increase its height. of 39 in with a variance of 20 in<m>^2</m>.
We take the average height of a sample of 50 plants grown in a greenhouse. We suspect that growing this plant in a greenhouse will increase its
What is the minimum average height of this sample that would be extreme enough to reject the null hypothesis of equal means at the <m>p = 0.05</m> significance level? If the plants, when grown in a greenhouse, would truly have an average height of 41 in, what is the power of our test? height.
We take the average height of a sample of 50 plants grown in a
greenhouse.
What is the minimum average height of this sample that would be
extreme enough to reject the null hypothesis of equal means at the
<m>p = 0.05</m> significance level?
If the plants, when grown in a greenhouse, would truly have an average
height of 41 in, what is the power of our test?
</p> </p>
</statement> </statement>
</exercise> </exercise>
+72 -25
View File
@@ -2,28 +2,41 @@
<title>Two Sample Tests</title> <title>Two Sample Tests</title>
<p> <p>
In the previous section, we compared data collected from a sample against a known or supposed baseline. In the previous section, we compared data collected from a sample against a
But the statistics for that baseline would also generally be approximated by collecting data from a sample. known or supposed baseline.
We'll now consider hypothesis tests that directly involve two samples of data, one called a <term>control group</term> and the other an <term>experimental group</term>. But the statistics for that baseline would also generally be approximated by
collecting data from a sample.
We'll now consider hypothesis tests that directly involve two samples of
data, one called a <term>control group</term> and the other an
<term>experimental group</term>.
</p> </p>
<example> <example>
<statement> <statement>
<p> <p>
Suppose a sample of 50 plants have a mean height of 35 cm. Suppose a sample of 50 plants have a mean height of 35 cm.
A separate sample of 30 plants are taken from another plot which has been using a new fertilizer intended to increase plant growth, and they have a mean height of 36.4 cm. A separate sample of 30 plants are taken from another plot which has
If the height of a plant has a variance of <m>\sigma^2 = 12 \text{cm}^2</m>, do we have strong enough evidence to reject the null hypothesis that the new fertilizer has no effect on plant height? been using a new fertilizer intended to increase plant growth, and they
have a mean height of 36.4 cm.
If the height of a plant has a variance of
<m>\sigma^2 = 12 \text{cm}^2</m>, do we have strong enough evidence to
reject the null hypothesis that the new fertilizer has no effect on
plant height?
</p> </p>
<p> <p>
Let <m>A_1</m> be the random variable representing average height of the control group of plants. Let <m>A_1</m> be the random variable representing average height of the
This sample has size <m>n_1 = 50</m>, and we measured the average height <m>\mu_1 = 35</m>. control group of plants.
This sample has size <m>n_1 = 50</m>, and we measured the average height
<m>\mu_1 = 35</m>.
The variance of the average height would be: The variance of the average height would be:
<md> <md>
<mrow> \Var(A_1) \amp = \frac{\sigma^2}{n_1} = \frac{12}{50} = 0.24. </mrow> <mrow> \Var(A_1) \amp = \frac{\sigma^2}{n_1} = \frac{12}{50} = 0.24. </mrow>
</md> </md>
Similarly, let <m>A_2</m> be the random variable representing average height of the experimental group of plants. Similarly, let <m>A_2</m> be the random variable representing average
This sample has size <m>n_2 = 30</m>, and we measured the average height <m>\mu_2 = 36.4</m>. height of the experimental group of plants.
This sample has size <m>n_2 = 30</m>, and we measured the average height
<m>\mu_2 = 36.4</m>.
The variance of the average height would be: The variance of the average height would be:
<md> <md>
<mrow> \Var(A_2) \amp = \frac{\sigma^2}{n_2} = \frac{12}{30} = 0.4. </mrow> <mrow> \Var(A_2) \amp = \frac{\sigma^2}{n_2} = \frac{12}{30} = 0.4. </mrow>
@@ -32,7 +45,8 @@
</p> </p>
<p> <p>
According to the null hypothesis, the two plots of plants should behave the same way, so <m>\E(D) = 0</m>. According to the null hypothesis, the two plots of plants should behave
the same way, so <m>\E(D) = 0</m>.
We measured the value: We measured the value:
<md> <md>
<mrow>D = A_2 - A_1 = 36.4 - 35 = 1.4 </mrow> <mrow>D = A_2 - A_1 = 36.4 - 35 = 1.4 </mrow>
@@ -41,7 +55,8 @@
<md> <md>
<mrow> \Var(D) = \Var(A_2 - A_1) = \Var(A_2) + \Var(A_1) = 0.24 + 0.4 = 0.64. </mrow> <mrow> \Var(D) = \Var(A_2 - A_1) = \Var(A_2) + \Var(A_1) = 0.24 + 0.4 = 0.64. </mrow>
</md> </md>
So, under the null hypothesis, we will treat <m>D</m> as <m>\Norm(0, 0.64)</m>. So, under the null hypothesis, we will treat <m>D</m> as
<m>\Norm(0, 0.64)</m>.
We then perform a 1-tailed test: We then perform a 1-tailed test:
<md> <md>
<mrow> \Pr(D \geq 1.4) \amp \approx \Pr\left(Z \geq \frac{1.4 - 0}{\sqrt{0.64}}\right) </mrow> <mrow> \Pr(D \geq 1.4) \amp \approx \Pr\left(Z \geq \frac{1.4 - 0}{\sqrt{0.64}}\right) </mrow>
@@ -55,22 +70,30 @@
</example> </example>
<p> <p>
However, we don't know <m>\sigma^2</m>, so we should replace it with the sample variance. However, we don't know <m>\sigma^2</m>, so we should replace it with the
sample variance.
</p> </p>
<example> <example>
<statement> <statement>
<p> <p>
Suppose a sample of 100 people from the general population contains 10 left-handed people, and a sample of 100 patients from a carpal tunnel syndrome clinic contains 16 left-handed people. Suppose a sample of 100 people from the general population contains 10
If <m>\theta_1</m> is the proportion of left-handed people in the general population, then the maximum likelihood estimation based on our control group sample would be: left-handed people, and a sample of 100 patients from a carpal tunnel
syndrome clinic contains 16 left-handed people.
If <m>\theta_1</m> is the proportion of left-handed people in the
general population, then the maximum likelihood estimation based on our
control group sample would be:
<md> <md>
<mrow> \widehat{\theta}_1 = \frac{10}{100} = 0.1. </mrow> <mrow> \widehat{\theta}_1 = \frac{10}{100} = 0.1. </mrow>
</md> </md>
If <m>\theta_2</m> is the proportion of left-handed people in the patient population, then the maximum likelihood estimate would be: If <m>\theta_2</m> is the proportion of left-handed people in the
patient population, then the maximum likelihood estimate would be:
<md> <md>
<mrow> \widehat{\theta}_2 = \frac{16}{100} = 0.16. </mrow> <mrow> \widehat{\theta}_2 = \frac{16}{100} = 0.16. </mrow>
</md> </md>
Write <m>A_1</m> for the proportion of the control group sample which is left-handed and <m>A_2</m> for the proportion of the experimental group sample. Write <m>A_1</m> for the proportion of the control group sample which is
left-handed and <m>A_2</m> for the proportion of the experimental group
sample.
Then we can estimate the variances: Then we can estimate the variances:
<md> <md>
<mrow> n_1 \amp = 100 \amp n_2 \amp = 100 </mrow> <mrow> n_1 \amp = 100 \amp n_2 \amp = 100 </mrow>
@@ -83,9 +106,14 @@
<mrow> \Var(D) = \Var(A_2) + \Var(A_1), </mrow> <mrow> \Var(D) = \Var(A_2) + \Var(A_1), </mrow>
</md> </md>
however, we should pause a moment here. however, we should pause a moment here.
The null hypothesis would be that the two populations have the same statistics. The null hypothesis would be that the two populations have the same
statistics.
That should include the same variance for an individual measurement. That should include the same variance for an individual measurement.
(The variances of <m>A_1</m> and <m>A_2</m> could still be different if, e.g., they were averaging over different sized samples.) So we should abandon our two distinct maximum likelihood estimates <m>\widehat{\theta}_1, \widehat{\theta}_2</m> and instead find one estimate, <m>\widehat{\theta}_0</m>, estimated from all collected data: (The variances of <m>A_1</m> and <m>A_2</m> could still be different if,
e.g., they were averaging over different sized samples.) So we should
abandon our two distinct maximum likelihood estimates
<m>\widehat{\theta}_1, \widehat{\theta}_2</m> and instead find one
estimate, <m>\widehat{\theta}_0</m>, estimated from all collected data:
<md> <md>
<mrow> \widehat{\theta}_0 = \frac{10 + 16}{100 + 100} = \frac{26}{200} = 0.13. </mrow> <mrow> \widehat{\theta}_0 = \frac{10 + 16}{100 + 100} = \frac{26}{200} = 0.13. </mrow>
</md> </md>
@@ -114,9 +142,16 @@
<exercise> <exercise>
<statement> <statement>
<p> <p>
A farmer is testing an experimental new plant fertilizer that is supposed to increase the weight of a particular apple variety. A farmer is testing an experimental new plant fertilizer that is
A control sample of 25 apples grown using the usual fertilizer have a mean weight of 75 grams and a sample variance of 90 grams<m>^2</m> (for an individual apple). supposed to increase the weight of a particular apple variety.
An experimental sample of 25 apples grown using the new fertilizer have a mean weight of 79 grams and a sample variance of 90 grams<m>^2</m>. A control sample of 25 apples grown using the usual fertilizer have a
mean weight of 75 grams and a sample variance of 90 grams<m>^2</m>
(for an individual apple).
An experimental sample of 25 apples grown using the new fertilizer
have a mean weight of 79 grams and a sample variance of 90
grams<m>^2</m>.
Is this sufficient evidence to reject the null hypothesis that the new
plant fertilizer has no effect on the weights of the apples?
</p> </p>
</statement> </statement>
</exercise> </exercise>
@@ -124,14 +159,26 @@
<exercise> <exercise>
<statement> <statement>
<p> <p>
We have an established factory which produces coins that are close to fair. We have an established factory which produces coins that are close to
We're opening up a second factory, and we'd like to ensure the machines are calibrated to produce coins which behave similarly to the ones produced in the established factory. fair.
We pick one sample coin from each factory, and flip each sample coin 100 times. We're opening up a second factory, and we'd like to ensure the
machines are calibrated to produce coins which behave similarly to the
ones produced in the established factory.
We pick one sample coin from each factory, and flip each sample coin
100 times.
The coin from the established factory flips 52 heads in 100 flips. The coin from the established factory flips 52 heads in 100 flips.
The coin from the new factory flips 62 heads in 100 flips. The coin from the new factory flips 62 heads in 100 flips.
Is this strong enough evidence to reject the null hypothesis that the two factories produce similar coins at a 0.05 significance level? Is this strong enough evidence to reject the null hypothesis that the
two factories produce similar coins at a 0.05 significance level?
</p> </p>
</statement> </statement>
<answer>
<p>
The <m>p</m>-value is <m>0.1738</m>, so we do not reject the null
hypothesis.
</p>
</answer>
</exercise> </exercise>
</exercises> </exercises>
</section> </section>