LECTURE 8.Pptx Edited - PPTX Sem 1 2022 - 2023

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 56

LECTURE 8

Inference About
a Population: Hypothesis
Testing
(ONE SAMPLE TESTS)
Estimation: determine the unknown value of
a population parameter on the basis of a
sample statistic.

Hypothesis testing : is a procedure based on sample data and


probability theory to evaluate a claim about the population
parameter (we proceed to hypothesis testing to verify the
population estimation that we calculate using the sample
(Lecture 7)
6 Steps of Hypothesis Testing Procedure

S.1 State the null & alternative hypotheses

S.2 Select the significance level

S.3 Compute the test statistic

S.4 Formulate a decision rule

S.5 Make the statistical decision

S.6 State the conclusion of the test


S.1 : State the null & alternative hypotheses
A pair of competing statistical hypotheses consists of:

 Null Hypothesis denoted with H0

 Alternative Hypothesis denoted with H1


What is H0 and H1 ?
The Null Hypothesis, H0
A statement about the value of a population
parameter.
Important: Is always about a population parameter,
not about a sample statistic
Example: You want to test the claim that the average
diameter of a manufactured bolt is 30mm

H 0 : μ  30 H 0 : X  30

Null always contains “=“sign


May or may not be rejected
The Alternative Hypothesis, H1
A statement that is accepted if null hypothesis is
false.
Is the opposite of the null hypothesis

H1 : μ  30

Alternative never contains the “=”sign


May or may not be proven
Is generally the hypothesis that the researcher is
trying to prove
Type of Hypothesis Testing
Refer to Lecture 7, we have estimate the mean for
population in two situation where: is known and (ii)
is unknown.
We also estimate the population proportion (p)
So we will proceed the hypothesis for both mean for
population (both cases) and population proportion.

There are two types of hypothesis testing:


 One tail hypothesis testing (the H1 is denoted with the symbol
< or >)
 Two tail hypothesis testing (the H is denoted with the symbol
1
≠)

The H1 is denoted with the symbol < or >

One-tail test

H0 :  = 0 H0 : p = p0
Three H1 :  > 0 H1 : p > p0 Three
possible possible
statistical H0 :  = 0 H0 : p = p0 statistical
hypotheses H1 :  < 0 H1 : p < p0 hypotheses
to test a to test a
population Two-tail test population
mean proportion
H0 :  = 0 H0 : p = p0
H1 :   0 H1 : p  p0

The H1 is denoted with the symbol ≠


EXERCISE 1

For each of the following pairs of null and alternative


hypotheses, determine whether the pair would be appropriate
for a hypothesis test. If a pair is deemed inappropriate,
explain why.

a) H0 :  = 90 ; H1 :   90

b) H0 :  = 0.55 ; H1 :  > 0.65


EXERCISE 1

c) = 58;  58

d)  0.48 ; = 0.48

e) H0 : p = 1.25 ; H1 : p < 1.25


EXERCISE 2

For each of the following statements, formulate appropriate


null & alternative hypotheses.

a) The average college student spends more than


RM500 per semester at the university’s bookstore.

b) The proportion candidate passing on the qualifying


exam differs from 0.33.
EXERCISE 2

c). The proportion adult drinks 2 cups of coffee per


day is less than 0.62.

d). The average SAT score for entering freshmen is


equal to 1200.
EXERCISE 2

c) The proportion adult drinks 2 cups of coffee per day


is less than 0.62.

d) The average SAT score for entering freshmen is not


equal to 1200.
How to Reject H0 OR Fail to Reject H0
We can use two method to make decision whether to
reject H0 or Fail to reject H0 :

 use rejection region method

 use p value method


S.2 : Select the significance level
 The significance level,  is the maximum
probability of rejecting a true H0.

 In practice, significance level is set at 1% (0.01),


5% (0.05) or 10% (0.10).

 By selecting the significance level, then you may get


the critical value for the test statistics in order to
determine the border for rejection region and non
rejection region.
 Important:
 one tail test ----- just use the  that selected
 Two tail test ------ must divide  with 2 (/2) because
we have two tail.
S.3 : Compute the test statistic

 Test Statistic is a value, calculated from sample data,


