Applied Regression Modeling. Iain Pardoe
Чтение книги онлайн.
Читать онлайн книгу Applied Regression Modeling - Iain Pardoe страница 22
Figure 1.6 Home prices example—density curve for the t‐distribution with
Lower‐tail tests work in a similar way to upper‐tail tests, but all the calculations are performed in the negative (left‐hand) tail of the t‐distribution density curve; Figure 1.7 illustrates. A lower‐tail test would result in an inconclusive result for the home prices example (since the large, positive t‐statistic means that the data favor neither the null hypothesis,
Figure 1.7 Relationships between critical values, significance levels, test statistics, and p‐values for one‐tail hypothesis tests.
Figure 1.8 Relationships between critical values, significance levels, test statistics, and p‐values for two‐tail hypothesis tests.
Two‐tail tests work similarly, but we have to be careful to work with both tails of the t‐distribution; Figure 1.8 illustrates. For the home prices example, we might want to do a two‐tail hypothesis test if we had no prior expectation about how large or small sale prices are, but just wanted to see whether or not the realtor's claim of
State null hypothesis: : .
State alternative hypothesis: : .
Calculate test statistic: .
Set significance level: 5%.
Look up t‐table:– critical value: The 97.5th percentile of the t‐distribution with 29 degrees of freedom is 2.045 (from Table C.1); the rejection region is therefore any t‐statistic greater than 2.045 or less than (we need the 97.5th percentile in this case because this is a two‐tail test, so we need half the significance level in each tail).– p‐value: The area to the right of the t‐statistic (2.40) for the t‐distribution with 29 degrees of freedom is less than 0.025 but greater than 0.01 (since from Table C.1 the 97.5th percentile of this t‐distribution is 2.045 and the 99th percentile is 2.462); thus, the upper‐tail area is between 0.01 and 0.025 and the two‐tail p‐value is twice as big as this, that is, between 0.02 and 0.05.
Make decision:– Since the t‐statistic of 2.40 falls in the rejection region, we reject the null hypothesis in favor of the alternative.– Since the p‐value is between 0.02 and 0.05, it must be less than the significance level (0.05), so we reject the null hypothesis in favor of the alternative.
Interpret in the context of the situation: The 30 sample sale prices suggest that a population mean of seems implausible—the sample data favor a value different from this (at a significance level of 5%).
1.6.3 Hypothesis test errors
When we introduced significance levels in Section 1.6.1, we saw that the person conducting the hypothesis test gets to choose this value. We now explore this notion a little more fully.
Whenever we conduct a hypothesis test, either we reject the null hypothesis in favor of the alternative or we do not reject the null hypothesis. “Not rejecting” a null hypothesis is not quite the same as “accepting” it. All we can say in such a situation is that we do not have enough evidence to reject the null—recall the legal analogy where defendants are not found “innocent” but rather are found “not guilty.” Anyway, regardless of the precise terminology we use, we hope to reject the null when it really is false and to “fail to reject it” when it really is true. Anything else will result in a hypothesis test error. There are two types of error that can occur, as illustrated in the following table: Hypothesis test errors
Decision | ||||
Do not reject |
Reject |
|||
Reality |
|
Correct decision | Type 1 error | |
|
Type 2 error | Correct decision |
A type 1 error can occur if we reject the null hypothesis when it is really true—the probability of this happening is precisely the significance level. If we set the significance level lower, then we lessen the chance of a type 1 error occurring. Unfortunately, lowering the significance level increases the chance of a type 2 error occurring—when we fail to reject the null hypothesis but we should have rejected it because it was false. Thus, we need to make a trade‐off and set the significance level low enough that type 1 errors have a low chance of happening, but not so low that