Some Chap 5 answers
This commit is contained in:
+143
-49
@@ -5,29 +5,38 @@
|
||||
<statement>
|
||||
<p>
|
||||
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?
|
||||
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?
|
||||
</p>
|
||||
</statement>
|
||||
</example>
|
||||
|
||||
<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:
|
||||
</p>
|
||||
|
||||
<definition xml:id="def-null-hypothesis">
|
||||
<statement>
|
||||
<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>alternative hypothesis</term>, <m>H_a</m>, is the claim that the effect does exist.
|
||||
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>alternative hypothesis</term>, <m>H_a</m>, is the claim that
|
||||
the effect does exist.
|
||||
</p>
|
||||
</statement>
|
||||
</definition>
|
||||
|
||||
<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.
|
||||
The alternative hypothesis might be, for example, that the proportion is higher than among the general population:
|
||||
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.
|
||||
The alternative hypothesis might be, for example, that the proportion is
|
||||
higher than among the general population:
|
||||
<md>
|
||||
<mrow> H_0: \theta \amp = 0.1 </mrow>
|
||||
<mrow> H_a: \theta \amp \gt 0.1 </mrow>
|
||||
@@ -35,13 +44,14 @@
|
||||
</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:
|
||||
</p>
|
||||
|
||||
<tabular halign="center">
|
||||
<row>
|
||||
<cell></cell>
|
||||
<cell/>
|
||||
<cell bottom="minor">accept <m>H_0</m></cell>
|
||||
<cell bottom="minor">reject <m>H_0</m></cell>
|
||||
</row>
|
||||
@@ -60,14 +70,18 @@
|
||||
</tabular>
|
||||
|
||||
<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.
|
||||
The <term>power</term> of a test is the probability of correctly rejecting <m>H_0</m>, i.e., <m>1 - \beta</m>.
|
||||
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.
|
||||
The <term>power</term> of a test is the probability of correctly rejecting
|
||||
<m>H_0</m>, i.e., <m>1 - \beta</m>.
|
||||
</p>
|
||||
|
||||
<definition xml:id="def-p-value">
|
||||
<statement>
|
||||
<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>
|
||||
</statement>
|
||||
</definition>
|
||||
@@ -75,7 +89,9 @@
|
||||
<example>
|
||||
<statement>
|
||||
<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>
|
||||
<mrow> \sum_{k = 16}^{100} {100 \choose k} (0.1)^k (1 - 0.1)^{100 - k} \approx 0.04, </mrow>
|
||||
</md>
|
||||
@@ -85,20 +101,31 @@
|
||||
</example>
|
||||
|
||||
<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.
|
||||
If our calculated <m>p</m>-value is below the cutoff, then reject <m>H_0</m>.
|
||||
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 <m>p</m>-value is below the cutoff, then reject
|
||||
<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.
|
||||
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>.
|
||||
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.
|
||||
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>
|
||||
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.
|
||||
For a <term>2-tailed</term> test, we could use the alternative hypothesis that <m>\theta \neq 0.1</m>.
|
||||
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:
|
||||
The alternative hypothesis <m>\theta \gt 0.1</m> proposed that <m>\theta</m>
|
||||
was different from 0.1 in a specific direction.
|
||||
For a <term>2-tailed</term> test, we could use the alternative hypothesis
|
||||
that <m>\theta \neq 0.1</m>.
|
||||
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>
|
||||
<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>
|
||||
@@ -108,7 +135,8 @@
|
||||
</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>
|
||||
|
||||
<example>
|
||||
@@ -116,13 +144,17 @@
|
||||
<p>
|
||||
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?
|
||||
Is this strong evidence to reject the null hypothesis of a fair coin at
|
||||
a 0.05 significance level?
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Let <m>S</m> be the random variable which counts the number of heads in 100 flips.
|
||||
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:
|
||||
Let <m>S</m> be the random variable which counts the number of heads in
|
||||
100 flips.
|
||||
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>
|
||||
<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>
|
||||
@@ -144,46 +176,73 @@
|
||||
<exercise>
|
||||
<introduction>
|
||||
<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>
|
||||
</introduction>
|
||||
|
||||
|
||||
<task>
|
||||
<statement>
|
||||
<p>
|
||||
We have a coin which we've flipped many times, seeing an above-average number of heads.
|
||||
We suspect the coin comes up heads more often than a fair coin would.
|
||||
We have a coin which we've flipped many times, seeing an
|
||||
above-average number of heads.
|
||||
We suspect the coin comes up heads more often than a fair coin
|
||||
would.
|
||||
</p>
|
||||
</statement>
|
||||
|
||||
<answer>
|
||||
<p>
|
||||
1-tailed.
|
||||
</p>
|
||||
</answer>
|
||||
</task>
|
||||
|
||||
|
||||
<task>
|
||||
<statement>
|
||||
<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>
|
||||
</statement>
|
||||
|
||||
<answer>
|
||||
<p>
|
||||
2-tailed.
|
||||
</p>
|
||||
</answer>
|
||||
</task>
|
||||
|
||||
|
||||
<task>
|
||||
<statement>
|
||||
<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>
|
||||
</statement>
|
||||
|
||||
<answer>
|
||||
<p>
|
||||
2-tailed.
|
||||
</p>
|
||||
</answer>
|
||||
</task>
|
||||
|
||||
|
||||
<task>
|
||||
<statement>
|
||||
<p>
|
||||
In a medical study, a group of patients are gathered and the 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.
|
||||
In a medical study, a group of patients are gathered and the
|
||||
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>
|
||||
</statement>
|
||||
|
||||
<answer>
|
||||
<p>
|
||||
1-tailed.
|
||||
</p>
|
||||
</answer>
|
||||
</task>
|
||||
</exercise>
|
||||
|
||||
@@ -191,41 +250,76 @@
|
||||
<statement>
|
||||
<p>
|
||||
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.
|
||||
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>
|
||||
</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>
|
||||
<statement>
|
||||
<p>
|
||||
Suppose we have a coin which we suspect comes up heads more often than a fair coin would.
|
||||
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?
|
||||
Suppose we have a coin which we suspect comes up heads more often than
|
||||
a fair coin would.
|
||||
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>
|
||||
</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>
|
||||
<statement>
|
||||
<p>
|
||||
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.
|
||||
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?
|
||||
As a first test, we decide to roll the die 100 times and count the
|
||||
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>
|
||||
</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>
|
||||
<statement>
|
||||
<p>
|
||||
Suppose a particular plant when grown outdoors has an average height of 39 in with a variance of 20 in<m>^2</m>.
|
||||
We suspect that growing this plant in a greenhouse will increase its 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?
|
||||
Suppose a particular plant when grown outdoors has an average height
|
||||
of 39 in with a variance of 20 in<m>^2</m>.
|
||||
We suspect that growing this plant in a greenhouse will increase its
|
||||
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>
|
||||
</statement>
|
||||
|
||||
<answer>
|
||||
<p>
|
||||
The <m>p</m>-value is <m>0.0571</m>, so we do not reject the null hypothesis.
|
||||
</p>
|
||||
</answer>
|
||||
</exercise>
|
||||
</exercises>
|
||||
</section>
|
||||
+90
-34
@@ -2,7 +2,8 @@
|
||||
<title>Power of a Test</title>
|
||||
|
||||
<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:
|
||||
<ol>
|
||||
<li>
|
||||
@@ -23,20 +24,25 @@
|
||||
<statement>
|
||||
<p>
|
||||
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.
|
||||
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>
|
||||
<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>
|
||||
</md>
|
||||
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>
|
||||
<mrow> \Pr(Z \geq z) + \Pr(Z \leq -z) </mrow>
|
||||
</md>
|
||||
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>
|
||||
<mrow> \alpha \amp = \Pr(Z \geq z) + \Pr(Z \leq -z) </mrow>
|
||||
<mrow> \amp = \Phi(-z) + (1 - \Phi(z)) </mrow>
|
||||
@@ -44,27 +50,35 @@
|
||||
<mrow> \Rightarrow \Phi(-z) \amp = \frac{\alpha}{2} </mrow>
|
||||
<mrow> -z \amp = \Phi^{-1}\left(\frac{\alpha}{2}\right) </mrow>
|
||||
</md>
|
||||
For the significance level <m>\alpha = 0.05</m>, we'll have <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:
|
||||
For the significance level <m>\alpha = 0.05</m>, we'll have
|
||||
<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>
|
||||
<mrow> \frac{S - 0.5 - 50}{\sqrt{25}} \amp = 1.96 </mrow>
|
||||
<mrow> S \amp = 50.5 + 1.96 \sqrt{25} = 60.3. </mrow>
|
||||
</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>
|
||||
</statement>
|
||||
</example>
|
||||
|
||||
<p>
|
||||
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>.
|
||||
For each hypothetical value of <m>\theta</m>, we'll calculate the probability of seeing extreme enough data to reject <m>H_0</m>.
|
||||
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>.
|
||||
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>
|
||||
|
||||
<example>
|
||||
<statement>
|
||||
<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>:
|
||||
<md>
|
||||
<mrow> \E(S) \amp = n\theta = 100\theta </mrow>
|
||||
@@ -83,17 +97,24 @@
|
||||
<mrow> \amp \approx (1 - 0.5398) + 0 </mrow>
|
||||
<mrow> \amp = 0.4602 </mrow>
|
||||
</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.
|
||||
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.)
|
||||
(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.
|
||||
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>
|
||||
</statement>
|
||||
</example>
|
||||
|
||||
<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>.
|
||||
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>
|
||||
|
||||
<exercises xml:id="exercises-Power">
|
||||
@@ -101,18 +122,43 @@
|
||||
<statement>
|
||||
<p>
|
||||
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>.
|
||||
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 <m>0.6</m> probability of coming up heads,
|
||||
what is the power of this test?
|
||||
</p>
|
||||
</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>
|
||||
<statement>
|
||||
<p>
|
||||
Suppose we have a coin which we suspect comes up heads more often than a fair coin would.
|
||||
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?
|
||||
Suppose we have a coin which we suspect comes up heads more often than
|
||||
a fair coin would.
|
||||
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>
|
||||
</statement>
|
||||
</exercise>
|
||||
@@ -121,45 +167,48 @@
|
||||
<introduction>
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
</introduction>
|
||||
|
||||
|
||||
<task>
|
||||
<statement>
|
||||
<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>
|
||||
</statement>
|
||||
</task>
|
||||
|
||||
|
||||
<task>
|
||||
<statement>
|
||||
<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>
|
||||
</statement>
|
||||
</task>
|
||||
|
||||
|
||||
<task>
|
||||
<statement>
|
||||
<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?
|
||||
</p>
|
||||
</statement>
|
||||
</task>
|
||||
|
||||
|
||||
<task>
|
||||
<statement>
|
||||
<p>
|
||||
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>
|
||||
</statement>
|
||||
</task>
|
||||
@@ -168,10 +217,17 @@
|
||||
<exercise>
|
||||
<statement>
|
||||
<p>
|
||||
Suppose a particular plant when grown outdoors has an average height of 39 in with a variance of 20 in<m>^2</m>.
|
||||
We suspect that growing this plant in a greenhouse will increase its 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?
|
||||
Suppose a particular plant when grown outdoors has an average height
|
||||
of 39 in with a variance of 20 in<m>^2</m>.
|
||||
We suspect that growing this plant in a greenhouse will increase its
|
||||
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>
|
||||
</statement>
|
||||
</exercise>
|
||||
|
||||
@@ -2,28 +2,41 @@
|
||||
<title>Two Sample Tests</title>
|
||||
|
||||
<p>
|
||||
In the previous section, we compared data collected from a sample against a known or supposed baseline.
|
||||
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>.
|
||||
In the previous section, we compared data collected from a sample against a
|
||||
known or supposed baseline.
|
||||
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>
|
||||
|
||||
<example>
|
||||
<statement>
|
||||
<p>
|
||||
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.
|
||||
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?
|
||||
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.
|
||||
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>
|
||||
Let <m>A_1</m> be the random variable representing average height of the control group of plants.
|
||||
This sample has size <m>n_1 = 50</m>, and we measured the average height <m>\mu_1 = 35</m>.
|
||||
Let <m>A_1</m> be the random variable representing average height of the
|
||||
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:
|
||||
<md>
|
||||
<mrow> \Var(A_1) \amp = \frac{\sigma^2}{n_1} = \frac{12}{50} = 0.24. </mrow>
|
||||
</md>
|
||||
Similarly, let <m>A_2</m> be the random variable representing average 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>.
|
||||
Similarly, let <m>A_2</m> be the random variable representing average
|
||||
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:
|
||||
<md>
|
||||
<mrow> \Var(A_2) \amp = \frac{\sigma^2}{n_2} = \frac{12}{30} = 0.4. </mrow>
|
||||
@@ -32,7 +45,8 @@
|
||||
</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:
|
||||
<md>
|
||||
<mrow>D = A_2 - A_1 = 36.4 - 35 = 1.4 </mrow>
|
||||
@@ -41,7 +55,8 @@
|
||||
<md>
|
||||
<mrow> \Var(D) = \Var(A_2 - A_1) = \Var(A_2) + \Var(A_1) = 0.24 + 0.4 = 0.64. </mrow>
|
||||
</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:
|
||||
<md>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<example>
|
||||
<statement>
|
||||
<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.
|
||||
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:
|
||||
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.
|
||||
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>
|
||||
<mrow> \widehat{\theta}_1 = \frac{10}{100} = 0.1. </mrow>
|
||||
</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>
|
||||
<mrow> \widehat{\theta}_2 = \frac{16}{100} = 0.16. </mrow>
|
||||
</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:
|
||||
<md>
|
||||
<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>
|
||||
</md>
|
||||
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.
|
||||
(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>
|
||||
<mrow> \widehat{\theta}_0 = \frac{10 + 16}{100 + 100} = \frac{26}{200} = 0.13. </mrow>
|
||||
</md>
|
||||
@@ -114,9 +142,16 @@
|
||||
<exercise>
|
||||
<statement>
|
||||
<p>
|
||||
A farmer is testing an experimental new plant fertilizer that is supposed to increase the weight of a particular apple variety.
|
||||
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>.
|
||||
A farmer is testing an experimental new plant fertilizer that is
|
||||
supposed to increase the weight of a particular apple variety.
|
||||
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>
|
||||
</statement>
|
||||
</exercise>
|
||||
@@ -124,14 +159,26 @@
|
||||
<exercise>
|
||||
<statement>
|
||||
<p>
|
||||
We have an established factory which produces coins that are close to fair.
|
||||
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.
|
||||
We have an established factory which produces coins that are close to
|
||||
fair.
|
||||
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 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>
|
||||
</statement>
|
||||
|
||||
<answer>
|
||||
<p>
|
||||
The <m>p</m>-value is <m>0.1738</m>, so we do not reject the null
|
||||
hypothesis.
|
||||
</p>
|
||||
</answer>
|
||||
</exercise>
|
||||
</exercises>
|
||||
</section>
|
||||
Reference in New Issue
Block a user