used to determine whether or not to reject the H0.

 For the tests of this topic, the test statistic will be


either Z * or t*, corresponding to the standard normal
and t distributions, respectively.
S.4 : Formulate a decision rule

 Critical value is the dividing point between the


rejection and non-rejection region for the H0

 The rejection region is a range of values such that if


the test statistic falls into that range, the H0 is
rejected.

 The rejection region of the H0 is stated as a decision


rule.
This slide
explain the
The Test Statistic and
S. 2, S.3 &
S.4
Critical Values
Sampling Distribution of the test statistic

Region Region
of of
Region of Rejection
Rejection
Non-
Rejection
You may get the
critical values by
Critical Values
refer to the If the test statistics Z* or
statistical table t* is located here, then
you reject H0
S.5 : Make the statistical decision

 If the test statistic falls in the rejection region, H0 is


rejected.

 If the test statistic does not fall in the rejection


region, H0 is not rejected.

 Failure to reject H0 DOES NOT constitute proof that it


is true, but rather that we are unable to reject it at the
significance level being used for the test.

Therefore, we NEVER say Accept H0


S.6 : State the conclusion of the test

 If H0 is rejected, there is enough statistical


evidence to support or infer that the H1 is true.

 If H0 is not rejected, there is not enough statistical


evidence to support or infer that the H1 is true.
Possible Errors in Hypothesis Test Decision
Making
Type I Error
Reject a true null hypothesis
Considered a serious type of error
The probability of a Type I Error is 

 Called level of significance of the test


 Set by researcher in advance

Type II Error
Failure to reject a false null hypothesis
The probability of a Type II Error is β
Possible Errors in Hypothesis Test Decision
Making
Possible Hypothesis Test Outcomes

Actual Situation

Decision H0 True H0 False

Fail to No Error Type II Error


Reject H0 Probability 1 - α Probability β
Reject H0 Type I Error No Error
Probability α Probability 1 - β
Example:
You want to test the claim that the average diameter of a
manufactured bolt is 30mm.
Hypothesis
H 0 : μ  30
H1 : μ  30
o Explain the Type 1 error

o Explain the Type II error


Example
Explain the Type 1 error
o Recall: type I error occur when you REJECT the TRUE
H0
o The Type I error occur when the you make a claim that
average diameter of a manufactured bolt is not equal to
30mm but the fact that it is equal to 30mm.

Explain the Type II error


o Recall: type II error occur when FAIL TO REJECT the
FALSE H0
o The Type II error occur when the you make a claim that
average diameter of a manufactured bolt is equal to
30mm but the fact that it is not equal to 30mm.
EXERCISE 3
Business Week reported that at the top 50 business schools,
students studied an average of 14.6 hours per week.

Set up a hypothesis test to try to prove that the mean


number of hours studied at your school is different from the
14.6-hour-per-week benchmark reported by Business Week.

a) State the null and alternative hypotheses.

b) What is a Type I error for your test?

c) What is a Type II error for your test?


HOW TO PROCEED HYPOTHESIS
TESTING?
 We will proceed the hypothesis testing for:

 Population mean

 Population proportion
Hypothesis Tests for the Population Mean
Assumptions:
(i) population is normally distributed
(ii) If the population is not normally distributed then use n ≥ 30 (central limit
theorem)
Remember Lecture 7
where we discuss two Hypothesis
same cases Tests for 

 Known  Unknown
(Z test) (t test)

The test statistic is: The test statistic is:


X μ X μ
ZSTAT  t STAT 
σ S
n n
Hypothesis Testing for µ : is
known
Test the claim that the true mean diameter of a manufactured
bolt is 30mm..
(Assume σ = 0.8; n = 100 )

S.1. State the appropriate null and alternative hypotheses


 H : μ = 30
0

 H1: μ ≠ 30 (This is a two-tail test)

S.2. Select the significance level


assume :  = 0.05
Hypothesis Testing for µ : is
known
S.3 : Compute the test statistic

X  μ 29.84  30  .16
ZSTAT     2.0
σ 0.8 0.08
n 100

S.4 : Formulate a decision rule


