0% found this document useful (0 votes)
75 views

07 Chapter 9 Hypothesis Testing

This document discusses hypothesis testing and statistical inference. It covers: 1. Developing the null and alternative hypotheses based on the problem context and parameter of interest. 2. Choosing the appropriate test statistic such as Z-test or t-test based on what is known about the population and sample. 3. Determining the rejection region and computing the test statistic and p-value to decide whether to reject the null hypothesis. The document provides an example of testing whether the mean burning rate of a solid propellant meets specifications, demonstrating how to state the hypotheses, choose the test statistic, compute values, and make an inference.

Uploaded by

chen
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

07 Chapter 9 Hypothesis Testing

This document discusses hypothesis testing and statistical inference. It covers: 1. Developing the null and alternative hypotheses based on the problem context and parameter of interest. 2. Choosing the appropriate test statistic such as Z-test or t-test based on what is known about the population and sample. 3. Determining the rejection region and computing the test statistic and p-value to decide whether to reject the null hypothesis. The document provides an example of testing whether the mean burning rate of a solid propellant meets specifications, demonstrating how to state the hypotheses, choose the test statistic, compute values, and make an inference.

Uploaded by

chen
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

INDE 315: Probability &

Statistics for Engineers


Chapter 9
• Instructor: Patty Buchanan,
[email protected]
Yes
Use Z score

Yes

𝜇 Population No
Parameter of Sample Size >30? Use T-score
Variance Known?
Interest? No

𝜎!

Chi Square Dist


9-1 Hypothesis Testing
A statistical hypothesis is
a statement about the parameters (Ch 7) of
a probability distribution.

Single Sample
Null hypothesis H 0 : µ = µ0
Alternative hypothesis H1 : µ ≠ µ 0
Statistical Hypotheses

Example: Aircrew escape system: what is burning


rate of the solid propellant for this system.
1. Compute the point estimate of the mean (Ch 7).
2. Want to know if the mean burning rate is 50
cm/sec.
Develop a hypothesis test based on this..
But before we do…
Solid Propellant Crew Escape System for SpaceX
Solid Propellant Crew Escape System
Dragon Capsule
for SpaceX
Dragon Capsule

> Mean burning rate must


• be 50 centimeters
Mean burning rate per
second.
must beMeasured
50
standard deviation
centimeters per of
burning
second. rate is 2
Measured
centimeters per second.
standard deviation of
burning rate is σ = 2
centimeters per
second.
Statistical Hypotheses
Two-sided Alternative Hypothesis
H 0 : µ = 50 cm/sec null hypothesis
H1 : µ ≠ 50 cm/sec alternative hypothesis

One-sided Alternative Hypotheses

H 0 : µ = 50 cm/sec H 0 : µ = 50 cm/sec
OR
H1 : µ < 50 cm/sec H1 : µ > 50 cm/sec
Two-sided Hypothesis Testing
H 0 : µ = 50 cm/sec
H1 : µ ≠ 50 cm/sec

Confidence Interval
Types of error
In reality, H0 is
True False
Your test says that Fail to Correct conclusion Type II error
H0 should be: Reject b
Reject Type I error Correct conclusion
a

Type I: reject null hypothesis when it’s really true, a


a=P(Type I error)=P(reject Ho when Ho is true)

Type II: fail to reject null hypothesis when it’s really false, b
b=P(Type II error)=P(fail to reject Ho when Ho is false)
8
Type I error, a

a=P(Type I error)=P(reject Ho when Ho is true)


Type II error, b

b=P(Type II error)=P(fail to reject Ho when Ho is false)


Type I and Type II errors
Students Professor

Age

• The two groups are truly • There is overlap


separated • a =0.05 and b =0.15
• a and b are 0.00 • 15% chance that the
• No false rejections or false difference between groups
acceptances of Ho may go undetected.

Images from: http://www.westgard.com/lesson39.htm


Statistical Inference
An Engine Explodes
H0: An automobile engine functions properly when
started.
H1: An automobile engine malfunctions when started.

> Type I error – reject the null hypothesis that the


engine functions properly
– Replace the engine – But original engine was fine

Producer’s Risk
> Type II error – do not reject the null hypothesis that
the engine functions properly (i.e., think it’s okay)
– Leave engine in the car – ENGINE MALFUNCTION

Consumer’s Risk
Statistical Inference
Guilty or Not Guilty
H0: A person is innocent
H1: A person is guilty

> Type I error - based on the evidence, REJECT the


