Chapter 6: Introduction to Inference 1.

80
Chapter 6: Introduction to Inference http://pballew.blogspot.com/2011/03/100-confidence-interval.html 1

Transcript of Chapter 6: Introduction to Inference 1.

Page 1: Chapter 6: Introduction to Inference  1.

1

Chapter 6: Introduction to Inference

http://pballew.blogspot.com/2011/03/100-confidence-interval.html

Page 2: Chapter 6: Introduction to Inference  1.

2

Statistical Inference

Sampling

Page 3: Chapter 6: Introduction to Inference  1.

3

Sampling Variability

What would happen if we took many samples?

Population

Sample

Sample

Sample

Sample

Sample

Sample

Sample

Sample

?

Page 4: Chapter 6: Introduction to Inference  1.

4

Conditions for Inference (Chapter 6)

1. The variable we measure has a Normal distribution with mean and standard deviation σ.

2. We don’t know , but we do know σ.3. We have an SRS from the population of

interest.

Page 5: Chapter 6: Introduction to Inference  1.

5

6.1: Estimating with Confidence - Goals• Describe a level C confidence interval (CI) for a

parameter in terms of an estimate and its margin of error.

• Be able to construct a level C CI for for a sample size of n with known σ.

• Explain how the margin of error changes with confidence level, sample size and sample average.

• Determine the sample size required to obtain a specified margin of error and confidence level C.

• Determine when it is proper to use the CI.

Page 6: Chapter 6: Introduction to Inference  1.

6

Confidence Interval: Definition

Page 7: Chapter 6: Introduction to Inference  1.

7

Example: Confidence Interval 1

Suppose we obtain a SRS of 100 plots of corn which have a mean yield (in bushels) of x< = 123.8 and a standard deviation of σ = 12.3.

What are the plausible values for the (population) mean yield of this variety of corn with a 95% confidence level?

Page 8: Chapter 6: Introduction to Inference  1.

8

Confidence Interval: Definition

Page 9: Chapter 6: Introduction to Inference  1.

9

Confidence Interval

Page 10: Chapter 6: Introduction to Inference  1.

10

Interpretation of CI

• A level C confidence interval for a parameter is an interval computed from sample data by a method that has probability C of producing an interval containing the true value of the parameter.

• To say that we are 95% confident is shorthand for “95% of all possible samples of a given size from this population will yield intervals that capture the unknown parameter.”

Page 11: Chapter 6: Introduction to Inference  1.

11

Interpretation of CI

Page 12: Chapter 6: Introduction to Inference  1.

12

CI conclusion

We are 95% (C%) confident that the population (true) mean of […] falls in the interval (a,b) [or is between a and b].

We are 95% confident that the population (true) mean yield of this type of corn falls in the interval (121.4, 126.2) [or is between 121.4 and 126.2 bushels].

Page 13: Chapter 6: Introduction to Inference  1.

13

t-Table (Table D)

Page 14: Chapter 6: Introduction to Inference  1.

14

Example: Confidence Interval 2An experimenter is measuring the lifetime of a

battery. The distribution of the lifetimes is positively skewed similar to an exponential distribution. A sample of size 196 produces x< = 2.268. The standard deviation is known to be 1.935 for this population.

a) Find and interpret the 95% Confidence Interval.

b) Find and interpret the 90% Confidence Interval.

c) Find and interpret the 99% Confidence Interval.

Page 15: Chapter 6: Introduction to Inference  1.

15

Example: Confidence Interval 2 (cont)We are 95% confident that the population mean

lifetime of this battery falls in the interval (1.997, 2.539).

We are 90% confident that the population mean lifetime of this battery falls in the interval (2.041, 2.495).

We are 99% confident that the population mean lifetime of this battery falls in the interval (1.912, 2.624).

Page 16: Chapter 6: Introduction to Inference  1.

16

How Confidence Intervals Behave

• We would like high confidence and a small margin of error

C z* CI0.90 1.645 (2.041, 2.495)0.95 1.96 (1.997, 2.539)0.99 2.576 (1.912. 2.624

Page 17: Chapter 6: Introduction to Inference  1.

17

Example: Confidence Level & Precision

The following are two CI’s having a confidence level of 90% and the other has a level of 95% level: (-0.30, 6.30) and (-0.82,6.82).

Which one has a confidence level of 95%?

Page 18: Chapter 6: Introduction to Inference  1.

18

Impact of Sample Size

Sample size n

Sta

ndar

d er

ror ⁄

√n

Page 19: Chapter 6: Introduction to Inference  1.

19

Example: Confidence Interval 2 (cont.)An experimenter is measuring the lifetime of a

battery. The distribution of the lifetimes is positively skewed similar to an exponential distribution. A sample of size 196 produces x< = 2.268 and s = 1.935.

a) Find the Confidence Interval for a 95% confidence level.

