Lecture 7

Lecture 7


Outline


Testing Hypotheses


Example 1

Is the Dow Jones just as likely to move higher as it is to move lower on any given day?

dow

Out of the 1112 trading days in that period, the average increased on 573 days (sample proportion = 0.5153 or 51.53%).

It far enough from 50% to cast doubt on the assumption of equally likely up or down movement?


Hypotheses

The null hypothesis, $H_0$, specifies a population model parameter and proposes a value for that parameter.

The alternative hypothesis, $H_A$, contains the values of the parameter that we consider plausible if we reject the null hypothesis.


Example 1 (cont.)

Find the standard deviation of the sample proportion of days on which the DJIA increased.


Example 1 (cont.)

If we assume that the DJIA increases or decreases with equal likelihood, we'll need to center our Normal sampling model at a mean of 0.5.

Then, the standard deviation of the sampling

\[SD(\hat{p}) = \sqrt \frac{pq}{n} = \sqrt \frac{(0.5)(1-0.5)}{1112} = 0.015\]

Example 1 (cont.)

dow2

How likely is it that the observed value would be 0.5153 – 0.5 = 0.0153 units away from the mean?

This is the probability of observing more than 51.53% up days (or more than 51.53% down days) if the null model were true.


A Trial as a Hypothesis Test


P-Values

The P-value is the probability of seeing the observed data (or something even less likely) given the null hypothesis.


Example 2

Which of the following are true?


Example 2 (cont.)

Which of the following are true?


The Reasoning of Hypothesis Testing

Four sections: hypothesis, model, mechanics, and conclusion.

Hypotheses


The Reasoning of Hypothesis Testing (cont.)

Model


The Reasoning of Hypothesis Testing (cont.)

Your model step should end with a statement such as:

Each test has a name that you should include in your report. The test about proportions is called a one-proportion z-test.


One-proportion z-test

The conditions for the one-proportion z-test are the same as for the one-proportion z-interval. We test the hypothesis $H_0:p=p_0$ using the statistic $z = \frac{\hat{p} - p_0}{SD(\hat{p})}$


The Reasoning of Hypothesis Testing (cont.)

Mechanics


The Reasoning of Hypothesis Testing (cont.)

Conclusions and Decisions


Alternative Hypotheses

In a two-sided alternative we are equally interested in deviations on either side of the null hypothesis value

\[H_0: p = p_0, \; H_A: p \neq p_0\]

An alternative hypothesis that focuses on deviations from the null hypothesis value in only one direction is called a one-sided alternative.

\[H_0: p = p_0, \; H_A: p < p_0 \;\text{or} \;p > p_0\]

Example 3

A survey of 100 CEOs finds that 60 think the economy will improve next year. Is there evidence that the rate is higher among all CEOs than the 55% reported by the public at large?


Example 3 (cont.)

A survey of 100 CEOs finds that 60 think the economy will improve next year. Is there evidence that the rate is higher among all CEOs than the 55% reported by the public at large?


One-Sample t-Test

For testing a hypothesis about a mean, the test is based on the t distribution.

Is there evidence from a sample that the mean is really different from some hypothesized value calls for a one-sample t-test for the mean.


One-sample t-test for the mean

The conditions for the one-sample t-test for the mean are the same as for the one-sample t-interval. We test the hypothesis $H_0: \mu = \mu_0$ using the statistic

\[t_{n-1} = \frac{\bar{y}-\mu_0}{SE(\bar{y})}\]

where the standard error of is $SE(\bar{y}) = s/\sqrt n$


Alpha Levels and Significance

We can define a "rare event" arbitrarily by setting a threshold for our P-value, alpha level, $\alpha$.

We call such results statistically significant.


Example 4

A new manager of a small convenience store randomly samples 20 purchases from yesterday's sales. If the mean was 45.26 and the standard deviation was 20.67, is there evidence that the mean purchase amount is at least 40?


Example 4 (cont.)

\[H_0: \mu = 40, \; H_A: \mu \geq 40\]
\[t = \frac{45.26 - 40}{20.67/\sqrt{20}} = 1.138\]
\[\text{P-value} = 0.1346\]

Critical Values

A critical value, $z^\ast$, corresponds to a selected confidence level.

Here are the traditional $z^\ast$ critical values from the Normal model:

$\alpha$1-sided2-sided
0.051.6451.96
0.012.332.576
0.0013.093.29

Confidence Intervals and Hypothesis Tests


Example 5

Recall the new manager of a small convenience store who randomly sampled 20 purchases from yesterday's sales.


Example 5 (cont.)

Given a 95% confidence interval (35.586, 54.934), is there evidence that the mean purchase amount is different from 40?

Is the confidence interval conclusion consistent with the (two-sided) P-value = 0.2692?


Two Types of Errors

We can make mistakes in two ways:

  1. (False Hypothesis) The null hypothesis is true, but we mistakenly reject it.

  2. (False Negative) The null hypothesis is false, but we fail to reject it.

These two types of errors are known as Type I and Type II errors respectively.


Two Types of Errors (cont.)

errors

When you choose level $\alpha$, you’re setting the probability of a Type I error to $\alpha$.


Power