null hypothesis that person is innocent
– Send him/her to jail – but person was innocent
> Type II error – lack of evidence to state the person
is guilty: do not reject the hypothesis that the
person is innocent
– Set him/her free – but person was guilty

For further reading: http://www.intuitor.com/statistics/T1T2Errors.html


Response Style (Beta, b)

Risky Situation (low b) vs. conservative (high b)

> If b=0.05 (risky), then the operator is reluctant to say it is


noise => would rather take the RISK that it is a signal, than
to miss anything.
> Ex.: TSA checking for bombs. Better to assume a bomb and
pull the person over for a check, then to miss something.

> If b=0.20 (conservative), then the operator is more likely to


say it is noise (more likely to miss target).
> Ex.: Court of law. Better to assume someone is innocent
(than put them in jail for a crime they may not have
committed)

14
Statistical Hypotheses
Two-sided Alternative Hypothesis
H 0 : µ = 50 cm/sec Given: n=10, σ =2.5
H1 : µ ≠ 50 cm/sec

We will NOT reject the null hypothesis if: 48.5 ≤ x ≤ 51.5

We WILL reject the null hypothesis if: x < 48.5 or x > 51.5

The probability of making a Type I error (a) is:

α = P(X < 48.5) + P(X > 51.5)


Type I error
The probability of making a Type I error (a) is:

α = P(X < 48.5) + P(X > 51.5)


48.5− 50
z1 = = −1.90
2.5 / 10
51.5− 50
z2 = = 1.90
2.5 / 10

α = P(Z < −1.90) + P(Z > 1.90) = 2 × 0.028717 = 0.057434


Type II error
Two-sided Alternative Hypothesis
H 0 : µ = 50 cm/sec Given: n=10, σ =2.5
H1 : µ ≠ 50 cm/sec
But the true value of the mean, µ=52

The probability of making a


Type II error (b) is:

β = P(48.5 ≤ X ≤ 51.5)
Type II error
The probability of making a Type II error (b) is:
β = P(48.5 ≤ X ≤ 51.5)
If the true value of the mean, µ=52

48.5 − 52 51.5 − 52
z1 = = −4.43 z2 = = −0.63
2.5 / 10 2.5 / 10

β = P(−4.43 ≤ Z ≤ −0.63)
= P(Z ≤ −0.63) − P(Z ≤ −4.43)
= 0.2643− 0
= 0.2643
Type II error, part 2
The probability of making a Type II error (b) gets
bigger when the difference between the true mean and
hypothesized mean gets smaller

β = P(48.5 ≤ X ≤ 51.5) But the true value is, µ=50.5

48.5 − 50.5 51.5 − 50.5


z1 = = −2.53 z2 = = 1.27
2.5 / 10 2.5 / 10

β = P(−2.53 ≤ Z ≤ 1.27)
= P(Z ≤ 1.27) − P(Z ≤ −2.53) Compare that to b=0.2643 (last
= 0.8923 slide) where µ=52
Power of a Test

• The Power of a test of hypothesis is


given by 1-b
• That is, 1-b is the probability of:
– correctly rejecting a false null hypothesis, or
– rejecting the null hypothesis when the
alternative is true.
9-1.4 P-Value
A probability defined as the smallest level of
significance that will lead to rejection H0 with
the sampled data
P-Value

> P-value is the OBSERVED (or computed)


significance level
=> computed from your sampled data
> a (Type 1) and b (Type 2) are set beforehand
P-Value
Let's say that the computed
p-value = P(Z < −1.90) + P(Z > 1.90) = 2 × 0.028717 = 0.057434

Compare this p-value to a specific level of significant


(e.g, 0.05) to identify whether or not to reject Ho
Steps in Hypothesis Testing
1. From the problem context, identify the parameter of
interest (e.g., mean, variance)
2. State the null hypothesis, H0 .
3. Specify an appropriate alternative hypothesis, H1.
4. Determine an appropriate test statistic
(e.g, Z-test, t-test, c2 test)
5. State the rejection region for the statistic.
6. Compute any necessary sample quantities, substitute
these into the equation for the test statistic, and compute
that value.
7. Decide whether or not H0 should be rejected and report
that in the problem context.
Inference on the Mean of a Population,
Variance Known

> Hypotheses: H0: µ=µo H1: µ ≠µo


> Test Statistic:
x - µ0
Z0 =
s/ n
> Significance Level, a
> Rejection Region:
Two sided test: Zo < -Za/2 or Zo > Za/2
One sided test: (lower) Zo < -Za
(upper) Zo > Za
Confidence Interval for Z

