Top Banner
Chapter 7: Hypothesis Testing A hypothesis is a conjecture about a population. Typically, these hypotheses will be stated in terms of a parameter. A test of hypothesis is a statistical procedure used to make a decision about the conjectured value of a parameter. We will make our decision based on observed values of a statistic.
31
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ch7 205 (1)

Chapter 7: Hypothesis Testing

A hypothesis is a conjecture about a population.

Typically, these hypotheses will be stated in terms of a parameter.

A test of hypothesis is a statistical procedure used to make a decision about the conjectured value of a parameter.

We will make our decision based on observed values of a statistic.

Page 2: ch7 205 (1)

• The purpose of hypothesis testing is to determine whether there is enough statistical evidence in favor of a certain belief about a parameter.

• Examples– Is there statistical evidence in a random sample of potential

customers, that support the hypothesis that more than 10% of the potential customers will purchase a new products?

– Is a new drug effective in curing a certain disease? A sample of patients is randomly selected. Half of them are given the drug while the other half are given a placebo. The improvement in the patients conditions is then measured and compared.

Page 3: ch7 205 (1)

The Hypotheses

There are two hypotheses which we are comparing.

The null hypothesis, H0, specifies a value of a parameter. This hypothesis is assumed to be true, and the collected data will be analyzed to see if it is contradictory to the null hypothesis.

The alternative hypothesis, Ha, gives an opposing statement about the value of the parameter. The collected data will be analyzed to see if it supports the alternative hypothesis.

Page 4: ch7 205 (1)

Examples: Give the null hypothesis and the alternative hypothesis

• You are investigating a complaint that “special delivery mail takes too much time” to be delivered

• You want to show that people find the new design for a recliner chair more comfortable than the old design.

• You are trying to show that cigarette smoke has an effect on the quality of a person’s life

Page 5: ch7 205 (1)

Examples: Give the null hypothesis and the alternative hypothesis

• The mean age of the students enrolled in evening classes at a certain college is greater than 26 years.

• The mean weight of packages shipped on Air Express during the past month was less than 36.7 lb.

• The mean life of fluorescent light bulbs is at least 1600 hours.

• The mean grade of a student in a statistics class is not 80.

Page 6: ch7 205 (1)

Concepts of Hypothesis Testing• The critical concepts of hypothesis testing.

– Example:• An operation manager needs to determine if the mean

demand during lead time is greater than 350.• If so, changes in the ordering policy are needed.

– There are two hypotheses about a population mean: • H0: The null hypothesis = 350 • Ha: The alternative hypothesis > 350

This is what you want to prove

Page 7: ch7 205 (1)

= 350

Assume the null hypothesis is true (= 350).

– Sample from the demand population, and build a statistic related to the parameter hypothesized (the sample mean).

– Pose the question: How probable is it to obtain a sample mean at least as extreme as the one observed from the sample, if H0 is correct?

Page 8: ch7 205 (1)

– Since the is much larger than 350, the mean is likely to be greater than 350. Reject the null hypothesis.

x

355x

= 350

Assume the null hypothesis is true (= 350).

450x

– In this case the mean is not likely to be greater than 350. Do not reject the null hypothesis.

Page 9: ch7 205 (1)

Statistical Terminology

Once the data is collected, we seek an answer to the question: “If the null hypothesis is true, how likely are we to observe this type of data, or data which is more extreme in the direction of the alternative hypothesis?”

The observed significance level, or p-value of a test of hypothesis is the probability of obtaining the observed value of the sample statistic, or one which is even more supportive of the alternative hypothesis, under the assumption that the null hypothesis is true.

Page 10: ch7 205 (1)

Statistical Terminology

For example, let’s assume that we are testing the hypothesis that the mean gas mileage for a certain type of car is 24 miles per gallon against an alternative that the mean is more than 24 mpg.

H0: = 24 mpg Ha: > 24 mpg

If a sample of 50 cars have a sample mean of 24.2 mpg, this gives a certain p-value.

If the sample of 50 cars had a sample mean of 25.0 mpg, the p-value is even smaller, since this would be more unusual to see if H0 is true ( = 24 mpg).

