Some Chap 5 answers
This commit is contained in:
@@ -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>
|
||||
@@ -111,27 +139,46 @@
|
||||
</example>
|
||||
|
||||
<exercises xml:id="exercises-Two-Sample-Tests">
|
||||
<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>.
|
||||
</p>
|
||||
</statement>
|
||||
</exercise>
|
||||
<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>.
|
||||
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>
|
||||
|
||||
<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.
|
||||
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?
|
||||
</p>
|
||||
</statement>
|
||||
</exercise>
|
||||
<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.
|
||||
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?
|
||||
</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