b) Find the Confidence Interval for the 90% confidence level.

c) Find the Confidence Interval for the 99% confidence level.

d) What sample size would be necessary to obtain a margin of error of 0.2 at a 99% confidence level?

Page 20: Chapter 6: Introduction to Inference  1.

20

Practical Procedure

1. Plan your experiment to obtain the lowest possible.

2. Determine the confidence level that you want.

3. Determine the largest possible width that is acceptable.

4. Calculate what n is required.

Page 21: Chapter 6: Introduction to Inference  1.

21

Confidence Bound

• Upper confidence bound

• Lower confidence bound

• z* critical valuesC z*0.90 1.2820.95 1.6450.99 2.326

Page 22: Chapter 6: Introduction to Inference  1.

22

Example: Confidence Bound

The following is summary data on shear strength (kip) for a sample of 3/8-in. anchor bolds: n = 78, x< = 4.25, = 1.30.

Calculate a lower confidence bound using a confidence level of 90% for the true average shear strength.

We are 90% confident that the true average shear strength is greater than ….

Page 23: Chapter 6: Introduction to Inference  1.

Summary: CI

Confidence Interval

Upper Confidence Bound

Lower Confidence Bound

Confidence Level 90% 95% 99%Two-sided z* values 1.645 1.960 2.576One-sided z* values 1.282 1.645 2.326

x ± z*n

< x + z*n

> x - z*n

23

Page 24: Chapter 6: Introduction to Inference  1.

24

Cautions

1. The data must be an SRS from the population.

2. Be careful about outliers.3. You need to know the sample size.4. You are assuming that you know σ.5. The margin of error covers only random

sampling errors!

Page 25: Chapter 6: Introduction to Inference  1.

25

Conceptual QuestionOne month the actual unemployment rate in the

US was 8.7%. If during that month you took an SRS of 250 people and constructed a 95% CI to estimate the unemployment rate, which of the following would be true:

1) The center of the interval would be 0.0872) A 95% confidence interval estimate contains

0.087.3) If you took 100 SRS of 250 people each, 95%

of the intervals would contain 0.087.

Page 26: Chapter 6: Introduction to Inference  1.

26

Tests of Significance

http://www.rmower.com/statistics/Stat_HW/0801HW_sol.htm

Page 27: Chapter 6: Introduction to Inference  1.

27

6.2: Tests of Significance - Goals• State the methodology to perform a test of

significance.• Be able to state the null and alternative hypothesis.• Be able to state the test statistic.• Be able to define and calculate the P value.• Determine the conclusion of the significance test from

the P value and state it in English.• Describe the relationships between confidence

intervals and hypothesis tests.

Page 28: Chapter 6: Introduction to Inference  1.

28

Significance Test

A test of significance is a formal procedure for comparing observed data with a claim (also called a hypothesis) whose truth we want to assess.

• The claim is a statement about a parameter, like the population proportion p or the population mean µ.

• We express the results of a significance test in terms of a probability, called the P-value, that measures how well the data and the claim agree.

Page 29: Chapter 6: Introduction to Inference  1.

29

Example: Significance TestYou are in charge of quality control in your food company. You sample randomly four packs of cherry tomatoes, each labeled 1/2 lb. (227 g). The average weight from your four boxes is 222 g.

a) Is the somewhat smaller weight simply due to chance variation?

b) Is there evidence that the calibrating machine that sorts cherry tomatoes into packs needs revision?

Page 30: Chapter 6: Introduction to Inference  1.

30

General Procedure for Hypothesis Tests

1. State what you want to test.2. Use the sample data to perform the test.3. Make a decision using the results from the

test.

Page 31: Chapter 6: Introduction to Inference  1.

31

Statistical Hypotheses• hypothesis: an assumption or a theory about

one or more parameters in one or more populations.

• Null Hypothesis: H0: – Initially assumed to be true.

• Alternative Hypothesis: Ha

– Contradictory to H0

• Decision: – Reject H0

