chapter 9: hypothesis testing · hypothesis: a claim about a population parameter. example: the...

21
Page 1 | 5 Problem: Consider the following scenario. Our class has 50 students, 25 students are junior level and the other 25 students are senior level. Now I have 20 movie tickets from a friend, and I want to give out these 20 tickets to 20 random students in the class. It turns out that 19 senior students receive the tickets and 1 junior receives the remaining ticket. Then the students in the class make a claim that I favor the senior group. Or using the statistics language, they say that the probability of senior getting the ticket is bigger than 50% (p > 0.5). If this is a random process, then junior and senior students should have equal chance 50% (p = 0.5) of getting the tickets. Goal: In this chapter, we will present the standard methods for testing such claims that senior students are more likely to get the tickets (p > 0.5) than junior students in this class. Definitions Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0 ). Hypothesis test (test of significance): a procedure for testing a claim about a population parameter. We use a sample data to do the testing because it is impossible to gain access to the entire population. Two types of statistical hypotheses: Null Hypothesis ( 0 H ): Statement that the value of a population parameter (such as proportion, mean, or standard deviation) is equal to some claimed value. Statement of no change or no effect or no difference and is assumed true until evidence indicates otherwise. Alternative hypothesis: ( 1 H ): Statement that the parameter has a value that somehow differs from the null hypothesis. Statement that we are trying to find evidence to support. Statement that some change has occurred differing from original circumstances. Type of Hypothesis Tests: Two-Tailed, Left-Tailed, Right-Tailed We conduct the hypothesis test by assuming that the proportion, mean, or standard deviation is equal to some specified value, and therefore the null hypothesis always involves equality. Section 9.1: Basic Principle of Hypothesis Testing Chapter 9: Hypothesis Testing

Upload: others

Post on 22-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 1 | 5

Problem: Consider the following scenario. Our class has 50 students, 25 students are junior

level and the other 25 students are senior level. Now I have 20 movie tickets from a friend,

and I want to give out these 20 tickets to 20 random students in the class. It turns out that

19 senior students receive the tickets and 1 junior receives the remaining ticket. Then the

students in the class make a claim that I favor the senior group. Or using the statistics

language, they say that the probability of senior getting the ticket is bigger than 50% (p >

0.5). If this is a random process, then junior and senior students should have equal chance

50% (p = 0.5) of getting the tickets.

Goal: In this chapter, we will present the standard methods for testing such claims that

senior students are more likely to get the tickets (p > 0.5) than junior students in this class.

Definitions

Hypothesis: a claim about a population parameter.

Example: The average GPA of high school students is higher than a 3.0 ( 3.0 ).

Hypothesis test (test of significance): a procedure for testing a claim about a population

parameter. We use a sample data to do the testing because it is impossible to gain access to

the entire population.

Two types of statistical hypotheses:

• Null Hypothesis ( 0H ): Statement that the value of a population parameter (such as

proportion, mean, or standard deviation) is equal to some claimed value. Statement

of no change or no effect or no difference and is assumed true until evidence

indicates otherwise.

• Alternative hypothesis: ( 1H ): Statement that the parameter has a value that

somehow differs from the null hypothesis. Statement that we are trying to find

evidence to support. Statement that some change has occurred differing from

original circumstances.

Type of Hypothesis Tests: Two-Tailed, Left-Tailed, Right-Tailed

We conduct the hypothesis test by assuming that the proportion, mean, or standard

deviation is equal to some specified value, and therefore the null hypothesis always

involves equality.

Section 9.1: Basic Principle of Hypothesis Testing

Chapter 9: Hypothesis Testing

Page 2: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 2 | 5

• Two-tailed test:

0H : parameter = some value

1H : parameter some value

• Left-tailed test:

0H : parameter = some value

1H : parameter < some value

• Right-tailed test:

0H : parameter = some value

1H : parameter > some value

We never support/accept Null Hypothesis 0H because we can’t gain access to the entire

population, and we can’t know the true population parameter 100%. We instead use the

phrase “fail to reject the null hypothesis” to mean that we don’t have enough strong

evidence to warrant rejection of the null hypothesis. It is like the court system. We never

say a defendant “innocent”, but we instead say the defendant is “not guilty”.

Example: Suppose we want to determine whether a coin is fair and balanced. A null

