introduction to the practice of statistics fifth edition chapter 6: introduction to inference...

34
Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore • George P. McCabe

Upload: derick-wade

Post on 04-Jan-2016

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

Introduction to thePractice of Statistics

Fifth Edition

Chapter 6:Introduction to Inference

Copyright © 2005 by W. H. Freeman and Company

David S. Moore • George P. McCabe

Page 2: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

Introduction to Inference

• 6.1 – Estimating with Confidence• 6.2 – Tests of Significance• 6.3 – Use and Abuse of Tests• 6.4 – Power and Inference as a Decision (optional)

We will explore these ideas in the context of estimating and/or testing hypotheses about a

population mean, .

Page 3: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

Section 6.1 Estimating with Confidence

Example 6.2 (page 384):• Goal: Estimate the mean SATM score, , for all

California seniors.• Take SRS of 500 California seniors.• Find the sample mean, .• How well does estimate ?

Question: What is the sampling distribution of

(suppose we know )??? Why??

461x x

x100

100( , ) ( , ) ( , 4.5)

500X X X X X XN N N

n

Page 4: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

( , 4.5)X X

N

Values of are distributed according to this density curve. How likely is it that your value of will be within of the (unknown) value of ?

x 2 9X

x

Sampling Distribution of x

??

Page 5: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

x

95% of the time, will be within of !2 9

X

5% of the time will not be within of

x

2 9X

x

x

x

x

Page 6: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

If is within of , then

is within of !

2 9X

x

x 9x 9x

x 9x 9x

x 9x 9x

Thus, we are 95% confident that

2 2x xn n

Or in our case ( ) that

461 9 461 9

452 470

461x

There is a 5% chance that this interval does not capture the population mean!

Page 7: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

Confidence Intervals

• We have just computed a

95% confidence interval for

• The endpoints of the interval (452, 470) depended on three values:– The point estimate for ,

– The level of confidence which determined how many standard deviations to use (95%: we used approximately two standard deviations)

– The standard deviation of the point estimate, which also depends on the sample size, n.

• The interval also depended on the fact that we knew that the sampling distribution of the statistic, is normal (or approximately normal, since n is large)!

x

1004.5

500X n

x

Page 8: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

We are 95% confident that the true population mean is contained in the confidence interval. WHY? Because according to the Central Limit Theorem, there is a 95% chance that the estimate of the population mean (i.e. the sample mean), will be within 2 standard deviations (of the sampling distribution!) of the true population mean.

Let’s try playing with the “Confidence Interval” applet on your CD….Page 386

Page 9: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

For finding a level C confidence interval for a population mean, how does the confidence level determine the number of standard deviations to use to compute

the interval?

For a 95% confidence interval for we used approximately 2 standard deviations to compute the endpoints of our interval:

2 2x x

x x

2 2x xn n

* *x z x zn n

How do we find ?*z

What happens to when the

C-level changes?

*z

Page 10: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

Let’s find for various C-levels for a C-level confidence interval for a population mean, . (see page 387)

Standard NormalDensity Curve

C - Level

Value of

99% 2.576

95% 1.960

90% 1.645

85% 1.440

Use the invNorm key on your TI-83!

*z

*z

??

??

??

??

Page 11: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

Let’s use our TI-83 calculators to find some C-level confidence intervals and explore their behavior!

Page 12: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

Example 6.3 (page 388): Find a 95% confidence interval for .(What is ??)

You are given what values?What is the margin of error for this confidence interval?What is the confidence interval?Write a sentence that explains the meaning of this interval.

Let’s also use the Stat|Tests|ZInterval key on your TI-83!

What if we change the C-level to 99%? How will the interval change (see picture page 391)? What if we change the C-level to 90%

Page 13: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

What if the sample size in Example 6.3 (page 388) was actually 320 instead of 1280? How will this effect the margin of error, the confidence interval?

New margin of error?

New confidence interval?

See Figure 6-5 on page 390 (and below):

Page 14: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

• Goals for Estimating Population Parameters:– High Confidence

– Low Margin of Error

• How to Reduce the Margin of Error – Change C-Level?

– Change Sample Size?

– Change Population Standard Deviation?

*m zn

Lower C-Level Results in Smaller Value of .*z

Larger n will reduce m since you will divide by a larger value.

Smaller will reduce m. This may not be possible to do.

Page 390

Page 15: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

Suppose we want a certain margin of error for our confidence interval for a population mean. What sample size will be needed to get the desired result? (Assume we know the population standard

deviation.)

*m zn

Let’s solve this equation for n!!

Let’s work Problem 6.28 on page 399!

Page 16: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

126.07x

Example 6.14 (page 410):• Goal: Test a claim about a population parameter (in this case,

the mean systolic b.p., , for all middle aged male executives). • Is the mean significantly different than the mean for the general

population of males aged 35 to 44 (which equals 128)? • Take SRS of size 72 from the middle aged male executives (i.e.

from the population for ).• Find the sample mean, . What is this value?• Does the data from the sample support the claim or not? I.e.

based on the data ( ), do you believe the mean systolic b.p. for middle aged male executives ( ) is significantly different than mean for the general population of males (i.e. 128 mmHG)?

Collect the evidence.

Section 6.2 Tests of Significance

x

What is the claim, what is being tested about the parameter?

Draw the appropriate conclusions based on the evidence.

Page 17: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

For us, the null hypothesis will contain an equality involving the parameter!

The alternative hypothesis is what we hope or suspect is true about the parameter (instead of the equality in the null hypothesis). This will depend on the problem

statement.

For our example:

Formulating Hypotheses

0 : 128

: 128a

H

H

