16
INTRODUCTION REAL LIFE APPLICATIONS DEFINITIONS STRUCTURE Hypothesis Testing

Hypothesis Testing Lesson 1

  • Upload
    yhchung

  • View
    115

  • Download
    1

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Hypothesis Testing Lesson 1

INTRODUCTION

- REAL LIFE APPLICATIONS- DEFINITIONS- STRUCTURE

Hypothesis Testing

Page 2: Hypothesis Testing Lesson 1

Lesson Objectives

By the end of this lesson, you should be able to:1. Describe real-life examples to explain the motivation behind

hypothesis testing.2. State the definitions of the terminologies.3. Identify the steps in the structure of hypothesis testing.4. Explain, in the context of a given scenario, the meaning

of the terminologies.5. Formulate the null (H0) and alternative (H1) hypotheses of a

given scenario.

Page 3: Hypothesis Testing Lesson 1

What is hypothesis testing?

A statistical hypothesis is an assumption about the value of a population parameter.

Hypothesis testing is…

the process of testing the validity of the statistical hypothesis

based on a random sample drawn from the population.

Page 4: Hypothesis Testing Lesson 1

What is hypothesis testing?

Data from the sample is

collected.

REJECT or

DO NOT REJECT

Modified from http://www2.seminolestate.edu/jmclaughlin/zSTAT/lecture15.htm

Does a sample mean of 327 ml provide sufficient evidence to

justify that mean fill of the population is 330 ml?

A plant manager believes that: mean fill of the population of

Coca Cola cans is 330ml

327

Page 5: Hypothesis Testing Lesson 1

Why study hypothesis testing?

Hypothesis testing is performed regularly in many industries.

Pharmaceutical industry must perform many hypothesis tests on new drug products before they are deemed to be safe and effective by the federal Food and Drug Administration (FDA). In these instances, the drug is hypothesized to be both unsafe and ineffective. Then, if the sample results from the studies performed provide “significant” evidence to the contrary, the FDA will allow the company to market the drug.

Basis of the legal systemin which judges and juries hear evidence in court cases. In a criminal case, the hypothesis in the American legal system is that the defendant is innocent. Based upon the totality of the evidence presented in the trial, if the jury concludes that “beyond a reasonable doubt” the defendant committed the crime, the hypothesis of innocence will be rejected and the defendant will be found guilty. If the evidence is not strong enough, the defendant will be judged not guilty. (Innocent until proven guilty!)

www.prenhall.com/divisions/bp/app/chapters/groebner7/Chapter09.pdf

Page 6: Hypothesis Testing Lesson 1

Why study hypothesis testing?

Business StatisticsSuppose a Coca-Cola plant produces approximately 400,000 cans of Coke products daily. Each can is supposed to contain 330ml of fluid. However, like all processes, the automated filling machine is subject to variation and each can will contain either slightly more or less than the 330ml target. The important thing is that the mean fill is 330ml. The plant quality manager’s initial belief is that the filling process is providing an average fill of 330ml. This is his hypothesis.

Every two hours, the plant quality manager selects a random sample of cans and computes the sample mean. If the sample mean is “close” to 330ml, then the sample data would tend to support the hypothesis and the machine would be allowed to continue filling cans. However, if the sample mean is “significantly” higher or lower than 330ml, the data would refute the hypothesis and the machine would be stopped and adjusted.

Page 7: Hypothesis Testing Lesson 1

Definitions

Population mean, µ

Null Hypothesis, H0

This is a statement about a parameter of the population which is initially, orconventionally believed to be true. It is denoted by H0.

In our syllabus, H0 will always be stated as an equality claim, for example H0 : µ = 25

Alternative Hypothesis , H1

It is any other hypothesis when the null hypothesis is rejected. It is denoted by H1.

Examples of the 3 possible H1 in our syllabus are µ > 25 , µ < 25 and µ ≠ 25 .

 

Page 8: Hypothesis Testing Lesson 1

Definitions

Test StatisticIt is a sample statistic which is used to make the decision whether or not

to rejectthe null hypothesis.

A random sample is selected from the given population and a relevant test statistic with

respect to the parameter of interest is observed.

Level of SignificanceIt is the largest probability of wrongly rejecting H0 (when H0 is in fact true).In other words, it refers to how much error we allow to wrongly reject H0.

If the level of significance is 5%, then there is a probability of 0.05 that we reject H0 when H0 is in fact true.

(We are 95% confident that we would make the right decision.)

Important definition!

Page 9: Hypothesis Testing Lesson 1

Definitions

Decision Criteria (we will learn more about this in the next lesson)

Critical RegionIt is the set of values of the test statistic for which H0 will be rejected.

This set of values is determined by the level of significance.

The boundaries of the critical region are called the critical values.

p-valueIt is the smallest level of significance for the null hypothesis to be rejected. It represents the probability of obtaining a test statistic as extreme as the one calculated from the sample, assuming that the null hypothesis is true.

In other words, if we set our level of significance at this p-value or higher, we will end up rejecting the null hypothesis.

Important definition!

Page 10: Hypothesis Testing Lesson 1