Page 11: ch7 205 (1)

Test Statistics and P-values

Obviously, we must be able to calculate these p-values.

A test statistic is a quantity calculated from the sampled value of a statistic, which is then used to calculate a

p-value for a test of hypothesis.

We recall that under appropriate conditions, we know the sampling distribution of the sample mean follows a normal distribution, and we can find a z-score using

x

x

x xz

n

Page 12: ch7 205 (1)

Decision Rule

Based on the z-score calculated, we can determine how likely we are to get a sample mean (x-bar) like we observed or one more supportive of Ha.

Decision Rule: This tells us when we feel the observed data provided sufficient evident to conclude the alternative hypothesis is true.

It will be phrased as: Accept the alternative hypothesis when the p-value of the test is less than .

The value of will be given in each exercise. It does NOT depend on the sample data. (More details later)

Page 13: ch7 205 (1)

Testing the Population Mean When the Population Standard Deviation is Known

• Example– A new billing system for a department store will be

cost- effective only if the mean monthly account is more than $170.

– A sample of 400 accounts has a mean of $178.– If accounts are approximately normally distributed with

= $65, can we conclude that the new system will be cost effective?

Page 14: ch7 205 (1)

• – Solution– The population of interest is the credit accounts

at the store.– We want to know whether the mean account for

all customers is greater than $170.

Ha : > 170– The null hypothesis must specify a single value

of the parameter H0 : = 170

Testing the Population Mean ( is Known)

Page 15: ch7 205 (1)

– The p-value provides information about the amount of statistical evidence that supports the alternative hypothesis.

– The p-value of a test is the probability of observing a test statistic at least as extreme as the one computed, given that the null hypothesis is true.

– Let us demonstrate the concept on this example.

P-value Method

Page 16: ch7 205 (1)

0069.)4615.2z(P

)40065170178