Says the mean systolic b.p. of middle-aged male executives is not different (i.e. not statistically

significantly different) than 128

Says the mean systolic b.p. of middle-aged male executives is different (i.e. statistically

significantly) than 128

Page 18: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

The Logic of Hypothesis Testing• Assume the null hypothesis is TRUE!• Determine how likely it is to get data as extreme as what

you got IF this is the case (i.e. IF the null hypothesis is TRUE).

• If it is very unlikely to get data as extreme as what you got, then you doubt the assumption that the null hypothesis is true (i.e. you will reject the null hypothesis).

• If it is not very unlikely to get data as extreme as what you got, then you have no reason to doubt the null hypothesis (i.e. you will fail to reject the null hypothesis).

• The direction “as extreme” is determine by the alternative hypothesis.

Page 19: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

Following the Logic for Our Example (6.14 page 410)

0 : 128

: 128a

H

H

IF the null hypothesis is TRUE (and assume the population of middle-aged executives has the same standard deviation as the males aged 35 to 44, i.e. assume ), then what is the (approximate?) sampling distribution for ? Why?

15 x

15( , ) ( 128, )

72X X X XN N

n

How “far out” is our data? I.e. how many standard deviations from the mean is for our sampling distribution? 126.07x

0 0 126.07 1281.09

/ 15 / 72X

x xz

n

This is called the z test statistic for the data, note it is just the z-score for the data!.

Page 20: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

The z-test statistic for our data tells us that our data differs from the hypothesized mean by z = -1.09 standard deviations (assuming the null hypothesis is true).

What other values of the z-test statistic are as extreme as our data’s test statistic (i.e. differ by at least as many standard deviations from the hypothesized mean as our data)? Note that our alternative hypothesis is . : 128aH

z < -1.09 OR z > 1.09 (This is a two-tailed test!)

How will this z test statistic be distributed (Hint: We are standardizing a variable that is approximately normal: !)???x

This z test statistic has an approximately standard normal

distribution(mean=0, standard deviation=1)

P-value

How likely is it to get a result “as extreme” as our data?

Page 21: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

P-valueLet’s compute the P-value for

our test two ways:

1. Using the invNorm key:

2. Using the Stat|Tests|Z-Test key:

Our data is not too “rare,” thus it will not cause us reject the null hypothesis in favor of the alternative hypothesis.

Page 22: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

Typical levels in the “real world” are 0.10

0.05

0.01

Most statistical software will report the P-value – but will not tell you what conclusion to reach! That is the hardest part!

Page 23: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

Steps in Hypothesis Testing (page 407) OR What Have We Done (in Example 6.14)?

• State the null and alternative hypothesis (clearly identify the population parameter!):

• Calculate the value of the test statistic on which the test will be based:

• Find the P-value for the observed data:

• State a conclusion:

0 0 126.07 1281.09

/ 15 / 72X

x xz

n

P=0.2758

Since P is large, we will fail to reject the null hypothesis in favor of the alternative (i.e. it is not very unlikely to get a result as

extreme as ours). Thus the data do not provide strong evidence that the mean systolic b.p. of middle-aged male executives differs significantly from the mean of other men (i.e. 128).

0 : 128

: 128a

H

H

Where is the mean systolic b.p. of middle-aged male executives.

Page 24: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

We Have Just Conducted a (two-tailed) z-test for a Population Mean, !

Assumptions (see page 393):• Data from a SRS of the population.•Population standard deviation is known (i.e. known).•Data does not have extreme outliers (since not resistant to outliers)•The smaller n is, the more concerned we need to be about the population distribution and outliers.

x

Two-tailed Test

One-tailed Test

One-tailed Test

Page 410

Page 25: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

Let’s Work Another Example: Example 6.15 page 412

• State the null and alternative hypothesis (clearly identify the population parameter!):

• Calculate the value of the test statistic on which the test will be based:

• Find the P-value for the observed data:

• State a conclusion:

Page 26: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

Let’s Revisit Example 6.15 page 412:•What if our alternative hypothesis was two sided? What would be the P-value of the test?•Would you reject the null hypothesis at any of the standard alpha levels?•Find the -level confidence intervals for using the standard alpha levels.•Which confidence intervals computed above contain the value of stated in the null hypothesis of the test?

1

0

Relationship Between Two-Sided Significance Tests and Confidence Intervals

Page 27: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

Section 6.3 Use and Abuse of Tests

• Read on Your Own!

• You will have a hand-in homework assignment from this section.

• You will be asked questions about this material on future tests and quizzes.

Page 28: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

Section 6.4 Power and Inference as a Decision*

• Type I and Type II Errors

• The Power of a Statistical Hypothesis Test

• Increasing the Power of a Test

• Significance and Type I Errors

• Power and Type II Errors

*Optional Section

Page 29: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

Possible Errors in Hypothesis Testing

Type I and Type II ErrorsPage 436

Page 30: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

An ExamplePage 435

0 : Lot of bearings meets standards

: The lot does not meet standardsa

H

H

Page 31: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

More on Type I and Type II Error – Example 6.28

0 : 0

: 0a

H

H

What is the likelihood of a Type I Error?

Test at level of significance.Reject null if z-test statistic is greater than what?Reject if get a sample mean greater than what?

If it is true that , then what is the likelihood of a Type II Error?

If it is true that , then what is the likelihood of correctly rejecting the null hypothesis?

0.05

TRUE0H

TRUE1

0.05

1

0.20

1

0.80

Page 32: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore

Power, Significance, and Type I and Type II Errors

Page 33: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore
Page 34: Introduction to the Practice of Statistics Fifth Edition Chapter 6: Introduction to Inference Copyright © 2005 by W. H. Freeman and Company David S. Moore