L7 - Test of Hypothesis Flashcards Preview

18ECA005 - Data Analysis II > L7 - Test of Hypothesis > Flashcards

Flashcards in L7 - Test of Hypothesis Deck (16)
Loading flashcards...

What is the logic behind the test of hypothesis?

- we do not know what µ is (all we have is X(bar) )
- how likely is it that µ is equal to a given number?

- Go back to the example of the mobile phone company; suppose that the
manager claims that their average monthly bill, µ, is £31;
- Your sample gives X(bar) = 32: does it mean that the manager is lying?
Claim: µ= 31 --- Sample evidence: X(bar) = 32
-Is the claim credible? Is it supported by sample evidence?
- this is a hypothesis

- We ask: is it likely for the average bill to be 31 given that the sample
average is 32? Or viceversa, how likely would I be to get a sample value
of 32 if the true mean were 31?
- This is the idea behind hypothesis testing: you have a value in mind (the
claim, or hypothesis: 31) and you want to test it against sample evidence
(32) and form an opinion on whether it is credible or not.
- More extreme example: if the claim was µ = 8 and yet X(bar)= 32 you
would probably suspect the claim (the hypothesis) not to be true;

- Because the sample mean is more likely than not to be close to the true
mean (unbiased estimator), and 32 seems very far from 8 (unless the
variance is really huge). You’d be thinking how likely would it be to get a
sample average of 32 if the true mean were 8?


Where do you start with the hypothesis testing procedure?

- Testing a hypothesis about a parameter, for instance the mean µ of a variable, means that we have a value in mind and we want to check whether/how much the sample evidence supports it.
- The value we test (µ{0}) is called the null hypothesis, labelled H{0}

H{0}: µ = µ{0}
eg: H{0}: µ = 8
- Together with the null we have to specify an alternative hypothesis
H{1}; this is a non-specific statement that holds true if our null is rejected
by the data.
- There are three kinds of alternative hypotheses:


What are the 3 kinds of alternative hypotheses?

- composite (or open) alternative
- One sided alternative - right tail;
- One sided alternative - left tail

- The choice depends on our assumptions and previous knowledge about the
problem, and should be made before looking at the sample data.


What is a Composite (or open) alternative?

- Starting with H{0}: µ = µ{0}
- then H{1}: µ ≠ µ{0}
- therefore µ could be > µ{0} or < µ{0}


What is a One sided alternative - right tail?

- Starting with H{0}: µ = µ{0}
- then H{1}: µ > µ{0}
- therefore if not µ{0} then µ must be > µ{0}


What is a One sided alternative - left tail?

- Starting with H{0}: µ = µ{0}
- then H{1}: µ < µ{0}
- therefore if not µ{0} then µ must be < µ{0}


What is the Hypothesis testing procedure for a composite (or open) alternative?

- Suppose we are testing:
H{0}:µ = µ{0} vs H{1}: µ ≠ µ{0}
- We now choose a significance level α (the area in the tails) for our test,
say of 5%.
- This means that we can construct a 95% confidence interval around the
hypothesised mean of µ{0} so that if our hypothesis is true then this is also
- P{ -1.96 < [X(bar)-µ{0}/ sqrt(σ^2/n)] < +1.96] = 0.95
- If µ = µ{0} then 95% of the values of must lie within this range

- We now look at where our sample mean falls:
- If it falls in the 95% area (acceptance region) we conclude that there is
enough evidence to support the null hypothesis and we do not reject
the null hypothesis.
- If it falls in one of the tails (the rejection region) we reject the null hypothesis: with a mean µ{0} it would be very unlikely (less than 5%) to get a sample average equal to X(bar) , i.e. our sample evidence does not support the null hypothesis.
- Alternatively we can use the C.I. to check where the null falls: centre the distribution around , i.e. around the sample evidence, and look how far from it is the null hypothesis.
- The inference will be exactly the same


What is the fastest way to carry out the hypothesis test for a composite (or open) alternative?

- A simpler, faster way to carry out this test is to compute formula (f1) directly rather than building a confidence interval. Recall:
- P{ -1.96 < [X(bar)-µ{0}/ sqrt(σ^2/n)] < +1.96] = 0.95
- We can compute directly the ratio X(bar) -µ{0}/ sqrt(σ^2/n)] and check if the resulting value fall withing +/- 1.96


What are the three different ways of testing a hypothesis?

- centering around µ
- centering around X(bar)
- testing whether its in between the values of Z on the confidence interval


What is the significance level?

- The level of significance = α = area in the tails = the probability of an
error-type I.
- An error-type I is the error of rejecting a true null hypothesis.
- We reject a hypothesis because we consider it unlikely; unlikely is not
the same as completely impossible. All we are saying is that if the null
were true then our sample mean would have a probability of occurring
of α or less.
- The smaller are the tails thus the lower the chance of rejecting the null
and therefore of making a type I error


It is a good idea to keep the tails as small as possible?

-No, because in this way you increase the probability of an error type
II: the probability of not rejecting a false null hypothesis:
- i.e., the true mean is not 0
, however the test statistic falls in the
acceptance region and we wrongly conclude in favour of the null
hypothesis. This error is larger the larger is our acceptance area.
- The probability of a type II error is denoted β.
- We define the robustness of a test as 1- β : a test is robust the smaller
is the probability of a type II error i.e. the less likely you are to accept a
false null.


What does a large significance level show?

- Large significance level (large tails) => larger probability of error-type I
(reject a true hypothesis)


What does a small significance level show?

Small tails, i.e. larger acceptance region => larger probability of errortype II (accept a wrong hypothesis)


How do you test against a one-sided alternative?

- Very simply we just use only one tail for the whole significance level (for
instance the whole of the 5%), then proceed as before:
- if our test value falls in the tail we reject, if not we do not reject.
- The tail we use depends on the alternative hypothesis: given H{0}: μ = μ{0}

- H{1}: μ > μ{0} we use the right tail
- we reject if X(bar)-µ{0}/ sqrt(σ^2/n)] > z and do not reject if it is smaller

- H{1}: μ < μ{0 we use the left tail
- we reject if X(bar)-µ{0}/ sqrt(σ^2/n)] < z and do not reject if it is larger


What does a one-sided alternative test mean?

- Ex right tailed test, H{1}: µ > µ{0}
- Why? Because by saying that if not µ{0} the true mean µ must be larger
than it we are saying that the true distribution lies to the right of
distribution under the null. Vice versa for the left tail test.


What is the P-value?

- The P-value is the true level of significance of a hypothesis: the level of
significance at which you would reject a particular hypothesis.
- In the mobile phone example consider H{0}: µ = 30 vs H{1}: µ > 30
- The test statistic is (32-30)/0.8 = 2.5 > 1.65 so we reject;
- However the P(Z>2.5) = 0.006 i.e. 0.6%
- This is the P-value: we are rejecting the null quite strongly, the null is
much more unlikely than 5%, it is 0.6%.
- The P value is a more accurate picture of the validity of a hypothesis.
- Note that the P value is usually reported as the whole area under 2
tails. In the example above it would therefore be reported as 1.2%