- refer to Z distribution table to determine the critical value.
- must divide by 2 because we proceed with two tail test :
/2 = 0.05/2 = 0.025
- Find Z0.025 = ±1.96 (refer to next slide)
S.4 : Formulate a decision rule
Is the test statistic in the rejection region?

/2 = 0.025 /2 = 0.025

Decision Rule:
Reject H0 if Reject H0 Do not reject H0 Reject H0

-ZSTAT < -1.96 or -Zα/2 = -1.96 0 +Zα/2 = +1.96


ZSTAT > 1.96;
otherwise Fail to Here, ZSTAT = -2.0 < -1.96, so the test
reject H0
statistic is in the rejection region
S.5 : Make the statistical decision

 = 0.05/2  = 0.05/2

Reject H0 Do not reject H0 Reject H0

-Zα/2 = -1.96 0 +Zα/2= +1.96


-2.0
Decision: REJECT the null hypothesis because - ZSTAT = -2.0 < -1.96
S.6 : State the conclusion of the test
Conclusion: There is enough statistical evidence that the mean diameter of
a manufactured bolt is not equal to 30
t Test of Hypothesis for the
Mean (σ Unknown)
 Convert sample statistic ( X ) to a tSTAT test statistic
Hypothesis
Tests for 

σKnown
Known σUnknown
Unknown
(Z test) (t test)
The test statistic is:

X μ
t STAT 
S
n
Example: Two-Tail Test
( Unknown)
The average cost of a hotel room in
New York is said to be $168 per
night. To determine if this is true, a
random sample of 25 hotels is taken Extract the info
and resulted in an of $172.50 and S from the question
of $15.40. Test the appropriate to ease you:
hypotheses at  = 0.05.
S = $15.4
(Assume the population distribution is normal)
n = 25
a = 0.05
 is unknown so
use t-test
Example Solution:
Two-Tail t Test
H0: μ = 168 a/2=.025 a/2=.025
H1: μ ¹ 168
a = 0.05 Reject H0 Do not reject H0 Reject H0
-t 24,0.025 0
t 24,0.025
n = 25, df = 25-1=24 -2.0639 2.0639
1.46
 is unknown, so
Xμ 172.50  168
use a t statistic t STAT    1.46
S 15.40
Critical Value: n 25
Decision: Do not reject H0 because t stat (1.46) < t0.025, 24 (2.0639).
±t24,0.025 = ± 2.0639
Conclusion: There is not enough statistical evidence that the
average cost of a hotel room is equal to true $168
How to Perform One-Tail Tests
In many cases, the alternative hypothesis focuses
on a particular direction
This is a lower-tail (refer to symbol <) test
since the alternative hypothesis is focused
H0: μ ≥ 3
on the lower tail below the mean of 3
H1: μ < 3

H0: μ ≤ 3 This is an upper-tail (refer to symbol >) test


since the alternative hypothesis is focused on
H1: μ > 3 the upper tail above the mean of 3
Example: Two-Tail Test
( Unknown)
The average cost of a hotel room in
New York is said to be $168 per
night. To determine if this is true, a
random sample of 25 hotels is taken Extract the info
and resulted in an of $172.50 and S from the question
of $15.40. to ease you:
Test the hypotheses that the average
cost of a hotel room is greater than S = $15.4
$168 at  = 0.05. n = 25
a = 0.05
(Assume the population distribution is normal)  is unknown so
use t-test
Example Solution:
One-Tail t Test (Right Tail)
H0: μ = 168 a=0.05
H1: μ > 168
a = 0.05 Do not reject H0 Reject H0
0
t 0.05,24
n = 25, df = 25-1=24 1.711
1.46
 is unknown, so
Xμ 172.50  168
use a t statistic t STAT    1.46
S 15.40
Critical Value: n 25
Decision: Do not reject H0 because t stat (1.46) < t0.05, 24 (1.711).
±t0.05,24 = +1.711
Conclusion: There is not enough statistical evidence that the
average cost of a hotel room is greater than $168
emember:
o need to
vide by 2
ecause we
erform the one
l test
Hypothesis Tests for Proportions
Involves categorical variables
Fraction or proportion of the population in the
category of interest is denoted by p
Sample proportion in the category of interest is
denoted by
X number in category of interest in sample
p̂  
n sample size
Hypothesis Tests for Proportions
 When np ≥ 5 and n(1 – p) ≥ 5, the normal
