chapter 6: introduction to inference 1
TRANSCRIPT
1
Chapter 6: Introduction to Inference
http://pballew.blogspot.com/2011/03/100-confidence-interval.html
2
Statistical Inference
Sampling
3
Sampling Variability
What would happen if we took many samples?
Population
Sample
Sample
Sample
Sample
Sample
Sample
Sample
Sample
?
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.
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.
6
Confidence Interval: Definition
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?
8
Confidence Interval: Definition
9
Confidence Interval
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.”
11
Interpretation of CI
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].
13
t-Table (Table D)
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.
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).
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
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%?
18
Impact of Sample Size
Sample size n
Sta
ndar
d er
ror ⁄
√n
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?
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.
21
Confidence Bound
• Upper confidence bound
• Lower confidence bound
• z* critical valuesC z*0.90 1.2820.95 1.6450.99 2.326
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 ….
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
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!
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.
26
Tests of Significance
http://www.rmower.com/statistics/Stat_HW/0801HW_sol.htm
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.
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.
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?
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.
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
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?
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?
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?
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.
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?
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
38
Tests of Significance
http://www.rmower.com/statistics/Stat_HW/0801HW_sol.htm
39
Type I and Type II errors
40
Type I vs. Type II errors (1)
41
Type I vs. Type II errors (2)
42
Type I vs. Type II errors (3)
43
Type I vs. Type II errors (4)
44
Type I vs. Type II errors (5)
45
Errors
• measures the strength of the sample evidence against H0
• The power measures the sensitivity (true negative) of the test
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?
47
P-values for t tests
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.
49
P-values for t tests
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)
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)
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
53
Rejection Regions:
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.
55
P-Value Interpretation
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].
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.
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|)
59
CI and HT
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?
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?
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.
63
P-values for t tests
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.
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.
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.
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.
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.
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.
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?
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.”
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.
73
Statistical vs. Practical Significance
An Illustration of the Effect of Sample Size on P-values
74
Lack of Evidence
Consider this provocative title from the British Medical Journal: “Absence of evidence is not evidence of absence.”
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!
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.
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
78
Type I vs. Type II errors (5)
79
Type I vs. Type II errors (4)
80
Increase the power
• • ’• • n