– Fail to reject H0

Page 32: Chapter 6: Introduction to Inference  1.

32

Example: Significance TestYou are in charge of quality control in your food company. You sample randomly four packs of cherry tomatoes, each labeled 1/2 lb. (227 g). The average weight from your four boxes is 222 g. What are some examples of hypotheses?

Page 33: Chapter 6: Introduction to Inference  1.

33

Example: HypothesisTranslate each of the following research questions into

appropriate hypothesis.1. The census bureau data show that the mean household

income in the area served by a shopping mall is $62,500 per year. A market research firm questions shoppers at the mall to find out whether the mean household income of mall shoppers is higher than that of the general population.

2. Last year, your company’s service technicians took an average of 2.6 hours to respond to trouble calls from business customers who had purchased service contracts. Do this year’s data show a different average response time?

Page 34: Chapter 6: Introduction to Inference  1.

34

Example: Hypothesis (cont)Translate each of the following research questions

into appropriate hypothesis.3. The drying time of paint under a specified test

conditions is known to be normally distributed with mean value 75 min and standard deviation 9 min. Chemists have proposed a new additive designed to decrease average drying time. It is believed that the new drying time will still be normally distributed with the same σ = 9 min. Should the company change to the new additive?

Page 35: Chapter 6: Introduction to Inference  1.

35

Test Statistic

A test statistic calculated from the sample data measures how far the data diverge from what we would expect if the null hypothesis H0 were true.

Large values of the statistic show that the data are not consistent with H0.

Page 36: Chapter 6: Introduction to Inference  1.

36

Example: Significance Test (con)You are in charge of quality control in your food company. You sample randomly four packs of cherry tomatoes, each labeled 1/2 lb. (227 g). The average weight from your four boxes is 222 g. The packaging process has a known standard deviation of 5 g.

c) What is the test statistic?d) What is the probability that 222 is consistent

with the null hypothesis?

Page 37: Chapter 6: Introduction to Inference  1.

37

Error Probabilities

• If we reject H0 when H0 is true, we have committed a Type I error.

• If we fail to reject H0 when H0 is false, we have committed a Type II error.

Truth about the populationH0 true H0 false (Ha

true)Conclusion based on sample

Reject H0

Fail to Reject H0

Page 38: Chapter 6: Introduction to Inference  1.

38

Tests of Significance

http://www.rmower.com/statistics/Stat_HW/0801HW_sol.htm

Page 39: Chapter 6: Introduction to Inference  1.

39

Type I and Type II errors

Page 40: Chapter 6: Introduction to Inference  1.

40

Type I vs. Type II errors (1)

Page 41: Chapter 6: Introduction to Inference  1.

41

Type I vs. Type II errors (2)

Page 42: Chapter 6: Introduction to Inference  1.

42

Type I vs. Type II errors (3)

Page 43: Chapter 6: Introduction to Inference  1.

43

Type I vs. Type II errors (4)

Page 44: Chapter 6: Introduction to Inference  1.

44

Type I vs. Type II errors (5)

Page 45: Chapter 6: Introduction to Inference  1.

45

Errors

• measures the strength of the sample evidence against H0

• The power measures the sensitivity (true negative) of the test

Page 46: Chapter 6: Introduction to Inference  1.

46

Example: Significance Test (con)You are in charge of quality control in your food company. You sample randomly four packs of cherry tomatoes, each labeled 1/2 lb. (227 g). The average weight from your four boxes is 222 g. The packaging process has a known standard deviation of 5 g.

c) What is the test statistic?d) What is the probability that 222 is consistent

with the null hypothesis?

Page 47: Chapter 6: Introduction to Inference  1.

47

P-values for t tests

Page 48: Chapter 6: Introduction to Inference  1.

48

P-value• The probability, computed assuming H0 is true, that

the statistic would take a value as or more extreme than the one actually observed is called the P-value of the test. The smaller the P-value, the stronger the evidence against H0.

• Small P-values are evidence against H0 because they say that the observed result is unlikely to occur when H0 is true.

• Large P-values fail to give convincing evidence against H0 because they say that the observed result is likely to occur by chance when H0 is true.

Page 49: Chapter 6: Introduction to Inference  1.

49

P-values for t tests

Page 50: Chapter 6: Introduction to Inference  1.

50

Decision• Reject H0 or Fail to Reject H0