σ σ
x − Zα ≤ µ ≤ x + Zα
2 n 2 n

This indicates the 100(1-a)% two sided


confidence interval on the true mean

If a=0.05, we are 95 % confident that the


true mean lies within these parameters.
Example 9-2: Aircraft escape systems
Specification requires mean burning rate of 50 cm/sec
Given s=2 per sec, n=25, x-bar=51.3
Assess at a=0.05

1. Parameter of interest; mean burning rate: µ


2. State the null hypothesis: H0:µ=50
3. Specify an appropriate alternative hypothesis: H1:µ≠50
Example 9-2: Aircraft escape systems
x - µ0
4. Test statistic Z0 =
s/ n

5. Reject Ho if: p-value is less than 0.05


x − µ 0 51.3 − 50
6. Computations Z0 = = = 3.25
σ/ n 2 / 25

7. Conclusion
p − value = 2[1− Φ(3.25)] = 0.0012

We will reject Ho:µ=50 at the 0.05 level of


significance and conclude that the mean burning
rate differ from 50 cm/sec.
Recap of Section 9.1 & 9.2

> Hypothesis Testing


– Two-sided (Ho:µ=50; Ha:µ≠50)
– One-sided tests (Ho:µ=50; Ha:µ<50)
> Types of Errors
– Type I: reject null hypothesis when it’s really true, a
– Type II: fail to reject null hypothesis when it’s really false, b
> P-values
– The smallest level of significance that would lead to
rejection of the null hypothesis Ho with the given data.
Mean Age for Students in INDE 315
• Assume that the mean age of students in INDE
315 is as follows:

µ = 25.6
σ = 3.1

10 15 20 25 30 35 40

Student Age
Let’s say we have a random sample of
5 students (n1=5)
Mary: X1=32 Bob: X2=40 Terry: X3=33
Ronald: X4=30 Susan: X5=38 yrs old
H0 : µ = 25.6

Are these students


from INDE 315? µ = 25.6
σ = 3.1
α 2 α 2

10 15 20 25 30 35 40

Student Age
Let’s say we have a random sample of
5 students (n1=5)
Mary: X1=32 Bob: X2=40 Terry: X3=33
Ronald: X4=30 Susan: X5=38 yrs old
H0 : µ = 25.6

Are these students


from INDE 315? Reject Reject
DO NOT reject

α 2 α 2

10 15 20 25 30 35 40

Student Age

Type I: reject null hypothesis when it’s really true, a


a=P(Type I error)=P(reject Ho when Ho is true)
Mary: X1=32 Bob: X2=40 Terry: X3=33
x = 34.6
Ronald: X4=30 Susan: X5=38
s = 4.22
H0 : µ = 25.6 H1 : µ ≠ 25.6

INDE 315 CEE 584

X = 34.6
Reject Ho

10 20 30 40 50

Student Age

However, we may be wrong in our conclusion => Type I error


Let’s say we have second random
sample of 5 students (n2=5)
Lisa: X6=31 Marissa: X7=28 John: X8=29
Susie: X9=27 David: X10=24

Are these students Sample 2


from INDE 315? x 2 = 27.8
s2 = 2.59
a=P(Type I error)=P(reject Ho when Ho is true)
Sample 2
H0 : µ = 25.6 H1 : µ ≠ 25.6
x 2 = 27.8
s2 = 2.59

X = 27.8
DO NOT
Reject Ho

10 20 30 40 50

Student Age

Type II: fail to reject null hypothesis when it’s really false, b
b=P(Type II error)=P(fail to reject Ho when Ho is false)
Inference on the Mean of a Population,
Variance Known

• Hypotheses: H0: µ=µo H1: µ ≠µo Two-sided

• Test Statistic: x - µ0
Z0 =
s/ n
• Significance Level, a
• Rejection Region:
Two sided test: Zo < -Za/2 or Zo > Za/2
One sided test: (lower) Zo < -Za
For one-sided, only pick one
(upper) Zo > Za
9-2.2 Type II error
H 0 : µ = µo <= Suppose this is false
H1 : µ ≠ µ o The true mean is actually: µ = µo + δ
x − µ0
If Z 0 =
σ/ n
x − µo + δ − δ
We can account for d: Z o =
σ/ n
x − µo − δ δ
Rearranging, gives us: Z o = +
σ/ n σ/ n

