Академический Документы
Профессиональный Документы
Культура Документы
HYPOTHESIS TESTING
INTRODUCTION
ü sampling variability.
Step 1
State the
hypothesis, and
identify the claim.
Step 5 Step 2
Summarize the
Traditional Compute the test
results/ Conclusion method value.
Step 4 Step 3
Make decision Find the critical
whether to reject or value from the
not reject H0 appropriate able.
Step 5 Step 2
Summarize the results/
Conclusion
P-value state the p-value from
SPSS output
based
method
Step 4 Step 3
Make decision whether State the significance
to reject or not reject H0 level, α
H0: µ = k
H0: µ ≤ k
H0: µ ≥ k
H0: p = k
H0: p ≤ k
H0: p ≥ k
Null hypothesis must be accepted if the
alternative hypothesis is not accepted (failed to
reject) as a result of the hypothesis testing
Testing mean
Testing proportion
Example 2:
Formulate the null and alternative hypothesis.
A researcher at the Universiti Utara Malaysia is looking for
evidence to conclude that the average CGPA score for
entering freshmen is over 3.00.
F1. Jf-µ
Z= Use F1 test when σ is known
F2.
r,}i
r-µ
Z=Yi Use F2 test with , when σ is unknown and n ≥ 30
F3. 'f-µ
Use F3 test when
t=~
the population is normally or approximately normally
distributed,
With degree of
σ is unknown and sample size less than 30.
freedom = n-1
F4.
Use F4 test when and is satisfied
F5. Binomial
distribution Use F5 test when sample size is small and both and is not
satisfied
Step 3: Critical Value
Traditional method
Types of test
Z test t test
Two tailed
Noncritical Noncritical Noncritical
Critical
C ritical region region
region C ritical region Critic
Critical
region region region
-z 0 0 +z -z 0 +z
sig
One left tailed RR : [z < −zα ] RR : [t < −tα ] p = <α
2
sig
One right tailed RR: [z > zα ] RR : [t > tα ] p = 2<α
RR : z > zα RR : t > t
α
2
Two tailed 2 [ p = sig] < α
or RR : t < −tα
α
or RR : z < −z 2
2
Step 5 : Wording of Final Conclusion
H 0 : µ ≤ 170
H1 : µ > 170
178 −170
Z= = 2.4615
65
400
Step 3: Critical Value
§ If we look at the , the symbol use is (>) , which means one right tail test
§ Thus, the critical value is given by
Step 4: Decision
Rejection Region
1.6449 2.4615
There is enough evidence to reject because:
§ The statistical value is inside the rejection region or
§ The statistical test
Step 5: Conclusion
§ We have reject the , thus is true.
§ We can conclude that the new system is cost-effective at 5% significance level
Example 4:
-1.6449 +1.6449
Failed to reject H0
1.2816
Failed to reject H0
Example 7:
Failed to reject
Error and power of test probabilities
α = Pr (Reject H 0 | H 0 is true )
Type II error
Power of test
Hypothesis
testing for two
means
i. random
ii. independent
Table 2.4: Alternative and null hypothesis for difference of two means
Testing means
One-tailed, lower/ left
Vs
tail
One-tailed, upper/ right
Vs
tail
Two-tailed Vs
no yes
no yes
Are
no yes
Where Where
Figure 2.7: Guide for choosing correct statistical test for testing 2 independent means
Step 3: Critical Value
Two tailed
Step 4 : Decision Rule
Table 2.6 gives the rejection region for both traditional and
p-value based method
-z 0 0 +z -z 0 +z
.
Example 9:
Random samples of children sent to kindergarten aged 4
to 6 years in Bandar A and B were taken to find the
number of hours spend for outdoor activities in the
kindergarten daily. A sample of 321 children in Bandar B
and 94 children in Bandar A give the mean of 3.01 hours
and 2.88 hours, respectively. From past studies the
population standard deviation for the children in Bandar
B is assumed to be 1.09, while the population standard
deviation for the children in Bandar A is 1.01. At 95%
confidence interval, is there any difference between the
two population means.
Since t.v fall on the
acceptance region so,
failed to reject H0
.
Example 10:
A random sample of 22 male customers who shopped at
this supermarket showed that they spent an average of
RM80 with standard deviation of RM17.50. While a
random sample of 20 female customers who shopped at
the same supermarket showed that they spent an
average of RM96 with standard deviation RM14.40.
Assume that the amount spent at this supermarket by
all the male and female customers are normally
distributed with equal but unknown standard deviation.
Using the 1% significance level, can we conclude that
the mean amount spent by all male customers at this
supermarket less than by all female customers?
14.40
, . ,
Example 11:
Do government employees take longer coffee breaks
than private sector workers? That is a question that
interested a management consultant. To examine the
issue, he took a random sample of ten government
employees and another random sample of six private
sector workers and measured the amount of time (in
minutes) they spent in coffee breaks during the day. The
results are listed below.
Government Employees Private Sector Workers
23 25
18 19
34 18
31 22
28 28
33 25
25 21
27 21
32 20
21 16
H0: µd = k Vs H1: ≠ k
Where
Step 1
State the
hypothesis, and
identify the claim.
Step 5
Step 2
Summarize the Compute the test
results/ value.
Conclusion
Step 4 Step 3
Make decision Find the critical
whether to reject value from the
or not reject H0 appropriate able.
Left tail : - tα
RR : [t < −tα ]
tα
RR : [t > tα Right tail :
]
RR : t > tα Two tail :
2
Example 13:
1st Day 55 60 70 40 35 50
55 65 80 65 60 25
Last Day 75 95 85 75 70 85
90 90 100 95 100 60
Solution 13:
1st day 55 60 70 40 35 50 55 65 80 65 60 25
d 20 35 15 35 35 35 35 25 20 30 40 35
Solution 13:
1st day 55 60 70 40 35 50 55 65 80 65 60 25
d 20 35 15 35 35 35 35 25 20 30 40 35
Before 38 36 43 33 37 37 38
After 43 35 46 43 34 35 44
Example 15:
The personnel manager sends five salespeople to a “customer
service” training workshop to improve their job performance.
Based on the data, has the training made a difference in the
number of complaints? Use 10% significance level
Number of Complaints
Before training After training
6 4
20 6
3 2
0 0
4 0
Example 16:
Student 1 2 3 4 5 6 7 8 9 10
Before, X 22 20 20 14 17 20 24 18 23 20
After, Y 50 30 29 17 19 40 41 17 38 32
HYPOTHESIS TESTING FOR TWO PROPORTIONS
The difference between populations whose data are nominal
(i.e. categorical).
Step 1: Hypothesisstatement
where
x x
p̂ 1 = 1
n1
and p̂ 2 = 2
n2
Step 3: CriticalValue
Example 17:
Decision Rule:
üReject ; if p-value ≤ α,
üFail to reject ; if p-value > α.
üWhere, α is significance level.
During the last oil crisis, the government claimed that the average
car owner refilled the tank when there was more than 3 gallons left.
To check the claim, ten and fifteen cars were randomly selected as
they entered A and B petrol station respectively. The remaining
petrol was measured and recorded as follows:
Station A: 3, 5, 3, 2, 3, 3, 2, 6, 4 and 1
Station B: 3, 2, 4, 3, 4, 1, 2, 1, 3, 4, 1, 3, 1, 4 and 2
i. Ignoring the station where the samples were collected, test the
claim at 2% significance level.
Solution
Step 4: Decision
Since , failed to reject
Step 5: Conclusion
The claim that the average car owner refilled the tank when there was more than 3
is not true.
ii) Is there any difference in mean gallons of petrol left between cars
that entered Station A and Station B at 2% significance level?
Step 1:
(Variances are not equal)
(Variances are equal)
Step 2:
Step 3:
Significance level:
Step 4:
Since , failed to reject
Step 5:
The variances for both stations A and B are equal.
2. Test the hypothesis about the means
Step 1:
question: is there any difference in mean gallons of petrol left
between cars that entered Station A and Station B
Thus:
Step 2:
Step 3:
Significance level:
Step 4:
Since , failed to reject
Step 5:
There is no difference in mean gallons of petrol left between cars
that entered Station A and Station B.
Example 20: One sample
A Professor claims that the average score on a recent
exam was 83. Assume that the test scores are normally
distributed. You ask some people in class how they did,
and you record the following scores: 82, 77, 85, 76, 81,
91, 70, and 82. Suppose you want to test whether the
professor’s statement was correct. Use .
One-Sample Test
Test Value = 83
95% Confidence
Interval of the
Mean Difference
t df Sig. (2-tailed) Difference Lower Upper
SCORE -1.122 7 .299 -2.500 -7.77 2.77
Solution
Step 4: Decision
Since p-value > α failed to reject
Step 5: Conclusion
The professor’s statement was correct
Example 21 : Paired-Samples
In a recent survey, college students were asked the amount of
time (in hours) they spend weekly watching television and
surfing on the Internet. The researchers were interested in
determining whether the time spent on both activities was
equal. They collected the following data:
Person 1 2 3 4 5 6 7 8
Internet 2 7 3 8 9 15 7 2
TV 4 15 5 3 4 4 4 8
Do you have reason at the 10% significance level to believe
that students spend the same amount of time watching
television as they do on the Internet?
Paired Samples Test
Paired Differences
95% Confidence
Interval of the
Std. Error Difference
Mean Std. Deviation Mean Lower Upper t df Sig. (2-tailed)
Pair 1 internet - tv .750 6.364 2.250 -4.570 6.070 .333 7 .749
Solution
Step 4: Decision
Since p-value > α, failed to reject
Step 5: Conclusion
We conclude that students spend the same amount of time watching
television as they do on the Internet.
Example 22: Independent Sample T Test
Do government employees take longer coffee breaks than private
sector workers? That is a question that interested a management
consultant. To examine the issue, he took a random sample of ten
government employees and another random sample of ten private
sector workers and measured the amount of time (in minutes) they
spent in coffee breaks during the day. Based on the SPSS output,
do these data provide sufficient evidence at the 5% significance
level to support the consultant’s claim?
One-Sample Statistics
Std. Error
N Mean Std. Deviation Mean
calories 15 137.3333 24.11777 6.22718
One-Sample Test
Paired Differences
95% Confidence
Interval of the
Std. Std. Error Difference Sig.
Mean Deviation Mean t df (2-tailed)
Lower Upper
Pair 1 Course2 -
.90000 1.37032 .43333 -.08027 1.88027 2.077 9 .068
Course1
SPSS NOTES FOR TESTING MEAN(S)
~ ~
O Untitled · SPSS Dala Editor
..llill BI ~ ...,
I
,· , ~ 1n
l lI~·:
11 r1 ca; r.
I
,, I
NameI
r Type
Values
Label
Width
I Decimals J gallons None
1!1 . station a!···
Ne
UNc
1 petrol Numeric 8 0 remaining
petrol in
2 station Numeric 8 0 two ditferent
station
3
t -i
Da a v ew
O Untitled · SPSS Datd Editor
Filo Eclt - Dot• Tranoform """"1,e I
Grac,h
'
14
• I
, I
petrol In-
1
(
.,
2 5 t ~
3 3 1
4 2
5 3 1
6 3 t
7 2 1
..
-
8 6 t ..
-9 4 t
10 1
1
11 3 2
12 2 2
13 4 2
Step 2: data analysis (for question 1)
q Choose analyze compare means one-sample T
test…
1
~1.1~ ~ 1<>1"~
14 .1
: . Means ..
1 etrol 1 station
l
Gener
l
a Linear Mode • l One-
.
Samp
i e T Test ...
1
Samples T Test ..
3
l. M xed Mode s • ..
.
Independent-
5
Correlate • Paired-Samples T Test ..
2
3 3
i
Regression
i Logl near
• One·Way ANOVA .
•i •
4 2 Class fy •
5
6
3
3
i
Data Reduct on
Scale
••
7 2 Nonparametric
l Tests
8 6 l Ser es
Time •
9 4
i
Surviva
Mu t ple Response
•
10 1 •
11 3 2
Step 3: The following window will appear
• One- T Test (R
Sample
~ two different station Test Variable( s J: O
J
I
[st remaining petrol in K
gallo Past J
e
Rese
t
I
Cance
l
I
Hel I
I
p
Test Value: Options J
...
I~
q Click on the button into Test Variable box.
q In Test Value box : type the value, eg : 3 ( refer to
question/problem statement).
q Click options if you need to change the significant level.
q Click on OK and the output is as below.
---,-
+T-Test
One-Sm11111e Statistics
Std. Error
N Mean Std.
De'liation Mean remaining petrol
in gallons 25 2.80 1.323 .265
One-Sample
Test
TestValue=
3
95%
Confidenc
e lnteival
In gallons - 24 .457 -.200 -.75
ofthe .35
.756 Difference
Mean
t df Sig. (2-tailed) Difference Lower
Upper
remaining petrol
Step 4: data analysis for question 2 (two independent
mean)
q Choose analyze compare means Independent-
samples T test…
~llilB
l ~ I ,n ·
l I Means ...
Genera linear Modell l
One-Samp e T Test ..
etrol station
•
. l .
r
1 3 Mixed Models
i
• Independent-Samp esT
l
Test .. l
2 5
Corre ate
.
• One-Way
Pa red-Samp es T Test ..
3 3
Re11ression
i • ANOVA...
Logl near
•i
4 2 Classify •
5 3 Data Reduct on •
6 3 Scale •
7 2 Nonparametric Tests •
B 6 i l
l
Time Series •
9 4 Surviva
Mult p e Response
•
10 1 •
11 3 2
Step 5: The fo llowin g window will appear
• C lick on he
t app or priate variable (i.e the petrol data be the test variable)
• C lick on he
t button into Test Variable box.
t app or priate variable (i.e station as the grouping variable)
• C lick on he
• C lick on he
t button into Grouping Variable box.
Click on De fine Grou p.
Specify the values
Group 1 : 1
Group 2 : 2,
Click on Continue
y remairw,g petrol II
galo
D Define [E
Groups
Click on )
Define
(." Use speci(red V8.IM I
Groups stat ?l
Group
Com,ue
11 I 1: Cancel
Define Gr<J<-l)S..•
Group 2: r::12-- Help I
!
Opeiont...
2
c eut point I
? ?
Click on OK and the output is as below.
One-Sample Test
Test Value= 3
95%
Confidence
lnlerval of
t df Sig. (2-tailed) Ditrerence Lower the
ueoer
Mean Ditrerence
rema
I ning n -.756 24 .457 ·.200 -.75 .35
gallons
i pelrol
-+ T-Test
Grou11 Statistics
Std.
rema Error two different station N Mean Std. Deviation
ning n Mean
i gallonspetrol station a 10 3.20 1.476 .467
i station b 15 2.53 1.187
.307
Levene's Testfor
Equality of Variances t-
testfor E
Equal variances
Example 26:
Variab le V iew
::i llww SPSS ll•to I d1101 .;;
~l g! a! ~ 1t..
· fg1 .!..!I
I 0
! r'-
! . iCl ;t; r. 1
I ,1'0 ! ValuH Min ~ ,..._,..
N~:.!
Wiclh OKI l.lkl fM' ""
Noo
"-
N-
Let
R~hl Sult
,3 e ll'91
°"'
""
M St.ll,e
Numtnc 8 0 N~ olCo..,., 'v 0..:ncl ~!.-. P'"9 No
Num1'IC 8 0 NO ol~t •r 0®1Cl tlltt M
11
P109U °"'
t i
Da a V ew
matched control
bject must be in the
same case.
....
I ... , A The
di rte
su
14
2
26 1
3C
AO
~I
s
3
6
I
5E 17 8
6 f 12 13
7G 8 3
Step 2: Data Analysis
l tA nalyze Menu → Select Compare Means
• Se ec
• C lick on Paired samples T-test.
• C lik on Both Variable → Click on the button into Paired Variable box.
Difference= before-after
• P•1••d S,,mplH
Tr.,,
<t
~tlocfO-.~O..,
~llodCNou..,.o -«
or. I
POile j
'*- I
~
.."'
I
• Click on OK and the output is as below.
Confidence
Paired Samples Test Interval
Paired Differences
p-value
95% Confidence
Interval of the
Difference
Std. Error
Mean Std. Deviation Mean Lower Upper t df Sig. (2-tailed)
Pair No of Crimes by
1 District before program
- No of Crimes by 3.625 4.838 1.711 -.420 7.670 2.119 7 .072
District after program
Difference= before-after
Solution
Step 4: Decision
Since p-value > α , failed to reject H0
Step 5: Conclusion
We have not enough evidence to support that there has
been a decrease in the number of crimes since the
implementation of the program.
SUMMARY
Hypothesis testing has several elements which
are null and alternative hypothesis, significance
level or rejection region, statistical test value or p
value and test decision.
END OF CHAPTER 2