Hypothesis Testing

24
Hypothesis Testing An introduction

description

Hypothesis Testing. An introduction. Big picture. Use a random sample to learn something about a larger population. Two ways to learn about a population. Confidence intervals Hypothesis testing. Confidence Intervals. - PowerPoint PPT Presentation

Transcript of Hypothesis Testing

Page 1: Hypothesis Testing

Hypothesis Testing

An introduction

Page 2: Hypothesis Testing

Big picture

Use a random sample to learn something about a larger population.

Page 3: Hypothesis Testing

Two ways to learn about a population

• Confidence intervals

• Hypothesis testing

Page 4: Hypothesis Testing

Confidence Intervals

• Allow us to use sample data to estimate a population value, like the true mean or the true proportion.

• Example: What is the true average amount students spend weekly on alcohol?

Page 5: Hypothesis Testing

Hypothesis Testing

• Allows us to use sample data to test a claim about a population, such as testing whether a population proportion or population mean equals some number.

• Example: Is the true average amount that students spent weekly on alcohol $20?

Page 6: Hypothesis Testing

General Idea of Hypothesis Testing

• Make an initial assumption.

• Collect evidence (data).

• Based on the available evidence, decide whether or not the initial assumption is reasonable.

Page 7: Hypothesis Testing

Example: Grade inflation?

Population of 5 million college

studentsIs the average GPA 2.7?

Sample of 100 college students

How likely is it that 100 students would have an average GPA as large as 2.9 if the population average was 2.7?

Page 8: Hypothesis Testing

Making the Decision

• It is either likely or unlikely that we would collect the evidence we did given the initial assumption.

• (Note: “Likely” or “unlikely” is measured by calculating a probability!)

• If it is likely, then we “do not reject” our initial assumption. There is not enough evidence to do otherwise.

Page 9: Hypothesis Testing

Making the Decision (cont’d)

• If it is unlikely, then:– either our initial assumption is correct and we

experienced an unusual event– or our initial assumption is incorrect

• In statistics, if it is unlikely, we decide to “reject” our initial assumption.

Page 10: Hypothesis Testing

Idea of Hypothesis Testing: Criminal Trial Analogy

• First, state 2 hypotheses, the null hypothesis (“H0”) and the alternative hypothesis (“HA”)

– H0: Defendant is not guilty.

– HA: Defendant is guilty.

Page 11: Hypothesis Testing

An aside:Identification of hypotheses

• The null hypothesis always represents the status quo, i.e. the hypothesis that requires no change in current behavior.

• The alternative hypothesis is the conclusion that the researcher is trying to make.

Page 12: Hypothesis Testing

Criminal Trial Analogy (continued)

• Then, collect evidence, such as finger prints, blood spots, hair samples, carpet fibers, shoe prints, ransom notes, handwriting samples, etc.

• In statistics, the data are the evidence.

Page 13: Hypothesis Testing

Criminal Trial Analogy(continued)

• Then, make initial assumption.– Defendant is innocent until proven guilty.

• In statistics, we always assume the null hypothesis is true.

Page 14: Hypothesis Testing

Criminal Trial Analogy(continued)

• Then, make a decision based on the available evidence.– If there is sufficient evidence (“beyond a

reasonable doubt”), reject the null hypothesis. (Behave as if defendant is guilty.)

– If there is not enough evidence, do not reject the null hypothesis. (Behave as if defendant is not guilty.)

Page 15: Hypothesis Testing

Important “Boohoo!” Point

• Neither decision entails proving the null hypothesis or the alternative hypothesis.

• We merely state there is enough evidence to behave one way or the other.

• This is also always true in statistics! No matter what decision we make, there is always a chance we made an error.

• Boohoo!

Page 16: Hypothesis Testing

Errors in Criminal Trials

Truth

JuryDecision

Not guilty Guilty

Not guilty OK ERROR

Guilty ERROR OK

Page 17: Hypothesis Testing

Errors in Hypothesis Testing

Truth

DecisionNull

hypothesisAlternativehypothesis

Do notreject null

OKTYPE IIERROR

Reject nullTYPE IERROR

OK

Page 18: Hypothesis Testing

Definitions: Types of Errors

• Type I error: The null hypothesis is rejected when it is true.

• Type II error: The null hypothesis is not rejected when it is false.

• There is always a chance of making one of these errors. But, we will want to minimize the chance of doing so!

Page 19: Hypothesis Testing

Example: Putting it all together

Population of many, many adults

Is average adult body temperature 98.6 degrees? Or is it lower?

Sample of 80 adults

Average body temperature of 80 sampled adults is 98.4 degrees.

Page 20: Hypothesis Testing

Example (continued)

• Specify hypotheses.– H0: = 98.6 degrees

– HA: < 98.6 degrees

• Make initial assumption: = 98.6 degrees

• Collect data: Average body temp of 80 sampled adults is 98.4 degrees. How likely is it that a sample of 80 adults would have an average body temp as low as 98.4 if the average body temp of population was 98.6?

Page 21: Hypothesis Testing

Using the p-value to make the decision

• The p-value represents how likely we would be to observe such an extreme sample if the null hypothesis were true.

• The p-value is a probability, so it is a number between 0 and 1.

• Close to 0 means “unlikely.”

• So if p-value is “small,” (typically, less than 0.05), then reject the null hypothesis.

Page 22: Hypothesis Testing

Example (continued)

Test of mu = 98.6000 vs mu < 98.6000The assumed sigma = 0.600

Variable N Mean StDev SE Mean Z PTemp 80 98.4 0.67 0.0671 -2.80 0.0026

The p-value can easily be obtained from statistical software like MINITAB.

(Generally, the p-value is labeled as “P”)

Page 23: Hypothesis Testing

Example (continued)

• The p-value, 0.0026, indicates that, if the average body temperature in the population is 98.6 degrees, it is unlikely that a sample of 80 adults would have an average body temperature as extreme as 98.4 degrees.

• Decision: Reject the null hypothesis.

• Conclude that the average body temperature is lower than 98.6 degrees.

Page 24: Hypothesis Testing

What type of error might we have made?

• Type I error here is claiming that average body temp is lower than 98.6 when in fact it really isn’t.

• Type II error here is failing to claim that the average body temp is lower than 98.6 when it is.

• We rejected the null hypothesis, i.e. claimed body temp is lower than 98.6, so we may have made a Type I error. (Boohoo!)