Structure

Suppose a Coca-Cola plant produces approximately 400,000 cans of Coke products daily. Each can is supposed to contain 330ml of fluid.

Step 0Define the parameter to be tested

Let µ be the mean fill of the population of Coca-Cola cans

Step 1Decide the null and alternative

hypothesesH0: µ= 330 H1: µ≠ 330

Step 2State the level of significance

Level of significance: 5%

However, like all processes, the automated filling machine is subject to variation and each can will contain either slightly more or less than the 330ml target. The important thing is that the mean fill is 330ml.The plant quality manager’s initial belief is that the filling process will provide a mean fill of 330ml. This is his null hypothesis.He wishes to check if the mean fill differs from 330ml. This is his alternative hypothesis.The plant manager decides his level of tolerance for error: He will allow at most a 5% chance of wrongly rejecting H0 (i.e. mean fill is 330) when H0 is true (i.e. mean fill is indeed 330).

Page 11: Hypothesis Testing Lesson 1

Structure

The mean fill of Coca Cola cans is normally distributed with mean 330 and variance 2.6.

Step 3State the distribution of the

population mean[Apply Sampling Theory]

Let X be the fill of a Coca Cola can. Under H0,

2.6~ N 330,

50X

2.

330,

6 /N(0,1)

50/Z

X XZ

n

X

The plant quality manager selects a random sample of 50 cans and computes the sample mean, 327x

Page 12: Hypothesis Testing Lesson 1

StructureStep 5

Decision CriteriaCalculate test statistic and p-value

[using the sample mean ]

More on this the next lesson

Step 6Reject H0/Do not reject H0

Step 7Conclude

327x

Based on the decision criteria, there are two possible conclusions:

• Possibility #1(the sample mean is “significantly” higher or lower than 330ml)

Reject H0. There is sufficient evidence at 5% level of significance to conclude [H1 ] the mean fill of Coke cans is not equal to 330ml.

• Possibility #2(the sample mean is NOT “significantly” higher or lower than 330ml)

Do not reject H0. There is insufficient evidence at 5% level of significance to conclude [H1 ] the mean fill of Coke cans is not equal to 330ml.

Compare test statistic with critical

value

Compare p-value with

level of significance

Page 13: Hypothesis Testing Lesson 1

Types of tests

1. One tailed testA one-tailed test looks for a definite increase (upper-tail) or a definite decrease (lower-tail) in the parameter

used.

2. Two tailed testThis test looks for any difference or change in the parameter used.

The type of test we choose, together with the level of significance, determines the critical

region of the hypothesis test.

Type of test

One-tailed testTwo-tailed

testUpper-tail Lower-tail

ExampleH0: µ = 330 H1: µ > 330

H0: µ = 330 H1: µ < 330

H0: µ = 330 H1: µ ≠ 330

Page 14: Hypothesis Testing Lesson 1

Formulating H0 and H1

In the following examples, formulate the null and alternative hypotheses.

A random sample of JC students was each given an IQ test to decide whether JC students have a mean IQ of 100 or greater than 100.

 

Suppose that, according to national standards, 5 year old children of height 87.5 – 92.5 cm have a mean weight of 13 kg. The weights of a random sample of 5 year old children of height 87.5 – 92.5 cm are collected. Are 5 year old children of height 87.5 – 92.5 cm below average weight for their height?

1

0H : 100

H : 100

1

0H : 13

H : 13

• Recall that the null hypothesis (H0) is stated as an equality claim. Assume that mean IQ of JC students is 100.

• Want to prove: mean IQ of JC students is greater than 100.

• Recall that the null hypothesis (H0) is stated as an equality claim. Assume that average weight of 5 year olds of height 87.5 – 92.5 cm is 13 kg.

• Want to prove: average weight of 5 year olds of height 87.5 – 92.5 cm is less than 13 kg.

Page 15: Hypothesis Testing Lesson 1

Formulating H0 and H1

A machine produces components of mean length 10 cm if set up correctly. A random sample of components produced is taken, and the length of each component is measured. Is the machine set up correctly?

 

The principal of a school claims that the mean ‘A’ Level score of all its students is at least 80. Has the principal overstated the mean?

1

0H : 10

H : 10

1

0H : 80

H : 80

• Recall that the null hypothesis (H0) is stated as an equality claim. Assume machine is set up correctly: mean length 10 cm. • We want to know if the machine is set up incorrectly (we are only interested in whether it differs from 10 cm, not interested in whether it is ‘more’ or ‘less’ than 10 cm.)Want to prove: mean length of components is not 10 cm

• Recall that the null hypothesis (H0) is stated as an equality claim. Assume mean ‘A’ Level score of all students is 80.

• In order to justify that the principal has indeed overstated the mean score, we need to prove that the mean ‘A’ Level score should be less than 80.

Page 16: Hypothesis Testing Lesson 1

Task

Compare hypothesis testing at ‘5% level of significance’ and ‘10% level of significance’, which is a stricter test? Explain why.

Is 'do not reject the null hypothesis' equivalent to 'accept the null hypothesis'?

Check if you have met the lesson objectives!