Note: A fail-to-reject H0 decision in a significance test does not mean that H0 is true. For that reason, you should never “accept H0” or use language implying that you believe H0 is true.• In a nutshell, our conclusion in a significance test comes

down to:

– P-value small --> reject H0 --> conclude Ha (in context)

– P-value large --> fail to reject H0 --> cannot conclude Ha (in context)

Page 51: Chapter 6: Introduction to Inference  1.

51

Statistically Significant

• measures the strength of the sample evidence against H0

• If the P-value is smaller than , we say that the data are statistically significant at level . The quantity is called the significance level or the level of significance.

• When we use a fixed level of significance to draw a conclusion in a significance test,

– P-value ≤ --> reject H0 --> conclude Ha (in context)

– P-value > --> fail to reject H0 --> cannot conclude Ha (in context)

Page 52: Chapter 6: Introduction to Inference  1.

52

Statistically Significant - Comments

• Significance is a technical term• Determine what significance level () you want

BEFORE the data is analyzed.• Conclusion

– P-value ≤ --> reject H0

– P-value > --> fail to reject H0

Page 53: Chapter 6: Introduction to Inference  1.

53

Rejection Regions:

Page 54: Chapter 6: Introduction to Inference  1.

54

P-value interpretation

• The probability, computed assuming H0 is true, that the statistic would take a value as or more extreme than the one actually observed is called the P-value of the test.

• The P-value (or observed significance level) is the smallest level of significance at which H0 would be rejected when a specified test procedure is used on a given data set.

• The P-value is NOT the probability that H0 is true.

Page 55: Chapter 6: Introduction to Inference  1.

55

P-Value Interpretation

Page 56: Chapter 6: Introduction to Inference  1.

56

Procedure for Hypothesis Testing0. Identify the parameter(s) of interest and

describe it (them) in the context of the problem.1. State the Hypotheses.2. Calculate the appropriate test statistic.3. Find the P-value.4. Make the decision and state the conclusion in

the problem context.•Reject H0 or fail to reject H0 and why.•The data does [not] give strong support (P-

value = [x]) to the claim that the [statement of Ha in words].

Page 57: Chapter 6: Introduction to Inference  1.

57

Example: Significance Test (cont)You are in charge of quality control in your food company. You sample randomly four packs of cherry tomatoes, each labeled 1/2 lb. (227 g). The average weight from your four boxes is 222 g. The packaging process has a known standard deviation of 5 g.

d) Perform the appropriate significance test at a 0.05 significance level to determine if the calibrating machine that sorts cherry tomatoes needs to be recalibrated.

Page 58: Chapter 6: Introduction to Inference  1.

58

Single mean test: Summary

Null hypothesis: H0: μ = μ0

Test statistic: 0x

z/ n

AlternativeHypothesis

P-Value

One-sided: upper-tailed Ha: μ > μ0 P(Z ≥ z)One-sided: lower-tailed Ha: μ < μ0 P(Z ≤ z)two-sided Ha: μ ≠ μ0 2P(Z ≥ |z|)

Page 59: Chapter 6: Introduction to Inference  1.

59

CI and HT

Page 60: Chapter 6: Introduction to Inference  1.

60

Example: HT vs. CIYou are in charge of quality control in your food company. You sample randomly four packs of cherry tomatoes, each labeled 1/2 lb. (227 g). The average weight from your four boxes is 222 g. The packaging process has a known standard deviation of 5 g.

e) Determine the 95% CI.f) How do the results of part d) and e) compare?

Page 61: Chapter 6: Introduction to Inference  1.

61

Example: HT vs. CI (2) Suppose we are interested in how many credit

cards that people own. Let’s obtain a SRS of 100 people who own credit cards. In this sample, the sample mean is 4 and the sample standard deviation is 2. If someone claims that he thinks that μ > 2, is that person correct?

a) Construct a 99% lower bound for μ.b) Perform an appropriate hypothesis test with

significance level of 0.01.c) How would the conclusion have changed if Ha:

µ < 2?

Page 62: Chapter 6: Introduction to Inference  1.

62

Example: HT vs. CI (2)

b) The data does give strong support (P = 0) to the claim that the population average number of credit cards is greater than 2.

Page 63: Chapter 6: Introduction to Inference  1.

63

P-values for t tests

Page 64: Chapter 6: Introduction to Inference  1.

64

Example: HT vs. CI (2)

c) The data does not give strong support (P > 0.5) to the claim that the population average number of credit cards is less than 2.