hypothesis might be that half the flips would result in Heads and half of the other flips

would result in Tails. Then the alternative might be that the number of Heads and Tails

would be very different. We can express these hypotheses symbolically as follow:

• Null Hypothesis 0 : 0.5H p =

• Alternative Hypothesis 1 : 0.5H p

Example: A pharmaceutical company is producing Advil pills of 250 mg dose. However, the

manufacture is worried that the machine that making the pills has come out of calibration

and is making less dose than it should be.

Null Hypothesis: 0 : 250H =

Alternative Hypothesis: 1 : 250H

So, the original claim (null hypothesis) is saying that if you buy an Advil bottle of 250mg

dose, you expect every pill has the amount of 250mg exactly. However, we are trying to

support the other claim (alternative hypothesis) that the mean dosage of the pill is less

than 250mg.

Page 3: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 3 | 5

Errors in Hypothesis Tests

At the end of hypothesis testing procedures, we either rejecting or failing to reject the null

hypothesis, and sometimes we do have errors:

• Type I error (alpha): rejecting null hypothesis when it is true.

• Type II error (beta): fail to reject the null hypothesis when it is false.

Note that alpha (level of significance) is the same concept that we used in Chapter 7 for

constructing confidence intervals. It is the probability of a type I error – the probability of

rejecting the null hypothesis when it is true. It is chosen by the researcher before the

sample data is collected.

Example: According to the Centers for Disease Control, 15.2% of American adults

experience migraine headaches. Stress is a major contributor to the frequency and

intensity of headaches. A massage therapist feels that she has a technique that can reduce

the frequency and intensity of migraine headaches.

a) Determine the null and alternative hypotheses that would be used to test the

effectiveness of the massage therapist’s techniques.

0

1

: p 0.152

: p 0.152

H

H

=

b) Suppose that a sample of 500 American adults who participate in the massage

therapist’s program results in a data that indicate that the null hypothesis should be

rejected. Provide a statement that supports the massage therapist’s program:

There is sufficient evidence to conclude that the therapist’s technique reduces

the frequency and intensity of migraine headaches in American adults below

15.2%.

c) Suppose, in fact, the percentage of patients in the program who experience migraine

headaches is 15.3%. Was a Type I or Type II error committed?

Type I error, because the null hypothesis was rejected when, in fact, the null

hypothesis was true.

Page 4: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 4 | 5

Testing a Claim

There are three methods we can perform to make the conclusion whether we should reject

the null hypothesis 0H or we fail to reject the null hypothesis 0H .

1) Using P-Value Method

2) Using Critical Value Method

3) Using Confidence Interval Method

The P-Value method and Critical Value method are similar in the sense that they always

yield the same result, while the Confidence Interval method (chapter 7) is sometimes

different from the P-Value or Critical Value method. It is recommended that we use

Confidence Interval method to estimate a population parameter only. In addition, many

technologies can give the P-Value, and therefore we will focus mainly on how to use the P-

Value Method in this chapter.

Identify the Statistic Relevant to the Test and Determine Its Sampling Distribution

Test Statistics is a value used in making a decision about the null hypothesis.

Parameter Sampling Distribution

Requirements Test Statistics

Proportion p Normal (z) 0 5np and 0 5nq

𝑧0 =�̂� − 𝑝0

√𝑝0𝑞0𝑛

Mean Student’s t not known and normally distributed population or not known and n > 30

𝑡0 =�̅� − 𝜇0𝑠

√𝑛

Mean Normal (z) known and normally distributed population or known and n > 30

𝑧0 =�̅� − 𝜇0𝜎

√𝑛

Standard Deviation or variance 2

Chi-squared 2 Strict requirement: normally distributed population – use normal probability plot to verify this

22

2

( 1)n s

−=

Page 5: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 5 | 5

Interpreting the Test Statistics: Using the P-Value or Critical Value

P-Value (Probability Value) : the likelihood or probability that sample will result in a

statistic such as the one obtained if the null hypothesis is true.

Critical region in the left tail: P-value = area to the left of the test statistic

Critical region in the right tail: P-value = area to the right of the test statistics

Critical region in two tails: P-value = twice the area in the tail beyond the test statistics

• If P-value ≤ α, reject H0.

• If P-value > α, fail to reject H0.