z(P

170x 178x

The probability of observing a test statistic at least as extreme as 178, given that = 170 is…

The p-value

P-value Method

)170when178x(P

Page 17: ch7 205 (1)

Because the probability that the sample mean will assume a value of more than 178 when = 170 is so small (.0069), there are reasons to believe that > 170.

178x

170:H x0 170:H x1

…it becomes more probable under H1, when 170x

Note how the event is rare under H0

when but...178x

,170x

Interpreting the p-value

Page 18: ch7 205 (1)

178x

170:H x0 170:H x1

We can conclude that the smaller the p-value the more statistical evidence exists to support the alternative hypothesis.

We can conclude that the smaller the p-value the more statistical evidence exists to support the alternative hypothesis.

Interpreting the p-value

Page 19: ch7 205 (1)

• Describing the p-value– If the p-value is less than 1%, there is overwhelming

evidence that supports the alternative hypothesis.

– If the p-value is between 1% and 5%, there is a strong evidence that supports the alternative hypothesis.

– If the p-value is between 5% and 10% there is a weak evidence that supports the alternative hypothesis.

– If the p-value exceeds 10%, there is no evidence that supports the alternative hypothesis.

Interpreting the p-value

Page 20: ch7 205 (1)

– The p-value can be used when making decisions based on rejection region methods as follows:• Define the hypotheses to test, and the required significance

level • Perform the sampling procedure, calculate the test statistic and

the p-value associated with it.

• Compare the p-value to Reject the null hypothesis only if p-value <; otherwise, do not reject the null hypothesis.

The p-value

34.175xL

= 0.05

170x

178x

The p-value Method

Page 21: ch7 205 (1)

• If we accept the alternative hypothesis, we conclude that there is enough evidence to infer that the alternative hypothesis is true.

• If we do not accept the alternative hypothesis, we conclude that there is not enough statistical evidence to infer that the alternative hypothesis is true.

• If we accept the alternative hypothesis, we conclude that there is enough evidence to infer that the alternative hypothesis is true.

• If we do not accept the alternative hypothesis, we conclude that there is not enough statistical evidence to infer that the alternative hypothesis is true.

The alternative hypothesisis the more importantone. It represents whatwe are investigating.

The alternative hypothesisis the more importantone. It represents whatwe are investigating.

Conclusions of a Test of Hypothesis

Page 22: ch7 205 (1)

Another Example

Historically, the mean GPA of incoming freshmen at NKU has been 2.32 at the end of their first year. With recent changes, the administration believes the mean GPA has increased. How would this be tested using a .05 level of significance?

H0: The mean GPA is still 2.32. = 2.32

Ha: The mean GPA is above 2.32. > 2.32

The decision rule is to accept Ha if the p-value is less than .05.

The test statistic is x

x

x xz

n

Page 23: ch7 205 (1)

Performing the Test of Hypothesis

In order to perform an actual test of hypothesis, we must identify several things, ensure the procedure is valid, and draw conclusions without stopping at calculations.

For chapter 7, we are focusing on testing hypotheses which deal with the population mean under the three assumptions:

The population standard deviation is known

A random sample is obtained from the population

The sample size is “large”. (Sampling Distn of )x

Page 24: ch7 205 (1)

Steps of the Test of Hypothesis for with

1. Identify the null and alternative hypotheses

2. Give the decision rule

3. Identify the form of the test statistic and calculate it based on the sampled data.

4. Verify the method is valid (n is at least 30 for now)

5. Calculate the p-value based on the z-score and Ha

6. Give an interpretation.

Page 25: ch7 205 (1)

Example from Page 227 #6

H0: = $122,000 Ha: < $122,000

Decision Rule: Accept Ha if the p-value < .05.

This is valid since n = 40 is at least 30.

P-value = probability a z-score is “less than” 2.19

= 0.5 + 0.486 = 0.986

At the .05 level of significance, there is insufficient evidence to conclude the mean price for all new homes in Florida is below $122,000.

130210 122000 82102.19

23680 3744.1367540

xz

n

Page 26: ch7 205 (1)

Possible Errors

Realize, that a small p-value (or observed level of significance) suggests that the alternative hypothesis is true, but does not guarantee it is true.

A Type I Error consists of concluding that the alternative hypothesis is true when, in fact, the null hypothesis is true.

A Type II Error consists of concluding that the null hypothesis is true when, in fact, the alternative hypothesis is true.

Page 27: ch7 205 (1)

Type I or Type II Errors

We can examine each error and attempt to control how willing we are to commit each.

The probability of committing a Type I Error is given by (alpha), the level of significance of the test.

The probability of committing a Type II Error is given by (beta).

We will decide the seriousness of each error, and then determine relative values for and .

Page 28: ch7 205 (1)

Type I or Type II Errors: #3 on page 234

H0: Lab is not contaminated with mercury vapor.

Ha: Lab is contaminated with mercury vapor.

A Type I Error occurs if we conclude the lab is contaminated when, in fact, the lab is not contaminated with mercury vapor.

Consequences: The office would probably be closed, and procedures to reduce the mercury vapor levels would be implemented. This means costs for decontamination and lack of income from patients, but no one is endangered.

Page 29: ch7 205 (1)

Type I or Type II Errors: #3 on page 234

H0: Lab is not contaminated with mercury vapor.

Ha: Lab is contaminated with mercury vapor.

A Type II Error occurs if we conclude the lab is NOT contaminated when, in fact, the lab is contaminated with mercury vapor.

Consequences: The office would be open and new patients and workers could be exposed to high levels of mercury vapor. This means possible law suits, people getting sick, dangerous work environment. It could lead to a bad reputation for this dental office.

Page 30: ch7 205 (1)

Type I or Type II Errors: #3 on page 234

H0: Lab is not contaminated with mercury vapor.

Ha: Lab is contaminated with mercury vapor.

Which error is worse? Probably Type II in my opinion. Hence, I want to avoid this, so I set the probability low. The Type I Error means a loss of income, so it’s not good for business, but it’s not as serious.

I’d set > .

I’d like small at .01, and maybe at .05.

Page 31: ch7 205 (1)

Type I or Type II Errors

Be able to define a Type I Error and a Type II error in terms of a scenario.

Be able to discuss the consequences of each type of error.

Set values for and depending on those consequences.

There are no rules on one error being worse than the other in all situations.