⇒ Zo =
(
x − µo + δ )+δ n
σ/ n σ
9-2.2 Type II error

x − µ0 This is a normal distribution


Z0 =
σ/ n denoted as N(0,1)

Zo =
(
x − µo + δ )+δ n This is a normal distribution
σ/ n σ denoted as: ! δ n $
N# ,1&
" σ %
Type II error for a 2-sided test
Type II: not rejecting the null hypothesis when it is false
H0 H1

δ n
N(0,1) N( , 1)
σ

− Zα 2 0 Zα 2 δ n σ

Pr (Type II error) = b

æ d nö æ d nö
b = Fçç Za - ÷ - Fç - Za -
÷ ç
÷
÷
è 2 s ø è 2 s ø 39
Type II error for a 1-sided test
Type II: not rejecting the null hypothesis when it is false

When true mean (µ) is GREATER than hypothesized mean (µ0)

𝛿 𝑛
𝛽 = Φ(𝑍! − )
𝜎
When true mean (µ) is LESS than hypothesized mean (µ0)

𝛿 𝑛
𝛽 = 1 − Φ(−𝑍! − )
𝜎

40
Type II error and sample size

æ d nö æ d nö
b = Fçç Za - ÷ - Fç - Za -
÷ ç
÷
÷
è 2 s ø è 2 s ø
Where b is the Type II error
Probability of accepting a lot of poor quality
=>Therefore, a smaller b is better
F the Z value needed (and whose probability can
be found in the Z table).
δ = µ − µo
Where µ=the true mean and
µ0 = the hypothesized41mean
Sample Size Formula
Zero
æ d nö æ d nö
b = Fçç Za - ÷ - Fç - Za -
÷ ç
÷
÷
è 2 s ø è 2 s ø
H0 H1