Critical Value Method (traditional method): Find the critical value(s) that separates the

critical region (where we reject the null hypothesis) from the values of the test statistic that

do not lead to the rejection of the null hypothesis.

• If the test statistic is in the critical region, reject H0.

• If the test statistic is not in the critical region, fail to reject H0.

Page 6: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 1 | 5

Goal: Conduct a formal hypothesis test of a claim about a population proportion p.

Recall: the best point estimate of proportion p is �̂� =𝑥

𝑛, where x is the number of

individuals in the sample, and n is the sample size.

Conducting a Hypothesis Test about a Population Proportion using the P-Value

Method and Critical Values Method:

Requirements:

1. Simple Random Sample

2. The conditions for a binomial distribution are satisfied. (There is a fixed number of

independent trials having constant probabilities, and each trial has two outcome

categories of “success” or “failure.”).

3. The condition 0 5np and 0 5nq are both satisfied so the binomial distribution of

sample proportions can be approximated by a normal distribution with 0np = and

0 0np q = .

Note that q0 = 1 – p0.

Procedures:

**Part A: P-Value Method

1. Determine the null and alternative hypotheses in one of the following three

ways:

Note that the Null Hypothesis always includes the equal sign.

2. Select a level of significance α depending on the seriousness of making a Type

I error, and the common choice of α is 0.05.

3. For P-Value Method: Compute the test statistics

𝑧0 =�̂� − 𝑝0

√𝑝0𝑞0𝑛

Section 9.4: Hypothesis Tests for Proportions

Page 7: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 2 | 5

Then use table A2 or technology to determine the P-Value.

The P-Value is just the shaded green area, and we can find those areas on TI-

83/84 by using normalcdf function.

4. If P-Value < α, reject the null hypothesis. If P-Value > α, do not reject the null

hypothesis.

**Part B: Critical Value Method

Repeat the same steps 1-3 as for the P-Value Method. Then use table A2 to find the critical

value instead of the P-Value.

Then compare the critical value with the test statistic:

Left-Tailed Two-Tailed Right-Tailed

Page 8: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 3 | 5

Example: The Genetics and IVF Institute conducted a clinical trial of YSORT method

designed to increase the probability of conceiving a boy. As of this writing, 291 babies were

born to parents using the YSORT method, and 239 of them were boys. Use a 0.01

significance level to test the claim that the YSORT method is effective in increasing the

likelihood that a baby will be a boy.

Answer:

1. Original claim: YSORT method is effective means 0.5p . Because 0.5p does not

contain equality, so this is Alternative Hypothesis.

0

1

: 0.5

: 0.5

H p

H p

=

2. This is a right tailed test and 0.01 = .

3. Test Statistic:

Point Estimate: 239

0.821291

xp

n= = =

0 00

0 0 0 0

0.821 0.510.952

(1 ) 0.5(1 0.5)

291

p p p pz

p q p p

n n

− − −= = = =

− −

Note: When checking the requirements 0 5np and 0 5nq for small sample

size, it usually won’t pass the conditions, and we need to use the binomial

distribution instead of the normal distribution approximation.

Find P-Value using TI-83, hit 2nd VARS, choose

normalcdf( ):

P(z>10.952)=normalcdf(z0,∞)=normalcdf(10.952,

1099).

On TI 84, hit 2nd VARS, choose normalcdf( ), then

enter:

4. P-Value = 3.049x10-28,

This value is less than α=0.01, reject the null hypothesis!

P-Value Method

Duy Tran Laptop
Pencil
Page 9: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 4 | 5

After find the test statistics, we find critical value instead of p-value. From chapter 7,

0.01 =

P-value and Critical value methods both give the same result: Reject the Null Hypothesis!

Conclusion: There is sufficient evidence to support the claim that the YSORT method is

effective in increasing the likelihood that a baby will be a boy!

Using Technology TI 83-84: We will use 1-PropZTest command to perform an z-test to

compare a population proportion to a hypothesis value. This test is valid for sufficiently

large sample values: only when 0 5np and 0 5nq

Hit STAT, right arrow to TESTS, arrow down to 1-PropZTest…, enter the below screen

information:

Critical Value Method

Duy
Text Box
Z
Duy
Pencil
Duy
Pencil
Duy
Pencil
Duy
Pencil
Page 10: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 5 | 5