distribution is considered to be a good approximation
The sampling distribution of p is approximately
normal, so the test statistic is a ZSTAT value:

p̂  p
ZSTAT 
p (1  p )
n
Remember:
p is population proportion
is sample proportion
Example: Z Test for Proportion
A marketing company
claims that it receives
responses from 8% of
those surveyed. To test
this claim, a random Extract the info from the
sample of 500 were question to ease you:
p
surveyed with 25 = 25/500 = 0.05
responses. Test at the  = n = 500
0.05 significance level. a = 0.05
Z Test for Proportion: Solution
6 Steps of hypothesis testing
S.1
H0: p = 0.08 S.3 Test Statistic:
H1: p ¹ 0.08 p̂  p .05  .08
Z    2.47
S.2 STAT
p (1  p ) .08(1  .08)
a = 0.05
n = 500, = 0.05
n 500
S.4 S.5 Decision:
Critical Values, Z0.05/2 = Z0.025: ± 1.96 Reject H0 because - ZSTAT < -Z0.025 or
Reject Reject
-2.47 < -1.96
.025 .025 S.6
Conclusion:
-1.96 0 1.96 z There is no enough evidence to accept the
-2.47 company’s claim that it receives 8%
response rate.
MORE EXAMPLE: EXAMPLE 1

The manager of a department store is thinking about establishing a


new billing system for the store’s credit customers. After a thorough
financial analysis, she determines that the new system will be cost-
effective only if the mean monthly account is more than $170.

A random sample of 400 monthly accounts is drawn, for which the


sample mean is $178. The manager knows that the accounts are
approximately normally distributed with a standard deviation of $65.

Using the  = 0.05 level of significance, can the manager conclude


from this that the new system will be cost-effective?

Informations from the question:


µ = $170; = $178; = $65; n = 400;  = 0.05
Notes that is known so proceed with Z statistic.
S.1 H0 :  = 170 vs. H1 :  > 170

S.2  = 0.05
178 −170
S.3 ¿
Test statistic : Z * 65 / √ 400 = 2.46

S.4 Critical value : Z0.05 = 1.6449

S.5 Reject H0 because Z * > 1.6449

S.6 There is enough evidence for the manager to conclude


that the new system will be cost-effective
MORE EXAMPLE : EXAMPLE 2

A courier service advertises that its average delivery time is


less than 6 hours for local deliveries. A random sample of times
for 12 deliveries to an address across town was recorded.
These data are shown here.

Is there sufficient evidence to support the courier’s


advertisement, at the 10% level of significance. Assume that
the delivery time is normally distributed.
3.03 6.33 6.50 5.22 3.56 6.76
7.98 4.82 7.96 4.54 5.09 6.46
Summary : x  5.69 ; s = 1.58
S.1 H0 :  = 6 vs. H1 :  < 6

S.2  = 0.10
5.69 −6
¿
S.3 Test statistic : t 1.58/ √ 12 = -0.68
*

S.4 Critical value : -t0.10, 11 = -1.363

S.5 Do not (Fail to) reject H0 because -t* > -1.363

S.6 There is not enough statistical evidence to support the


courier’s advertisement.
MORE EXAMPLE: EXAMPLE 3

It has been claimed that 60% of homeowners would prefer to


heat with electricity instead of gas. A study finds that 65% of
300 homeowners prefer electric heating to gas.

At the 0.05 level of significance, can we conclude that the


percentage who prefer electric heating may differ from 60%?

Information from the question:

p = 0.6

n = 300
S.1 H0 : p = 0.6 vs. H1 : p  0.6

S.2  = 0.05
0.65 − 0.6
S.3 Test statistic : Z ¿
*
= 1.77

√0.6( 0.4)
300

S.4 Critical value :  Z0.025 =  1.96

S.5 Do not reject H0 because Z * < 1.96

S.6 There is not enough statistical evidence to conclude


that the percentage who prefer electric heating may differ
from 60%.

You might also like