# δ n&
For δ > 0, β = Φ % Zα − ( N(0,1) N(
δ n
, 1)

$ 2 σ ' σ

( )
Φ −zβ
− Zα 2 0

So:β ≅ Φ (−zβ )
Zα 2 δ n σ

Let z β be the 100β upper percentile of the


standard normal distribution, then
δ n
−Z β = Zα −
2 σ
Type II error and sample size

> Two-sided alternative hypothesis


2 2

n≅
( α /2 β )
z + z σ
δ2
• One-sided alternative hypothesis
22

n≅
( α β)
z + z σ
δ2
Example 9-3a:
Propellant Burning Rate

True burning rate is 49 cm/sec. Find b.


Given: 𝛿 = −1, 𝑧!/#=1.96, 𝛼 = 0.05, 𝜎 = 2, 𝑛 = 25

æ d nö æ d nö
b = Fçç Za - ÷ - Fç - Za -
÷ ç
÷
÷
è 2 s ø è 2 s ø
!" #$ !" #$
𝛽=Φ 1.96 − #
− Φ −1.96 − #

𝜷=𝜱 𝟒. 𝟒𝟔 − 𝜱 𝟎. 𝟓𝟒 =1-0.705401=0.294599
The prob is ~0.30 that this difference from 50 cm/sec
WILL NOT be detected
Power of a Test

• The Power of a test of hypothesis is


given by 1 - b
• That is, 1 - b is the probability of:
– correctly rejecting a false null hypothesis, or
– rejecting the null hypothesis when the
alternative is true.

For this example: 1-b=0.70


And a sample size of 25 does not provide great
power
Example 9-3b: Sample Size

> Want to detect even if the true mean differs by as


much as 1 cm/sec with a high probability (1-
b=0.90)

Given (same): δ = 1, α = 0.05, σ = 2, n = 25


But also: β = 0.10 zβ = z0.10 = 1.28, zα /2 = 1.96
2 2 2 2
( zα /2 + zβ ) σ

(1.96 +1.28) (2)
≅ 42
n≅ 2
δ2 (1)
9-3 Inference on the Mean of a Population,
Variance Unknown

Hypothesis Testing
Hypotheses: H0: µ = µo H1: µ ≠µo (Two-sided)
H0: µ = µo H1: µ >µo OR H1: µ <µo (One-sided)

x − µ0
Test Statistic: T0 =
s/ n
Significance Level, a
Rejection Region:
One sided test: to > tα ,n−1
Two sided test: to > tα /2,n−1
to < −tα ,n−1
Confidence Interval for t

S S
x - ta , n -1
£ µ £ x + ta ,n -1
2 n 2 n

This indicates the 100(1-a)% two sided


confidence interval on the true mean

If a=0.05, we are 95 % confident that the true


mean lies within these parameters.
Example 9-6 Golf Club Design
Let Xi be the coefficient of restitution
measured for n=15 drivers
0.841 0.819 0.818 0.813 0.875
0.858 0.853 0.848 0.828 0.798
0.804 0.873 0.828 0.836 0.866
Is there evidence that the mean coefficient of
restitution exceeds 0.82?
Example 9-6 Golf Club Design
1. Parameter of interest;
Mean coefficient of restitution µ

2. Null hypothesis: H0:µ=0.82


3. Alternative hypothesis: H1:µ>0.82
4. Test Statistics: x −µ 0
t0 =
s/ n
Example 9-6 Golf Club Design

5. Reject Ho if: P-value is less than 0.05


x − µ0
6. Computations t0 =
s/ n
Example 9-6 Golf Club Design
0.841 0.819 0.818 0.813 0.875
0.858 0.853 0.848 0.828 0.798
0.804 0.873 0.828 0.836 0.866
15

∑x i
(0.841+ 0.819 +... + 0.866)
i=1
x= = = 0.837
15 15
15

∑( x − x )
i
(0.841− 0.837)2 +... + (0.866 − 0.837)2
s2 = i=1
= = 0.000603
15 −1 15 −1

s = s 2 = 0.02456
Example 9-6 Golf Club Design
6. Computations
x − µ 0 0.83725 − 0.82
t0 = = = 2.72
s/ n 0.02456 / 15

0.4
7. Conclusions
0.3
dt(x, 14)

Compare to P − value : 0.2

t0.05,14 = 1.761
0.1

t=2.72
0.0

-4 -2 0 2 4

x
We will reject Ho:µ=0.82 at the 0.05 level of significance and
conclude that the mean coefficient of restitution differs from
0.82
9-4 Inference on the Variance of
a Population (Normal Distribution)

Hypothesis Testing
Hypotheses: Ho: s2=so2 H1: s2≠so2
2
2 (n - 1) s
Test Statistic: co = 2
so
Significance Level: a/2 (upper) or 1-a/2 (lower)

Rejection Region: co2>c2a/2,n-1 or co2<c2 1-a/2,n-1

54
Confidence interval for true variance

(n - 1) s 2 (n - 1) s 2
£s2 £
ca2 2, n -1
c2 a
1- , n -1
2

This indicates the 100(1-a)% two sided


confidence interval on the true variance

If a=0.05, we are 95 % confident that the true


variance lies within these parameters.

55
Problem 9-84

[From Exercise 8-56], sample standard deviation


from 15 measurements was 0.0083 grams.

(a) Does the measurement sd differ from 0.01 gms


at a=0.05? Find the p-value for this test.
(b) Discuss how part (a) could be answered by
constructing a confidence interval on s.
(a) Ho: s2=0.012
H1: s2≠0.012

We know that n=15 and s=0.0083, test at a=0.05

(n - 1) s 2 (15 −1)(0.0083) 2
c o2 = = 2
= 9.6446
s o2 (0.01)

Compare to values in Table IV (Chi-squared


Distribution):
Two-sided test
2
χ 0.025,14 = 26.12
2
χ 0.975,14 = 5.63
(a) Ho: s2=0.012
H1: s2≠0.012
Two-sided test
2 (15 −1)(0.0083)2 2
χ 0.025,14 = 26.12
χ =
o 2
= 9.6446
(0.01) 2
χ 0.975,14 = 5.63

9.64

5.63 26.12

0 10 20 30 40

Therefore, we fail to reject Ho and conclude that there is not


enough evidence to say that the std. dev. differs from 0.01
(a) Find the P-Value
Computed χ o2 = 9.6446

9.6446
0.50<P-value<0.90
=>Interpolate 9.64

0.50 13.34
5.63 26.12
x 9.6446
0.90
0.10 7.79 0 10 20 30 40

Solve for x Multiply by 2


(b) Discuss how part (a) could be answered by
constructing a confidence interval on s.

(n - 1) s 2 (n - 1) s 2
£s2 £
ca2 2, n -1
c2 a
1- , n -1
2
14(.0083) 2 14(.0083) 2
≤σ 2 ≤
26.12 5.63
0.00003692 ≤ σ 2 ≤ 0.0001713

0.00003692 ≤ σ 2 ≤ 0.0001713

0.00608 ≤ σ ≤ 0.01308

You might also like