then hit Calculate:

Example: In 2006, 10.5% of all live births in the United States were to mothers under 20

years of age. A sociologist claims that this percentage is decreasing. She conducts a simple

random sample of 34 births and finds that 3 of them were to be mothers less than 20 years

of age. Test a sociologist’s claim at the α=0.01 level of significance.

Answer: We will use the P-Value approach in this example ONLY.

Conclusion:

There is

insufficient

evidence to

conclude that

the percentage

of live births in

the US to

mothers under

the age of 20

was deceased

since 2006.

Page 11: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 1 | 6

Goal: Conduct a formal hypothesis test of a claim about a population mean µ.

Recall: the best point estimate of population mean is x , which is the sample mean.

Conducting a Hypothesis Test about a Population Mean using the P-Value Method

and Critical Values Method:

There are two cases: unknown 𝝈 and known 𝝈 population standard deviation.

Parameter Sampling Distributions

Requirements Test Statistics

Unknown 𝝈 Student’s t Simple Random Sample, Normally distributed population or n > 30

𝑡0 =�̅� − 𝜇0

𝑠

√𝑛

Use Table A3 or Technology

Known 𝝈 Normal (z) Simple Random Sample, Normally distributed population or n > 30

𝑧0 =�̅� − 𝜇0𝜎

√𝑛

Use Table A2 or Technology

x = sample mean, µ0 = population mean, s = sample standard deviation, 𝝈 = population standard deviation, n = sample size. Note**: Sometimes the sample size of 15 to 30 are sufficient if the population has a

distribution that is not far from normal.

**Part A: P-Value Method

1. Determine the null and alternative hypotheses in one of the following three

ways:

Note that the Null Hypothesis always includes the equal sign.

2. Select a level of significance α depending on the seriousness of making a Type

I error, and the common choice of α is 0.05.

3. For P-Value Method: Compute the test statistics

t0 if unknown 𝝈 with n-1 degree of freedom, and z0 if known 𝝈

Then use table A3/A2 or technology to determine the P-Value.

Sections 9.2 & 9.3: Hypothesis Testings for a Population Mean

Page 12: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 2 | 6

The P-Value is just the shaded green area, and we can find those areas on TI-

83/84 by using tcdf function for Student’s t or normalcdf function for z-

distribution.

4. If P-Value < α, reject the null hypothesis. If P-Value > α, do not reject the null

hypothesis.

**Part B: Critical Value Method

Repeat the same steps 1-3 as for the P-Value Method. Then use table A2/A3 to find the

critical value instead of the P-Value.

If it is a Normal (z), then:

Page 13: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 3 | 6

If it is a Student’s t, then:

Then compare the critical value with the test statistic

Two-Tailed Left-Tailed Right-Tailed

Note: When working with small sample size n < 30, we must verify that the

sample data is coming from a normally distributed population. We can do this

by using a Normal Probability Plot or Normal Quantile Plot. If the data

exhibits a linear relationship (straight line), then we are good.

Press 2nd STAT PLOT, then turn

Plot1 On, choose the last graph for

Type. Enter the Data List to be the list

that you store the data. This will plot

the observations against the z-scores.

Page 14: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 4 | 6

Example: A simple random sample of the weights of 19 green M&Ms has a mean of

0.8635g and a standard deviation of 0.0570g. Use a 0.05 significance level to test the claim

that the mean weight of all green M&Ms is equal to 0.8535g, which is the mean weight

required so that M&Ms have the weight printed on the package label. Do green M&Ms

appear to have weights consistent with the package label?

0.925 0.848 0.914 0.940 0.881 0.833 0.865 0.845 0.865 0.852 1.015 0.778 0.876 0.814 0.809 0.791 0.865 0.810 0.881

The normal quantile plot

exhibits a straight line, so it

seems like it’s coming from a

normally distributed

population.

Page 15: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 5 | 6

On TI 84: Press 2nd > VARS > tcdf( )

There is not sufficient evidence to warrant rejection of the claim that the mean weight of all

green M&Ms is equal to 0.8535g. Therefore, the green M&Ms do appear to have weights

consistent with the package level.

Page 16: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 6 | 6

Using Technology TI 83/84: Press STAT > TESTS, choose T-TEST…

