chapter 6 statistical inference & hypothesis testing
DESCRIPTION
CHAPTER 6 Statistical Inference & Hypothesis Testing. 6.1 - One Sample Mean μ , Variance σ 2 , Proportion π 6.2 - Two Samples Means, Variances, Proportions μ 1 vs. μ 2 σ 1 2 vs. σ 2 2 π 1 vs. π 2 6.3 - Multiple Samples Means, Variances, Proportions - PowerPoint PPT PresentationTRANSCRIPT
• 6.1 - One Sample
Mean μ, Variance σ 2, Proportion π
• 6.2 - Two Samples Means, Variances, Proportions
μ1 vs. μ2 σ12 vs. σ2
2 π1 vs. π2
• 6.3 - Multiple Samples Means, Variances, Proportions
μ1, …, μk σ12, …, σk2 π1, …, πk
CHAPTER 6 Statistical Inference & Hypothesis Testing
• 6.1 - One Sample
Mean μ, Variance σ 2, Proportion π
• 6.2 - Two Samples Means, Variances, Proportions
μ1 vs. μ2 σ12 vs. σ2
2 π1 vs. π2
• 6.3 - Multiple Samples Means, Variances, Proportions
μ1, …, μk σ12, …, σk2 π1, …, πk
CHAPTER 6 Statistical Inference & Hypothesis Testing
• 6.1 - One Sample
Mean μ, Variance σ 2, Proportion π
• 6.2 - Two Samples Means, Variances, Proportions
μ1 vs. μ2 σ12 vs. σ2
2 π1 vs. π2
• 6.3 - Multiple Samples Means, Variances, Proportions
μ1, …, μk σ12, …, σk2 π1, …, πk
CHAPTER 6 Statistical Inference & Hypothesis Testing
Women in U.S. who have given birth
POPULATION“Random Variable”
X = Age (years)
That is, X ~ N(μ, 1.5).
Present: Assume that X follows a “normal distribution” in the population, with std dev σ = 1.5 yrs, but unknown mean μ = ?
mean x = 25.6FORMULA
mean μ = ???
{x1, x2, x3, x4, … , x400}
standard deviation σ = 1.5
This is referred to as a “point estimate” of μ from the sample.
Improve this point estimate of μ to an “interval estimate” of μ, via the…
“Sampling Distribution of ” X
size n = 400
Example: One Mean
Objective 1: “Parameter Estimation”
Estimate the parameter value μ.
X = Age of women in U.S. who have given birth
Sampling Distribution of XPopulation Distribution of X
X
μ
standard deviation σ = 1.5 yrs
If X ~ N(μ, σ), then… for any sample size n.,n
X ~ N ,
μ
X
“standard error”1.5 yrs
.075 yrs400n
n
XZ
X
Z
X d X d- +
Sampling Distribution of X
μ
X
“standard error”1.5 yrs
.075 yrs400n
To achieve Objective 1 — obtain an “interval estimate” of μ — we first ask
the following general question:
Find a “margin of error” (d) so that there is a 95% probability that the interval contains μ. X d, X d- +
d
μP X - d X d< < + = 0.95
μ μP - d X d< < + = 0.95
X
. .
-d dP Z
+< < = 0.95
s.e s.e
XZ
s.e.
Suppose is any random sample mean.
X
X|μ
μP X - d X d< < + = 0.95
μ μP - d X d< < + = 0.95
. .
-d dP Z
+< < = 0.95
s.e s.e
XZ
s.e.
X|μX d X d- +
Sampling Distribution of X
μ
X
“standard error”1.5 yrs
.075 yrs400n
d
X
μP X - d X d< < + = 0.95
μ μP - d X d< < + = 0.95
. .
-d dP Z
+< < = 0.95
s.e s.e
XZ
s.e.
standard normal distributionN(0, 1)
Z
0.95
0.025 0.025
+z.025-z.025
d = (z.025)(s.e.) = (1.96)(.075 yrs) = 0.147 yrs
μP X - d X d< < + = 0.95
μ μP - d X d< < + = 0.95
. .
-d dP Z
+< < = 0.95
s.e s.e
XZ
s.e.
X|μX d X d- +
d
X
μP X - d X d< < + = 0.95
μ μP - d X d< < + = 0.95
. .
-d dP Z
+< < = 0.95
s.e s.e
XZ
s.e.
standard normal distributionN(0, 1)
Z
0.95
0.025 0.025
+z.025-z.025
d = (z.025)(s.e.) = (1.96)(.075 yrs) = 0.147 yrs
The “confidence level” is 95%.
IMPORTANT DEF’NS and FACTS
d is called the “95% margin of error” and is equal to the product of the “.025 critical value” (i.e., z.025 = 1.96) times the “standard error” (i.e., ).
n
The “significance level” is 5%.
For any random sample mean the “95% confidence interval” is
It contains μ with probability 95%.
X,
- +X X ( margin of error, margin of error).
In this example, the 95% CI is- +X X ( 0.147, 0.147).
For instance, if a particular sample yields the 95% CI is (25.6 – 0.147, 25.6 + 0.147) = (25.543, 25.747) yrs. It contains μ with 95% “confidence.”
x = 25.6 yrs,
μP X - d X d< < + = 0.95
μ μP - d X d< < + = 0.95
. .
-d dP Z
+< < = 0.95
s.e s.e
XZ
s.e.
X|μX d X d- +
d
X
μP X - d X d< < + = 0.95
μ μP - d X d< < + = 0.95
. .
-d dP Z
+< < = 0.95
s.e s.e
XZ
s.e.
standard normal distributionN(0, 1)
Z
0.95
0.025 0.025
+z.025-z.025
d = (z.025)(s.e.) = (1.96)(.075 yrs) = 0.147 yrs
The “confidence level” is 95%.
IMPORTANT DEF’NS and FACTS
d is called the “95% margin of error” and is equal to the product of the “.025 critical value” (i.e., z.025 = 1.96) times the “standard error” (i.e., ).
n
The “significance level” is 5%.
For any random sample mean the “95% confidence interval” is
It contains μ with probability 95%.
X,
- +X X ( margin of error, margin of error).
In this example, the 95% CI is- +X X ( 0.147, 0.147).
For instance, if a particular sample yields the 95% CI is (25.6 – 0.147, 25.6 + 0.147) = (25.543, 25.747) yrs. It contains μ with 95% “confidence.”
x = 25.6 yrs,
1 – α
α/2 α/2
+zα/2-zα/2
1 – α
“α/2
“100(1 – α)% margin of error”
zα/2)
1 – α.
α.
“100(1 – α)% “confidence interval”
1 – α.
d = (zα/2)(s.e.)
μ μP - d X d α< < + = 1 -
. .
-d dP Z α
+< < = 1 -
s.e s.e
Example: α = .05, 1 – α = .95 Example: α = .10, 1 – α = .90 Example: α = .01, 1 – α = .99
+1.645-1.645
μP X - d X d< < + = 0.95
μ μP - d X d< < + = 0.95
. .
-d dP Z
+< < = 0.95
s.e s.e
XZ
s.e.
X|μX d X d- +
d
X
μP X - d X d< < + = 0.95
XZ
s.e.
standard normal distributionN(0, 1)
Z
0.95
0.025 0.025
+z.025-z.025
The “confidence level” is 95%.
IMPORTANT DEF’NS and FACTS
d is called the “95% margin of error” and is equal to the product of the “.025 critical value” (i.e., z.025 = 1.96) times the “standard error” (i.e., ).
n
The “significance level” is 5%.
For any random sample mean the “95% confidence interval” is
It contains μ with probability 95%.
X,
- +X X ( margin of error, margin of error).
1 – α
α/2 α/2
+zα/2-zα/2
1 – α
“α/2
“100(1 – α)% margin of error”
zα/2)
1 – α.
α.
“100(1 – α)% “confidence interval”
1 – α.
d = (zα/2)(s.e.)
μ μP - d X d α< < + = 1 -
What happens if we change α?
-1.96 +1.96 +2.575-2.575
|0
Why not ask for α = 0, i.e., 1 – α = 1?Because then the critical values → ± ∞.
. .
-d dP Z α
+< < = 1 -
s.e s.e
μP X - X0.147 < < + 0.147 = 0.95
μ μP - X0.147 < < + 0.147 = 0.95
95% margin of error(z.025)(s.e.) = (1.96)(.075 yrs) = 0.147 yrs
IMPORTANT DEF’NS and FACTS
X2
X3
0.147
X1
μ|
X4
X5
X6 … etc…
In principle, over the long run, the probability that a random interval contains μ will approach 95%.
standard normal distributionN(0, 1)0.95
0.025 0.025
+1.96-1.96
Z
?
BUT….
In this example, the 95% CI is- +X X ( 0.147, 0.147).
For instance, if a particular sample yields the 95% CI is (25.6 – 0.147, 25.6 + 0.147) = (25.543, 25.747) yrs. It contains μ with 95% “confidence.”
x = 25.6 yrs,
0.784
X1
μ|
In principle, over the long run, the probability that a random interval contains μ will approach 95%.
standard normal distributionN(0, 1)0.95
0.025 0.025
+1.96-1.96
Z
BUT….
In practice, only a single, fixed interval is generated from a single
random sample, so technically, “probability” does not apply.
NOW, let us introduce and test a specific hypothesis…
μP X - X0.147 < < + 0.147 = 0.95
μ μP - X0.147 < < + 0.147 = 0.95
95% margin of error(z.025)(s.e.) = (1.96)(.075 yrs) = 0.147 yrs
IMPORTANT DEF’NS and FACTSIn this example, the 95% CI is
- +X X ( 0.147, 0.147).
For instance, if a particular sample yields the 95% CI is (25.6 – 0.147, 25.6 + 0.147) = (25.543, 25.747) yrs. It contains μ with 95% “confidence.”
x = 25.6 yrs,
Women in U.S. who have given birth
μ > 25.4
POPULATION
“Random Variable” X = Age at first birth
mean μ = 25.4
H0:
“Null Hypothesis”
μ < 25.4 That is, X ~ N(25.4, 1.5).
μ < 25.4
standard deviation σ = 1.5 μ > 25.4
Year 2010: Suppose we know that X follows a “normal distribution” (a.k.a. “bell curve”) in the population.
Or, is the “alternative hypothesis” HA: μ ≠ 25.4 true?
mean x = 25.6
Statistical Inference and
Hypothesis Testing
{x1, x2, x3, x4, … , x400}
Study Question:Has “age at first birth” of women in the U.S. changed over time?
• public education, awareness programs• socioeconomic conditions, etc.
FORMULA
Does the sample statistic tend to support H0, or refute H0 in favor of HA?
x = 25.6
i.e., either or ? (2-sided)
Present: Is μ = 25.4 still true?
95% CONFIDENCE INTERVAL FOR µ
25.74725.543 = 25.4
BASED ON OUR SAMPLE DATA, the true value of μ today is between 25.543 and 25.747, with 95% “confidence.”
We have now seen:
x = 25.6
FORMAL CONCLUSIONS:
The 95% confidence interval corresponding to our sample mean does not contain the “null value” of the population mean, μ = 25.4.
Based on our sample data, we may reject the null hypothesis H0: μ = 25.4 in favor of the two-sided alternative hypothesis HA: μ ≠ 25.4, at the α = .05 significance level.
INTERPRETATION: According to the results of this study, there exists a statistically significant difference between the mean ages at first birth in 2010 (25.4 yrs) and today, at the 5% significance level. Moreover, the evidence from the sample data suggests that the population mean age today is older than in 2010, rather than younger.
“point estimate” for μ
Objective 2: Hypothesis Testing… via Confidence Interval
NOTE THAT THE CONFIDENCE INTERVAL ONLY DEPENDS ON THE SAMPLE, NOT A SPECIFIC NULL HYPOTHESIS!!!
BASED ON OUR SAMPLE DATA, the true value of μ today is between 25.543 and 25.747, with 95% “confidence.”
BASED ON OUR SAMPLE DATA, the true value of μ today is between 25.053 and 25.347, with 95% “confidence.”
We have now seen:
= 25.4
What if…? 95% CONFIDENCE INTERVAL FOR µ
25.74725.543
FORMAL CONCLUSIONS:
The 95% confidence interval corresponding to our sample mean does not contain the “null value” of the population mean, μ = 25.4.
Based on our sample data, we may reject the null hypothesis H0: μ = 25.4 in favor of the two-sided alternative hypothesis HA: μ ≠ 25.4, at the α = .05 significance level.
INTERPRETATION: According to the results of this study, there exists a statistically significant difference between the mean ages at first birth in 2010 (25.4 yrs) and today, at the 5% significance level. Moreover, the evidence from the sample data suggests that the population mean age today is older than in 2010, rather than younger.
x = 25.6
“point estimate” for μ
Objective 2: Hypothesis Testing… via Confidence Interval
x = 25.2
“point estimate” for μ
95% CONFIDENCE INTERVAL FOR µ
25.34725.053
younger than in 2010, rather than older.
? NOTE THAT THE CONFIDENCE INTERVAL ONLY DEPENDS ON THE SAMPLE, NOT A SPECIFIC NULL HYPOTHESIS!!!
μ μP - X0.147 < < + 0.147 = 0.95
μP X - X0.147 < < + 0.147 = 0.95
P - X0.147 < < + 0.147 = 0.9525.4 25.4 P X< < = 0.9525.253 25.547
Objective 2: Hypothesis Testing… via Confidence IntervalObjective 2: Hypothesis Testing… via Acceptance Region
X|
μ = 25.4
95% margin of error(z.025)(s.e.) = (1.96)(.075 yrs) = 0.147 yrs
IF the null hypothesis H0: μ = 25.4 is indeed true, then…
μ
X
“standard error”1.5 yrs
.075 yrs400n
Sampling Distribution of X
25.4
“Null” Distribution of X
25.253 25.547
95% ACCEPTANCE REGION FOR H0
… we would expect a random sample mean to lie in here, with
95% probability… X
… and out here…
…with 5% probability.
0.025 0.025
0.95
= 25.4 x = 25.6
IF H0 is true, then we would expect a random sample mean to lie between 25.253 and 25.547, with 95% probability.
x
25.54725.253
95% ACCEPTANCE REGION FOR H0
Objective 2: Hypothesis Testing… via Acceptance Region
FORMAL CONCLUSIONS:
The 95% acceptance region for the null hypothesis does not contain the sample mean of
Based on our sample data, we may reject the null hypothesis H0: μ = 25.4 in favor of the two-sided alternative hypothesis HA: μ ≠ 25.4, at the α = .05 significance level.
INTERPRETATION: According to the results of this study, there exists a statistically significant difference between the mean ages at first birth in 2010 (25.4 yrs) and today, at the 5% significance level. Moreover, the evidence from the sample data suggests that the population mean age today is older than in 2010, rather than younger.
We have now seen:
x = 25.6.
Our data value lies in the
5% REJECTION REGION.
NOTE THAT THE ACCEPTANCE REGION ONLY DEPENDS ON THE NULL HYPOTHESIS, NOT ON THE SAMPLE!!!
what is the probability of obtaining a random sample mean that is as, or more, extreme than the one actually obtained?
= 0.0077
X
Zs.e.
IF the null hypothesis H0: μ = 25.4 is indeed true, then…
Objective 2: Hypothesis Testing… via Acceptance RegionObjective 2: Hypothesis Testing… via “p-value”
|
μ = 25.425.253 25.547
95% ACCEPTANCE REGION FOR H0
0.025 0.025
0.95
x = 25.6
i.e., 0.2 yrs OR MORE away from μ = 25.4, ON EITHER SIDE (since the alternative hypothesis is 2-sided)?
P X X= 25.2 U 25.6
P X P X= 25.2 25.6
P X= 2 25.6 P Z= 2 2.667= 2(0.00383)
0.003830.00383
< .05statistically significant
25.2
Z
25.6 25.4.075
> 1.96
- measures the strength of the rejection
what is the probability of obtaining a random sample mean that is as, or more, extreme than the one actually obtained?
= 0.0077
X
Zs.e.
IF the null hypothesis H0: μ = 25.4 is indeed true, then…
Objective 2: Hypothesis Testing… via Acceptance RegionObjective 2: Hypothesis Testing… via “p-value”
|
μ = 25.425.253 25.547
95% ACCEPTANCE REGION FOR H0
0.025 0.025
0.95
x = 25.6
i.e., 0.2 yrs OR MORE away from μ = 25.4, ON EITHER SIDE (since the alternative hypothesis is 2-sided)?
P X X= 25.2 U 25.6
P X P X= 25.2 25.6
P X= 2 25.6 P Z= 2 2.667= 2(0.00383)
0.003830.00383
< .05statistically significant
25.2
Z
25.6 25.4.075
> 1.96
α
1 – α
α / 2 α / 2 100(1 – α)% ACCEPTANCE REGION FOR H0
-zα/2 +zα/2
- measures the strength of the rejection
= .05
If p-value < , then reject H0; significance!
... But interpret it correctly!
CONFIDENCE INTERVAL
Compute the sample mean
Compute the 100(1 – α)% “margin of error” = (critical value)(standard error)
Then the 100(1 – α)% CI =
Formal Conclusion:
Reject null hypothesis at level α, Statistical
significance! Otherwise, retain it.
x.
if CI does not contain μ0.
x x ( - margin of error, + margin of error).
~ Summary of Hypothesis Testing for One Mean ~
NULL HYPOTHESIS H0: μ = μ0 (“null value”)
ALTERNATIVE HYPOTHESIS HA: μ μ0 i.e., either μ < μ0 or μ > μ0 (“two-sided”)
Test null hypothesis at significance level α.
zα/2 σ n
Assume the population random variable is normally distributed, i.e., X N(μ, σ).
ACCEPTANCE REGION
Compute the sample mean
Compute the 100(1 – α)% “margin of error” = (critical value)(standard error)
Then the 100(1 – α)% AR =
Formal Conclusion:
Reject null hypothesis at level α, Statistical
significance! Otherwise, retain it.
μ μ0 0 ( - margin of error, + margin of error).
~ Summary of Hypothesis Testing for One Mean ~
NULL HYPOTHESIS H0: μ = μ0 (“null value”)
ALTERNATIVE HYPOTHESIS HA: μ μ0 i.e., either μ < μ0 or μ > μ0 (“two-sided”)
Test null hypothesis at significance level α.
zα/2 σ n
Assume the population random variable is normally distributed, i.e., X N(μ, σ).
x.if AR does not contain
x.
p-value
Compute the sample mean
Compute the z-score
If +, then the p-value = 2 P(Z ≥ z-score ).
If –, then the p-value = 2 P(Z ≤ z-score ).
Formal Conclusion:
Reject null hypothesis Statistical significance! Otherwise, retain it.Remember: “The smaller the p-value, the stronger the rejection, and the more statistically significant the result.”
~ Summary of Hypothesis Testing for One Mean ~
NULL HYPOTHESIS H0: μ = μ0 (“null value”)
ALTERNATIVE HYPOTHESIS HA: μ μ0 i.e., either μ < μ0 or μ > μ0 (“two-sided”)
Test null hypothesis at significance level α.
x - μσ n
0
Assume the population random variable is normally distributed, i.e., X N(μ, σ).
x. (shown)
or
Z ~ N(0, 1)
z-score
if p < α.
The alternative hypothesis
usually reflects the
investigator’s belief!
|
μ = 25.4
95% ACCEPTANCE REGION FOR H0
0.95
25.253 25.547
0.025 0.025.00383.00383
x = 25.6
= .0077
Objective 2: Hypothesis Testing… 1-sided tests
P X X= 25.2 U 25.6
P X P X= 25.2 25.6
P X= 2 25.6 P Z= 2 2.667= 2(.00383) < .05
statistically significant
2-sided test H0: μ = 25.4HA: μ 25.4
1-sided tests“Right-tailed”
H0: μ 25.4HA: μ > 25.4
Here, all of = .05 is in the right tail.
In this case, = .05 is split evenly between the two tails, left and right.
p-value
The alternative hypothesis
usually reflects the
investigator’s belief!
25.2
= .0077.00383
25.2
.00383
25.54725.253
P Z= 2 2.667
0.0250.025
95% ACCEPTANCE REGION FOR H0
Objective 2: Hypothesis Testing… 1-sided tests
P X X= 25.2 U 25.6
P X P X= 25.2 25.6
P X= 2 25.6= 2(.00383) < .05
statistically significant
2-sided test H0: μ = 25.4HA: μ 25.4
In this case, = .05 is split evenly between the two tails, left and right.
p-value
|
μ = 25.4
0.95
.00383
1-sided tests“Right-tailed”
H0: μ 25.4HA: μ > 25.4
Here, all of = .05 is in the right tail.
95% ACCEPTANCE REGION FOR H0
x = 25.6
0.05
?
= 2(.00383) P Z= 2 2.667 P Z 2.667
(.99617)
P X X= 25.2 U 25.6
P X P X= 25.2 25.6
P X= 2 25.6
Objective 2: Hypothesis Testing… 1-sided tests
< .05
statistically significant
2-sided test H0: μ = 25.4HA: μ 25.4
In this case, = .05 is split evenly between the two tails, left and right.
p-value
|
μ = 25.4
0.95
1-sided tests“Right-tailed”
H0: μ 25.4HA: μ > 25.4
Here, all of = .05 is in the right tail.
95% ACCEPTANCE REGION FOR H0
0.05
?
25.2
25.2
25.2
>> .05
strong support of null hypothesis
x = 25.2
“Left-tailed”H0: μ 25.4HA: μ < 25.4
Here, all of = .05 is in the left tail.
The alternative hypothesis
usually reflects the
investigator’s belief!
x = 25.6
= .00383.99617
STATBOT 301Subject: basic calculation of p-values for
z-test
sign of z-score?
1 – table entrytable entry
HA: μ ≠ μ0?HA: μ < μ0 HA: μ > μ0
2 × table entry 2 × (1 – table entry)
– +
CALCULATE… from H0
Test Statistic
“z-score” =
0x
n
CALCULATE… from H0
Test Statistic
“z-score” =
sign of z-score?
1 – table entrytable entry
HA: μ ≠ μ0?HA: μ < μ0 HA: μ > μ0
2 × table entry 2 × (1 – table entry)
– +
0x
n
Women in U.S. who have given birth
POPULATION“Random Variable”
X = Age (years)
Present: Assume that X follows a “normal distribution” in the population, with std dev σ = 1.5 yrs, but unknown mean μ = ?
mean x = 25.6FORMULA
mean μ = ???
{x1, x2, x3, x4, … , x400}
Estimate the parameter value μ.
standard deviation σ = 1.5
This is referred to as a “point estimate” of μ from the sample.
Improve this point estimate of μ to an “interval estimate” of μ, via the…
“Sampling Distribution of “ X
size n = 400
Example: One Mean
Objective 1: “Parameter Estimation”
But how do we know that the variance is
the same as in 2010?
That is, X N(μ, 1.5).
(1.5)2 = 2.25 in our example
… which leads us to…
All have postively-skewed tails.
HOWEVER……
In practice, 2 is almost never known, so the sample variance s 2 is used as a substitute in all calculations!