# Solutions 6 ```Solutions 6
(1) In a statistical test about &micro; the null hypothesis was rejected. Based on this conclusion,
which of the following statements are true?
(a) A type I error was committed.
FALSE.
When the null hypothesis is rejected (and we accept the null), there
are two possible outcomes. We have either (a) correctly rejected null
- that is we have correctly proven the null wrong or (b) mistakenly
rejected the null - that is said the null was wrong when it was in fact
correct. The probability of wrongly rejecting the null when it is correct
is called a type I error.
(b) A type II error was committed.
FALSE
If we reject the null we cannot reject have committed a type II error.
A type II error is committed if we don’t reject the null when in fact
the alternative is true.
(c) A type I error could have been committed.
TRUE.
As we mentioned in (a), if we reject the null we could have committed
a type I error. We will never know!
(d) A type II error could have been committed.
FALSE.
As we mentioned in (b), if we reject the null we can never have committed a type II error.
(e) It is impossible to have committed both a type I and type II error.
TRUE.
(f) It’s impossible that neither a type I or type II error was committed.
FALSE. A type I or type II error could have been committed.
(g) Whether an error was committed or not is unknown, but if an error was made,
then it was a type I error.
TRUE.
See part (a).
(h) Whether an error was committed or not is unknown, but if an error was made,
then it was a type II error.
FALSE.
See part (b).
(2) True or False?
(a) In a level α = 0.05 test of a hypothesis, increasing the sample size will not affect
the level of the test.
TRUE.
The level of the test does not depend on the sample size.
(b) In a level α = 0.05 test of a hypothesis, increasing the sample size will not affect
the power of the test.
FALSE.
As we increase the sample size the power of the test increases - recall
the examples we did in class. In other words, if H0 : &micro; = 1 and HA : &micro; &gt; 1
and we want to calculate the chance of detecting the mean &micro; = 2 (this
the alternative is true), as we increase the sample size is becomes easier
to detect that the population mean is 2.
(c) The sample size n plays an important role in testing a hypothesis because it
measures the amount of data (and hence information) upon which we base a
decision. If the data is quite variable and n is small, it is unlikely that we will
reject the null when when the null is false.
TRUE.
If the sample size is small and the data is highly variable (large standard
√
deviation), then the standard error is large (recall the formula σ/ n,
where σ is the variability of the data and n the sample size). A large
standard error means there will a lot of variation in the sample mean.
This makes it harder to detect what the true population mean is (a
shielding effect), and thus harder to reject the null when the mean is
different to what the mean null.
(d) Supose we are testing the following hypothesis about the population mean &micro;,
H0 : &micro; ≤ 4 versus HA : &micro; &gt; 4. If the sample size is very large and the variable
is not highly variable (hence small variance), it is highly likely we will reject the
null hypothesis even when the true value of &micro; is only trivially larger than 4.
TRUE.
As we mentioned in the class, this is an example of impractical significance. It is rare in practice that the mean will ever equal exactly
4.
For very large samples, the standard error of the sample mean will
very small. Thus the estimate of the mean is likely to be close to the
population mean. This means for large samples we are highly likely to
reject the null even if the mean is &micro; = 4.0001 (trivially greater than 4.)
(3) Import the calf weight data (it can be found by the side of this homework) into
Statcrunch. It is believed that the weight of a newborn animal (in general) drops
immediately after they are born and only after a few weeks does the weight get back
to the birth weight and above. We want to investigate whether the calf weight data
suggests this to be true. Look at the data in Statcrunchs. The column with Wt 0
contains all the weights at birth. Wt 0.5 contains the weights at week 0.5, Wt 1 the
weights at week 1 etc.
(a) Explain why there is matching for the weights of the calves at various weeks.
We have the weight of calves over the week. Since the same calves are
observed over the weeks, it is clear that there is a matching of the data
sets over the weeks. Thus to watch the change in calf weights over the
weeks one must consider the differences in weights.
(b) For each of the following situations first write the correct hypothesis and then do
the following tests at the 5% level (the Statcrunch instructions can be found on
my slides).
(i) Do a matched paired t-test to see if there is evidence to support the view that
the weight has dropped between week 0 and week 1.
Figure 1: Comparing between birth and Week 1
To see if there is a loss in weight as calves go from birth to week 1 we
are testing H0 : &micro;week 0 − &micro;week 1 = 0 against HA : &micro;week 0 − &micro;week 1 &gt; 0.
The p-value is less than 0.1%, based on this, there is evidence to
suggest that there is a loss in mean weight.
(ii) Do a matched paired t-test to see if there is evidence to support the view that
the weight has dropped between week 0 and week 2.
Figure 2: Comparing between brith and week 2
To see if there is a loss in weight as calves go from birth to week 2 we
are testing H0 : &micro;week 0 − &micro;week 2 = 0 against HA : &micro;week 0 − &micro;week 2 &gt; 0.
The p-value is less than 0.1%, based on this, there is evidence to
suggest that there is a loss in mean weight.
(iii) Do a matched paired t-test to see if there is evidence to support the view that
the weight has dropped between week 0 and week 3.
Figure 3: Comparing between birth and week 3 (one-sided test, for a decrease in weights)
To see if there is a loss in weight as calves go from birth to week 3 we
are testing H0 : &micro;week 0 − &micro;week 3 = 0 against HA : &micro;week 0 − &micro;week 3 &gt; 0.
The p-value is 72% based on this, there is evidence to suggest that
there is a loss in mean weight. Looking at the numbers, it is clear
that the p-value would be larger than 50%, since the difference is
negative. There can’t be any evidence for a the mean differences
to be positive when in fact the difference in the sample means is
negative.
We re-do the test, but this time looking for any difference (not just
an increase or a decrease). This means testing H0 : &micro;week 0 −&micro;week 3 =
0 against HA : &micro;week 0 − &micro;week 3 6= 0. In this case the p-value is 54.8%
and we cannot reject the null. This means there is no evidence to
suggest that the mean weight of the calf is different to the mean
birth weight.
Figure 4: Comparing difference between birth weight and weight at Week 3 (looking for a
difference).
(iv) Do a matched paired t-test to see if there is evidence to support the view that
the weight has increased between week 0 and week 3.
This means testing H0 : &micro;week 0 − &micro;week 4 = 0 against H0 : &micro;week 0 −
&micro;week 3 &lt; 0. The p-value can be obtained directly by re-running
Statcrunch, but can also be deduced from either of the outputs in
part (iii). From these outputs (noting that now the alternative is
pointing in the opposite direction), we can deduce that the p-value
%). Thus there is no
is 100-72.58 = 37.56% (or equivalently 54.82
2
evidence to reject the null.
(v) Do a matched paired t-test to see if there is evidence to support the view that
the weight has dropped between week 0 and week 4.
Here we are testing H0 : &micro;week 0 − &micro;week 4 = 0 against HA : &micro;week 0 −
&micro;week 4 &gt; 0. From Figure 5 it is clear that the sample mean difference is negative (-8.3) and are testing for a positive difference in
the population means, so there is no evidence to support the alternative. In fact we can also deduce that p-value for this hypothesis
is greater than 99.99% (since it the t-stat - which is the real measure of distance is huge and the p-value in the opposite direction is
less than 0.01%). This p-value can be obtained directly from the
Statcrunch, but we have deduced the p-value using Figure 5, which
gives the hypothesis in the opposite direction.
(v) Do a matched paired t-test see if there is evidence to support the view that
the weight has increased between week 0 and week 4.
Now we want to see if there is a weight gain at week 4. This
means testing the hypothesis. H0 : &micro;week 0 − &micro;week 4 = 0 against
H0 : &micro;week 0 − &micro;week 4 &lt; 0. We see from Figure 5 that the p-value is
less than 0.1%, thus at the 5% level there is evidence to suggest
that at week 4 the mean weight has increase from birth.
Figure 5:
(c) Based on your results in (b) summarise the mean behaviour of calf weights from
week 0 to week 4.
Write this as a mini report (say about 5 lines) summarising how you came to your
conclusions.
From the tests that we have done above, the data suggests that compared to their birth weight there is a drop in the weight of calves at
week 1 and week 2, and from week 4 onwards the weight has returned
and there is an increase from birth weight.
What happens at week 3 is a little ambigious, we could not reject the
null for both the one-sided and two-sided tests, this means there is no
evidence to suggest the mean weight at week 3 is any different to the
mean birth weight. We know that we cannot reject a null, but I would
hazard a non-statistical guess that at week 3 the weight is back to the
birth weight.
```