Hit Calculate :

Page 17: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 1 | 5

Goal: Conduct a formal hypothesis test of a claim about a population standard deviation 𝝈

or population variance 𝝈2.

Recall: sample variance s2 is the best point estimate of population variance 𝝈2.

Conducting a Hypothesis Test about a Population Mean using the P-Value Method

and Critical Values Method:

Parameter Sampling Distributions

Requirements Test Statistics

Standard deviation 𝝈 or variance 𝝈2

Chi-squared 2 Simple random sample, normally distributed population (this is a strict requirement).

22

0 2

0

( 1)n s

−=

s = sample standard deviation, 𝝈2 = claimed value of the population variance, n = sample size, s2 = sample variance, degree of freedom = n -1

**Part A: P-Value Method

1. Determine the null and alternative hypotheses in one of the following three

ways:

Note that the Null Hypothesis always includes the equal sign.

2. Select a level of significance α depending on the seriousness of making a Type

I error, and the common choice of α is 0.05.

Recall: All value of Chi-squared are non-

negative, the distribution is not symmetric,

as the number of degrees of freedom

increases, the chi-squared is approaching

the normal (z) distribution.

Section 9.5: Hypothesis Tests for a Standard Deviation or Variance

Page 18: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 2 | 5

3. For P-Value Method: Compute the test statistics

The P-Value is just the shaded green area, and we can find those areas on TI-

83/84 by using 2 cdf( ) function or used Table A4 (note that Table A4 is based

on cumulative areas from the right).

4. If P-Value < α, reject the null hypothesis. If P-Value > α, do not reject the null

hypothesis.

**Part B: Critical Value Method

Repeat the same steps 1-3 as for the P-Value Method. Then use table A4 to find the critical

value instead of the P-Value.

Then compare the critical value with the test statistic

For two-tailed tests, it is

recommended that technology

be used to find P-Value.

Page 19: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 3 | 5

Example:

A can of 7-Up states that the contents of the can are 355 ml. A quality control engineer is

worried that the filling machine is miscalibrated. In other words, she wants to make sure

the machine is not under- or over-filling the cans. She randomly selects 9 cans of 7-Up and

measures the contents. She obtains the following data.

351 360 358 356 359 358 355 361 352

She also has the information that population standard deviation was 3.2. Test the claim that

the population standard deviation, σ, is greater than 3.2 ml at the α = 0.05 level of

significance.

Note**: We will solve this problem in 2 methods: P-Value and Critical Value Method.

Answer:

Requirements Check: Simple Random Sample (Ok)! To check for the normally distributed

population, we use the Normal Quantile Plot to verify:

On TI 83/84: Press STAT, choose Edit… to load the data to L1. Then press 2nd, STAT PLOT,

Press Zoom > ZoomStat

The Normal Quantile Plot does exhibit the straight line, so we can conclude that the

population does have a normally distributed data (OK!).

Next, we need to find the sample standard deviation σ in the test statistic formula. TI 83/84

can also do that: Press STAT, right arrow, CALC, pick 1-Var Stats

Hit Calculate

Duy
Pencil
Page 20: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 4 | 5

We want to test the claim that the population standard deviation, σ, is greater than 3.2 ml

( 3.2 ), this does not involve equality, and so this is Alternative Hypothesis!

On TI 83/84 Plus: Press 2nd, VARS, then choose 2 (cdf .

The command has the syntax as follow:

2 (lower bound, upper bound, degree of freedom)cdf

Or using TI 84 Plus, we can enter directly that in the following screen

We can see that Table

A4 is very limited to

have the value of Chi-

Square to be 9.374 at

the degree of freedom

8. Therefore, we need

to use TI 83/84 to find

this area!

Page 21: Chapter 9: Hypothesis Testing · Hypothesis: a claim about a population parameter. Example: The average GPA of high school students is higher than a 3.0 ( 3.0). Hypothesis test (test

P a g e 5 | 5

Hit Paste and Enter

We can also use the Critical Value Method as follow:

Without technology, it is better than to use the Critical Value method for testing hypothesis

about a population standard deviation or variance.

Conclusion: There is insufficient evidence at the α = 0.05 level of significance to conclude

that the standard deviation of the can content of 7-Up is greater than 3.2 ml.