1. introduction 2. element of a statistical test 3. tests...

24
Chapter 10 Hypotheses Testing 1. Introduction 2. Element of a statistical test 3. Tests for single population mean and single population proportion 4. Tests for the differences between two population means and between two population proportions 5. The relationship between hypothesis-testing and confidence intervals 6. Test for single variance, and for comparing two variances

Upload: others

Post on 09-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

Chapter 10 Hypotheses Testing

1. Introduction

2. Element of a statistical test

3. Tests for single population mean and single

population proportion

4. Tests for the differences between two population

means and between two population proportions

5. The relationship between hypothesis-testing and

confidence intervals

6. Test for single variance, and for comparing two

variances

Page 2: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

Statistical Inference – Testing

hypotheses (Ch. 10)

�Are the Math students smarter than the

average people?

�Do the Subway sandwiches have 6

gm fat or less?

How to test these claims?

Page 3: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

Statistical Inference –

Testing Hypotheses

A test of significance is a procedure for

evaluating the strength of the evidence

provided by the data against an hypothesis.

Page 4: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

Terminology

Key words:

- Null Hypothesis Ho

- Alternative Hypothesis Ha

-Test Statistic and its distribution

- Rejection Region

- Type I error and II errors

- one-sided and two-sided tests

Page 5: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

Hypotheses (Ho, Ha):

The null hypothesis, denoted by Ho, is a claim about the

population that is being tested in a statistical test. The

test is designed to assess the strength of the evidence

against the null hypothesis. Usually the null

hypothesis is a statement of “no effect” or “no

difference”.

The alternative hypothesis, denoted by Ha, is the

competing claim about the population that we are

trying to find evidence for.

Conclusions of the test, Ho versus Ha, are then

(1) Reject Ho, only if sample evidence strongly suggests

that Ho is not true. Or,

(2) Fail to reject Ho, if the sample does not contain such

evidence.

Page 6: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

-Test Statistic

A test statistic is the function of sample data on which a conclusion to reject or fail to reject Ho is based.

- Rejection Region (RR)

RR is the region contains all values of the test statistic for which the null hypothesis is to be rejected in favor of the alternative hypothesis. If for a particular sample the computed value of the test statistic falls in RR, we reject Ho; otherwise, we fail to reject Ho.

-Type I error and Type II error

The error of rejecting Ho when Ho is true is called Type I error.

The error of failing to reject Ho when Ho is false is called Type II error.

Page 7: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

Testing hypothesis is like a court trial

Page 8: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

What are the errors in testing

hypothesis?

Page 9: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

- one-sided (one-tailed) and two-sided (two-tailed)tests

If we are interested only in deviations from Ho in one direction, then the Ha is one-sided and the test is called to be one-sided test.

If we are interested in the difference from Ho without specifying the direction of the difference, then Ha is two-sided. The test is called two-sided test.

Page 10: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

Main Components

in a Hypothesis Testing Procedure

1. Compose the null and alternative hypothesis:

2. Specify the test statistic

3. Compute the value of test statistic for the particular

sample(s) given

4. Under a confidence level α, determine RR

5. Make conclusion

Page 11: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

10.4 Hypothesis test for a population mean

Idea about testing hypothesis about

Is close to ? How do we measure closeness?

What do you conclude if fell in location (1)? or

Location (2)?

To answer this question, assume = some value

(This is our hypothesis). Then examine the z-score

or probability for closeness.

x µ

µ

Page 12: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

One-sample z-test for a population mean

Let be the hypothesized value of . Assume

1. is the sample mean from a random sample;

2. the population is approximately normal or n is large.

Ho:

Test statistic:

(a) If Ha: , then we reject Ho if z > z(α);

(b) If Ha: , then we reject Ho if z < -z(α);

(c) If Ha: , then we reject Ho if |z| > z(α/2).

0µ µ

µ

0µµ =

n

xz

/

0

σ

µ−=

0µµ <

0µµ >

0µµ ≠

x

Page 13: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

Example 1: Are the Math students

smarter than the average people?

Suppose you are given the following information.

It is known that adults IQs have a bell-shaped

distribution with mean = 100, and SD =16.

Assume that a sample of 16 math students from Brock

University gave the average IQ of 113.

Are the math students smarter than the average

people? Is the claim supported by the above data

at 1% level?

Page 14: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

Test for the mean of a normal population

using z-statistic when is known

Make conclusion by compare it with z(α) or z(α/2)

for the chosen significance level α.

σ

Page 15: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

Are Math students smarter than average

people?

If large IQ’s are observed for Math students,

then we conclude that Math students are indeed