Page 65: Chapter 6: Introduction to Inference  1.

65

Example 1: Extra PracticeA group of 15 male executives in the age group 35 –

44 have a mean systolic blood pressure of 126.07 and population standard deviation of 15.

a) Is this career group’s mean pressure different from that of the general population of males in this age group which have a mean systolic blood pressure of 128 at a significance level of 0.01?

b) Calculate and interpret the appropriate confidence interval.

c) Are the answers to part a) and b) the same or different? Explain your answer.

Page 66: Chapter 6: Introduction to Inference  1.

66

Example 2: Extra PracticeA new billing system will be cost effective only if the

mean monthly account is more than $170. Accounts have a population standard deviation of $65. A survey of 41 monthly accounts gave a mean of $187.

a) Will the new system be cost effective at a significance of 0.05?

b) Calculate the appropriate confidence bound.c) Are the answers to part a) and b) the same or

different? Explain your answer.d) What would the conclusion in part a) be if the

monthly accounts gave a mean of $160? Please perform the hypothesis tests.

Page 67: Chapter 6: Introduction to Inference  1.

67

Confidence interval vs. Significance Test

Confidence Interval Significance TestRange of values at one confidence level.

Yes or no with a measure of how close you are to the cutoff.

Page 68: Chapter 6: Introduction to Inference  1.

68

More on P-value

• When you report a significance test, always report the P-value.

• The P-value is the smallest level of at which the data is significant.

• P-value is calculated from the data, is chosen by each individual.

Page 69: Chapter 6: Introduction to Inference  1.

69

6.3: Use and Abuse of Tests - Goals• Be able to describe the factors involved in determining

an appropriate significance level.• Be able to differentiate between practical (or scientific)

significance and statistical significance.• Be able to determine when statistical inference can be

used.• State the problems involved with searching for

statistical significance.

Page 70: Chapter 6: Introduction to Inference  1.

70

How small a P is convincing?(factors involved in choosing )

• How plausible is H0?• What are the consequences of your

conclusion?• Are you conducting a preliminary study?

Page 71: Chapter 6: Introduction to Inference  1.

71

Notes for choosing the significance level

• Use the cut-off that is standard in your field• There is no sharp border between

“significant” and “not significant”• It is the order of magnitude of the P-value that

matters.• Do not use = 0.05 as the default value!(Sir R.A. Fisher said, “A scientific fact should be regarded as experimentally established only if a properly designed experiment rarely fails to give this level of significance.”

Page 72: Chapter 6: Introduction to Inference  1.

72

Statistical vs. Practical Significance

• Statistical significance: the effect observed is not likely to be due to chance alone.

• Practical significance: the effect has some practical consequence.

Page 73: Chapter 6: Introduction to Inference  1.

73

Statistical vs. Practical Significance

An Illustration of the Effect of Sample Size on P-values

Page 74: Chapter 6: Introduction to Inference  1.

74

Lack of Evidence

Consider this provocative title from the British Medical Journal: “Absence of evidence is not evidence of absence.”

Page 75: Chapter 6: Introduction to Inference  1.

75

Beware of Searching for Significance

• Decide the experiment BEFORE you look at the data.

• All of our tests involve errors.

The previous two points do not imply that exploratory data analysis is a bad thing. Exploratory analysis often leads to interesting discoveries. However, if the data at hand suggest an interesting theory, then test that theory on a new set of data!

Page 76: Chapter 6: Introduction to Inference  1.

76

6.4: Power and Inference as a Decision- Goals

• Describe the two types of possible errors and the relationship between them.

• Define the power of a test.• Be able to calculate the power of a test given the

sample size, significance level and true value of the mean.

Page 77: Chapter 6: Introduction to Inference  1.

77

Types of Errors

• If we reject H0 when H0 is true, we have committed a Type I error.

• If we fail to reject H0 when H0 is false, we have committed a Type II error.

Truth about the population

H0 trueH0 false(Ha true)

Conclusion based on sample

Reject H0 Type I error Correct conclusion

Fail to reject H0

Correct conclusion

Type II error

Page 78: Chapter 6: Introduction to Inference  1.

78

Type I vs. Type II errors (5)

Page 79: Chapter 6: Introduction to Inference  1.

79

Type I vs. Type II errors (4)

Page 80: Chapter 6: Introduction to Inference  1.

80

Increase the power

• • ’• • n