# Stat 202: Lecture 18/19 (covers pp. 192-211)

Nathan VanHoudnos
11/7/2014

### Agenda

2. Lecture 18/19 (covers pp. 192-211)

mean(hw5/165)

[1] 0.7391053

median(hw5/165)

[1] 0.8484848


One of the harder homeworks.

Students did much better than on the test!

I have posted solutions, as promised.

(Place holder for postponed question.)

Here the most points were lost on Question 5.

• Many people missed the final question:

What is the probability that the true value of 50 is in a 95% confidence interval? (10 pts)

If we’re looking at a specific 95% confidence interval, the probability that the true value of 50 g is in there is either 0% or 100%.

If we’re talking about 95% confidence intervals as a whole, we know that 95% of the time they contain the true population mean. If we drew a 95% confidence interval from a hat that contained 100 95% confidence intervals, 95% of the time we will draw a mean-containing interval.

However, the probability that the mean is in the specific 95% confidence interval, due to the mean being a non-random value, is either 0% or 100%.

### A common misconception

A student wrote this:

The probability that the true value of [the] mean is in a 95% confidence interval is 95% or 0.95.

Although the way the question was asked makes this response tempting, it is still wrong.

This question is a lot like the Obama question from Homework 2.

If I tempt you to say something false it is your duty to hold the line.

You will see this again!

### Agenda

2. Lecture 18/19 (covers pp. 192-211)

### Hypothesis testing overview

1. If $$H_0$$ is true, then over many experiments

• 95% of 95% CIs will contain the value assumed by $$H_0$$, and
• 5% of 95% CIs will not contain it.
2. Use this to our advantage:

• retain $$H_0$$ if the CI contains the $$H_0$$ value, and
• reject $$H_0$$ when it does not.
3. Therefore, for a 95% CI when $$H_0$$ is true:

• 95% of experiments will correctly retain $$H_0$$
• 5% of experiments will incorrectly reject $$H_0$$.

### The mistakes we can make

We must either Retain $$H_0$$ or Reject $$H_0$$.

             Retain H0   |  Reject H0
==========|==============|===============
|              |
==========|==============|===============
|              |
==========|==============|===============


### The mistakes we can make

We must either Retain $$H_0$$ or Reject $$H_0$$.

If $$H_0$$ is true, then

             Retain H0   |  Reject H0
==========|==============|===============
H0 true   |   Good!      |  MISTAKE!
==========|==============|===============
|              |
==========|==============|===============


### The mistakes we can make

We must either Retain $$H_0$$ or Reject $$H_0$$.

If $$H_0$$ is false, then

             Retain H0   |  Reject H0
==========|==============|===============
H0 true   |   Good!      |  MISTAKE!
==========|==============|===============
H0 false  |   MISTAKE!   |  Good!
==========|==============|===============


### The mistakes we can make

We must either Retain $$H_0$$ or Reject $$H_0$$.

The two mistakes have special names:

             Retain H0    |  Reject H0
==========|===============|===============
H0 true   |  Good!        |  Type I error
==========|===============|===============
H0 false  | Type II error |  Good!
==========|===============|===============


Note: Everything thus far has focused on $$H_0$$ being true. We will get to Type II error in detail later.