not the same as the average people, but in fact

are smarter.

If Math students are no better than average

people, then Math students should give the

same IQ.

Page 16: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

Step 1: Population characteristic of interest is

= true mean of IQ scores of math students.

Step 2: Hypotheses: Ho: =100 (no difference)

vs. Ha: >100 (smarter).

Step 3: Significance level: =0.01.

Step 4: Check assumptions: (1) random sample (2) normality

Step 5: Test statistic:

Step 6: This is a upper tailed test. So, the RR should be: z>z(α).

z(0.01)=2.33.

Step 7: z>2.33. So, we tend to reject Ho and conclude >100,

which means that math students are smarter.

µ

µ

µ

α

µ

Page 17: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

Steps in a Hypothesis-Testing:

1. Describe the population characteristic of interest.

2. State the null hypothesis, Ho, and the alternative hypothesis,

Ha.

3. Select the significance level α.

4. Check the assumptions required for the test.

5. Compute the value of the test statistic w, using the given

sample.

6. Determine the RR.

7. State the conclusion (which will be to reject the Ho if w

belongs to RR and not to reject Ho otherwise).

* The conclusion should then be stated in the context of the

problem, and the level of significance should be included.

Page 18: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

Two important results from previous chapters

If the population is approximately normal or n is large, then

1.

has approximately a standard normal distribution.

2.

has approximately a t distribution with df=n-1.

n

xz

µ−=

ns

xt

/

µ−=

Page 19: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

Test for the mean of a normal population

using t-statistic when is unknown

The RR is determined by t-values.

Make conclusion by compare t with t(n-1, α or

α/2) for the chosen significance level α.

σ

Page 20: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

One-sample t test for population mean

Let be the hypothesized value of . Assume

1. is the sample mean from a random sample;

2. the population is approximately normal or n is large.

Ho:

Test statistic:

(a) If Ha: , then we reject Ho if t > t(n-1,α);

(b) If Ha: , then we reject Ho if t < -t(n-1,α);

(c) If Ha: , then we reject Ho if |t| > t(n-1,α/2).

0µ µ

0µµ =

ns

xt

/

0µ−=

0µµ <0µµ >

0µµ ≠

x

Page 21: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

Example 2. Estimating weight gains by lambs:

Inference about using t

The following are the weight gains (lbs) of six young

lambs of the same breed who had been raised on the same

diet: 8, 7, 3, 9, 2, 4

(a) Construct a 90% CI for the true mean weight

gain.

(b) Is the true mean weight gain more than 3.5 lbs?

Test using α= 0.05.

µ

Page 22: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

Example 2: Estimating weight gains by

lambs: Inference about using t

(a) The following are the weight gains (lbs) of six young

lambs of the same breed who had been raised on the same

diet: 8, 7, 3, 9, 2, 4 ( = 33, = 223).

Construct a 90% CI for the true mean weight gain of a

population of similar lambs.

Mean = 5.5, SD = s=2.88, SE =1.1758=1.18

Df =n-1= 6-1 = 5, 1- = 0.90, t* = =2.02

90% CI: 5.5 ± (2.02)*(1.18)=5.5 ±2.38 = ( 3.12, 7.88)

µ

∑ x ∑ 2x

ns/=

α 2/αt

Page 23: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

(b) Is the true mean weight gain more than 3.5 lbs?

Step 1: Population characteristic of interest is:

= true mean weight gain.

Step 2: Hypotheses: Ho: =3.5 vs. Ha: >3.5

Step 3: Significance level: =0.05.

Step 4: Check assumptions: (1) random sample (2) normality?

Step 5: Test statistic: , df=n-1=5

Step 6: This is a upper tailed test. So, RR is: t>t(n-1,α).

Step 7: Under α =0.05, t(5,0.05)=2.015. t=1.69<2.015. We can not

reject Ho.

So, we conclude that there is no strong evidence to show that the

true mean weight gain is more than 3.5 lbs at significant level

0.05.

µ

µµ

α

69.118.1

5.35.5=

−=t

Page 24: 1. Introduction 2. Element of a statistical test 3. Tests ...spartan.ac.brocku.ca/~xxu/Week10.pdf · The test is called two-sided test. Main Components in a Hypothesis Testing Procedure

Summary of one-sample test for mean

1. Terms:

• Null Hypothesis Ho

• Alternative Hypothesis Ha

• Test Statistic and its distribution

• Rejection Region

• Type I error and II errors

• One-sided and two-sided tests

2. Testing for population mean

(1) Using when is known.

(2) using when is unknown.

n

xz

µ−=

ns

xt

/

µ−=

σ

σ