You are on page 1of 96

CHAPTER 2

HYPOTHESIS TESTING
INTRODUCTION

Why we should employ the method of hypotheses


testing?

ü sampling variability.

ü to make a statement (or claims)


regarding the value of population
parameter based on sample information.
Statistical hypothesis testing is a decision-making
process for evaluating claims about a population.

In hypothesis testing, the researcher must:


i. define the population under study,

ii. state the particular hypotheses that will be investigated,

iii. give the significance level,

iv. select a sample from the population,

v. collect the data,

vi. perform the calculations required for the statistical test,

vii. and reach a conclusion


Hypotheses concerning parameters
such as mean(s) and proportion(s) can
be investigated.

The z test and the t -test are used for


hypothesis testing concerning mean(s).
Methods of Hypotheses testing

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.

Figure 2.1: Flow chart for traditional method of hypothesis testing


Step 1
State the hypothesis,
and identify the claim.

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, α

Figure 2.2: Flow chart for p-value based method of


hypothesis testing
HYPOTHESIS-TESTING FOR MEAN AND
PROPORTION

Step 1 : Statement of a Hypothesis

A statistical hypothesis is a conjecture about a population


parameter which may or may not be true.

There are two types of statistical hypotheses for each


situation:

ü The null hypothesis: symbolized by H0,

• no difference between a parameter and a


specific value, or that there is no difference
between two parameters.
ü The alternative hypothesis: symbolized by H1,

§ existence of a difference between a parameter


and a specific value

Null hypothesis is the status quo, can be expressed in


one of these three forms:

ü Testing population mean

H0: µ = k
H0: µ ≤ k
H0: µ ≥ k

ü Testing population proportion

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

Null hypothesis is always about a population


parameter, not about a sample statistic
p

Alternative and null hypothesis can be express in one of


these 3 forms:
Table 2.1: Alternative and null hypothesis

Testing mean

One-tailed, lower/ left tail H0: µ ≥ k Vs H1: µ < k

One-tailed, upper/ right tail H0: µ ≤ k Vs H1: µ > k

Two-tailed H0: µ = k Vs H1: ≠ k

Testing proportion

One-tailed, lower/ left tail H0: p ≥ k Vs H1: < k

One-tailed, upper/ right tail H0: p ≤ k Vs H1: > k

Two-tailed H0: p = k Vs H1: ≠ k


.5-a .5-
\ a
a I
\ a
I
0 0 0
a. Form : b. FormHo1f: c. k
Hof1H: µa << k Hµa>:> k FormHof1:
ft t il Hµa:tailed
Two ≠t
Le a ed Right tailed
raphical view of one and two tailed test
Figure 2.3: G
est value is in the critical region on
A one-tailed - t ne side of the mean.
o
est value is in any one of the
A two-tailed - tcritical region located on both side
of the mean.
Common Phrases:
üGreater than, above, higher than, longer than,
bigger than, increased, exceed, well over, better
than

ü Less than, below, lower than, shorter than,


smaller than, decreased, reduced.

ü Greater than and equal, at least, not less


than.

ü Less than and equal, at most, not more than.

ü Equal to, exactly the same as, has not changed


from, is the same as.

ü Not equal to, different from, has change from, is


not the same as.
Example1:

The operations manager wants to know whetherthemeanisdifferentfrom350units.


We can rephrase this request into a test of the hypothesis:

• Our research hypothesis becomes:


H1: µ ≠ 350
• Thus, the null hypothesis becomes:
H0: µ = 350

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.

Officer Frank Poncherello of the California Highway Patrol


claims that the mean velocity of motor vehicles is in excess
of 80 mph.
The manager of the UNIBOOK bookstore claims that on
average, students spend less than RM250 per semester at
the university's bookstore.

The quality control manager claims that the production of


telephone ‘to be out of control’ when the overall rate of
defects exceed 2%.

The average Malaysian drinks seven cups of water


per day.

Full-time Ph.D. students receive an average salary of $12,


837 according to the U.S. Department of Education. The
dean of graduate studies at a large state university feels
that Ph.D. students in his state earn more than this.

A taxi company claims that its drivers have an average of at


least 12.4 years’ experience.
Step 2 : Statistical Test

Ø uses the data obtained from a sample to make a


decision about whether or not the null hypothesis should
be rejected.

Ø test value. (denoted by TV)

Ø 3 possible statistical test formulas for testing the


mean

Ø 2 possible statistical test formulas for testing the


proportion.

Ø The Central Limit Theorem


np(nnpns 1ˆ1xx)≥<−−−x 5µ5µ−ppp µ−≥<p55
tZZZ====
sσs pq
nnnn Table 2.1: Statistical test formula for mean and proportion
formula Required situation

For testing Mean

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

For testing proportion

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

The critical value(s) separates the critical region from the


non-critical region and it depends to the alternatives
hypothesis.

The critical or rejection region - the null hypothesis


should be rejected.

The non-critical or non-rejection region - the null


hypothesis
should not be
rejected.

Level of significance and a critical value (C.V) is


selected from a table for the appropriate test.
tzαα

Table 2.2: Critical value for testing mean and


proportion

Traditional method
Types of test
Z test t test

One left tailed - zα - tα

One right tailed zα tα

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

For H1 : µ < k For H1 : µ > k For H1 : µ ≠ k


Rejection region is in Rejection region is in Rejection region is
in the left side the right side both side

Note: in the picture above, C.V is denoted by +z and -z


Step 4 : Decision Rule

q In this step, we need to formulate correct wording


whether to reject or fail to reject such as:

“There is no sufficient evidence to reject .”


“There is enough evidence to reject .”

NOTE: we never say that we accept the null hypothesis

q Two-tailed test and one-tailed test


Table 2.3: Rejection Region of
Traditional method P-value based
Types of test
Z test t test method

 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

In this step, we need to formulate correct wording of final


conclusion based on decision we have made in step 4 such
as:

“There is no sufficient evidence to reject the claim . . . (original claim).”

“The sample data supports the claim that . . . (original claim).”

“There is no sufficient evidence to support the claim that . .(original


claim).”
Example3:

A department store manage determine that a new billin


r
system will be cost-effective s
only if the mean monthly g
account
is more than $170. The accounts are approximately
normally distributed
of 400 monthly withisa drawn,
accounts standard
fordeviation
which theofsample
$65.A
mean
$178. isCan
random sample
we conclud that the new syste will be cost-
effective at 5% esignificance m
level?
Solution
Step 1: Hypothesis Statement
§ It stated in this question that “… if the mean monthly account is more than $170”.
§ The mathematical expression is which belongs to alternatives
hypothesis. Thus, we can write the hypothesis as:

H 0 : µ ≤ 170
H1 : µ > 170

Step 2: Statistical Test


§ It stated in the question “The accounts are approximately normally distributed
with a standard deviation of $65”
§ The given value of standard deviation belongs to the population
§ Thus, we can use Z normal distribution to calculate the statistical test

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:

AT&T’s argues that its rates are such that customers


won’t see a difference in their phone bills between
them and their competitors. The mean and standard
deviation for all their customers are $17.09 and $3.87
respectively. They then sample 100 customers at
random and recalculate a monthly phone bill based on
competitor’s rates. The sample mean is $17.55.

Is there enough evidence to infer that there is no


difference between AT&T and competitor bills? Use
10% significance level.
1.1886

-1.6449 +1.6449

Failed to reject H0

There is no enough evidence to reject the


claim that is no difference between AT&T
and competitor bill.
Example 5:

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 cars
were randomly selected as they entered ABC petrol
station. The remaining petrol was measured and
recorded as follows: 3, 5, 3, 2, 3, 3, 2, 6, 4 and 1.

Assume that the amount of petrol remaining in the


tanks is normally distributed with a population
standard deviation of 1 gallon. Test the claim at 10%
significance level.
0.4285

1.2816

Failed to reject H0

There is enough evidence to reject the claim that is the


average the owner refilled the tanks when there was more
than 3 gallons left
Example 6:

A light bulb manufacturer guarantees that the mean


life of a certain type of light bulb is at least 750
hours. A random sample of 20 light bulbs has a
mean life of 745 hours with a standard deviation of
11 hours. Based on the information given, is there
enough evidence to reject the manufacturer’s claim?
Use 5% significance level.

Example 7:

The productions of certain models of telephones are


out of control if the overall rate of defects exceeds
4%. The quality control manager at one factory
claims that the productions of telephone at his
factory are out of control. A random sample of 150
telephones revealed that 9 of them are defective. Is
there any evidence to agree with the manager’s
claim at 5% significance level?
Reject

Failed to reject
Error and power of test probabilities

Hypothesis testing will give result either there is


evidence to reject or fail to reject.
is true

Since hypothesis testing is based on sample data,

is true is not true

Reject Type I Power of


Error Test

Failed to reject Type II


Correct
Decision Error

Figure 2.4: Types of error


Type I error

α = Pr (Reject H 0 | H 0 is true )

Type II error

β = Pr (Failed to Reject H 0 | H 0 is not true


)

Power of test

1 − β = Pr (Reject H 0 | H 0 is not true


)
Hypothesis testing for two means

There are two types of hypothesis testing under this part


as given in Figure 2.5.

Hypothesis
testing for two
means

difference between two mean difference


means of independent between two dependent
samples samples

Figure 2.5: Two types of hypothesis testing with two means


Hypothesis testing for two means of
independent samples

The two samples are independent samples when they are


not related to each other

Assumptions that need to be satisfied before hypothesis


testing can be done are:

i. random
ii. independent

Recall back : There are five (5) steps for the


hypothesis testing:

Step 1: Hypothesis statement


Step 2: Test Statistics
Step 3: Critical Value
Step 4: Decision
Step 5: Conclusion
Step 1 : Hypothesis statement

The alternative and null hypothesis can be express in one


of these 3 forms:

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

• Where k is a constant value. The k value can be equal to 0 or any


other values.
Left tailed Right tailed Two tailed

Figure 2.6: Graphical view of one and two tailed test


Step 2 : Statistical Test

There are 4 possible statistical test formulas for testing


the means

The Central Limit Theorem can be used to determine the


correct formula
Are both population variances known?

no yes

Variance unknown Variance known

Are both sample


sizes > 30?

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

The critical value(s) separates the critical region from the


non-critical region and it depends to the alternatives
hypothesis.

The same critical value as in testing one sample mean


are given in Table 2.5

Table 2.5: Critical value for testing means


Traditional method
Types of test Z test t test
One left tailed - zα - tα
One right tailed zα tα

Two tailed
Step 4 : Decision Rule

We need to decide whether to reject or fail to reject the null


hypothesis

Table 2.6 gives the rejection region for both traditional and
p-value based method

Table 2.6: Rejection Region of


Traditional method P-value based
Types of test
Z test t test method
 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 


    
Two tailed 2 2 [ p = sig] < α
t
or RR :  z < −z
α  or RR :  < −tα 2 

2
The decision can also be done based by looking at the
figure as given below.

Noncritical Noncritical Noncritical


Critical
C ritical region region
region C ritical region Critic
Critical
region region region

-z 0 0 +z -z 0 +z

For For For


Rejection region is in Rejection region is in Rejection region is
in the left side the right side both side
Step 5 : Wording of Final Conclusion

Formulate correct wording of final conclusion based


on decision we have made in step 4 such as:

“There is no sufficient evidence to reject the claim . . .


(original claim).”

“The sample data supports the claim that . . .


(original claim).”

“There is no sufficient evidence to support


the claim that . . . (original claim).”
Example 8:
Do employees perform better at work with music
playing? The music was turned on during the working
hours of a business with 45 employees. There
productivity level averaged 5.2 with a standard deviation
of 2.4. On a different day, the music was turned off and
there were 40 workers. The workers' productivity level
averaged 4.8 with a standard deviation of 1.2. Assuming
the sample is selected from a normally distributed
population, perform the appropriate test at 5%
significance level.
Since t.v < c.v so, failed
to reject H0

The performance of the


employees with music is
not better than without
music

.
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

The number of hours


spend for outdoor
activities in two
kindergarten are the
same

.
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

Since t.v < c.v so, reject


H0

Male is always spend less


than women in shopping

, . ,
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

Assuming both populations are approximately


normal with equal variances, do these data provide
sufficient evidence at the 5% significance level to
support the consultant’s claim?
Example 12:

The production planner wants to determine if the mean


of operating rates (% of capacity) for two factories are
the same. For factory 1, the rates are 71, 82, 77, 92,
and 88. For factory 2, the rates are 85, 82, 94, and 97.
Assuming the operating rates is normally distributed,
perform the appropriate test at 1% significance level
Hypothesis testing for
two means of dependent
samples

Matched pairs experiment

The steps can be summarize as in


the next slide:
RR : [t >< t−αtα]
RR :  t > tα 
]  2
H0: µd ≥ k Vs H1: µd < k
H0: µd ≤ k Vs H1: µd > k

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α ]

RR : [t > tα Right tail :
] 
RR :  t > tα Two tail :
 2 
Example 13:

A high school math teacher wanted to assess


student learning. Twelve students were given a
math test on the first day of the semester and their
scores were recorded. The students were given
an equivalent math test on the last day of the
semester. Did the students’ math scores increase?
Use α=0.01 to test the hypothesis.

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

last day 75 95 85 75 70 85 90 90 100 95 100 60

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

last day 75 95 85 75 70 85 90 90 100 95 100 60

d 20 35 15 35 35 35 35 25 20 30 40 35

There is enough evidence to support the claim that the


students’ math score are increase.
Example 14:
The data provides the weights of woman anorexia nervosa’s
patients before and after receiving a family therapy treatment.
Does family therapy appear to be effective in helping anorexic
women gain weight? Perform the appropriate test at 5%
significance level.

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:

Ten sixth-grade students reading at or below the


third-grade level participated in a remedial reading
program for six months. The result shows the oral
reading test scores of these students before and
after the program. Test to determine whether one
can conclude that the program is effective (α=0.05).

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).

The parameter to be estimated is the difference between two


population proportions: (p1–p2).

Step 1: Hypothesisstatement

Table 2.7: Alternative and null hypothesis of two proportions


Testing proportions
One-tailed, lower/
Vs
left tail
One-tailed, upper/
Vs
right tail
Two-tailed Vs

• Where k is a constant value. The k value can be equal to 0 or


any other values.
Step 2: TestStatistics

• With assumptions that:

i. We have proportions from two independent


simple random samples.
ii. And the conditions below are satisfied
n1 p̂1 ≥ 5, n2 p̂ 2 ≥ 5, n1 (1− p̂1 ) ≥ 5and n2 (1− p̂ 2 ) ≥
5
• Thus, the statistical test formula is given by

where
x x
p̂ 1 = 1
n1
and p̂ 2 = 2
n2
Step 3: CriticalValue

One right tailed : zα Two tailed : ± zα


2
One left tailed : - zα

Example 17:

A random sample of 500 respondents was selected in a


large city to determine information concerning
consumer behavior. Among the questions asked was,
“Do you enjoy shopping?” Of 240 male respondents,
136 answered yes. Of 260 female respondents, 224
answered yes. Answer the following questions.

Is there enough evidence of a significant difference


between males and females in the proportion that enjoy
shopping at 1% level of significance?
Example 18:

A consumer packaged goods (CPG) company is test


marketing two new versions of soap packaging. Version one
bright
( colors) is distributed in one supermarket, while
version two (simple colors) is in another. Since the first
version is more expensive, it must outsell the other design
that is its market share, p1, must be greater than that of the
other soap package design, i.e. p2.
Population 1 Population 2
bright colors simple colors

Successes X1=180 X2=155

Sample Size n1=904 n2=1,038


155
~ = 180 = .1991 = .1493
Sample Proportion P, 904 Pz = 1, 038

i. Write down the hypothesis statement.

ii. Suppose in the marketing of soap packages scenario,


the brightly colored design had to outsell the simple
design if the different is exist. Do the hypothesis testing
at 1% significance level.
HYPOTHESIS TESTING USING P-VALUE
BASED METHOD

To identify the p-value, we can refer “Sig. (2 tailed)”

Decision Rule:
üReject ; if p-value ≤ α,
üFail to reject ; if p-value > α.
üWhere, α is significance level.

Type of test p-value


Sig.(two tailed)
One tailed test 2

Two tailed test Sig.(two tailed)


There are five (5) steps for the hypothesis testing:

Step 1: Hypothesis statement


Step 2: Identify a p-value
Step 3: State a Significance Level
Step 4: Decision
Step 5: Conclusion
Example 19:

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

Assume that the amount of petrol remaining in the tanks is


normally distributed.

i. Ignoring the station where the samples were collected, test the
claim at 2% significance level.

ii. Is there any difference in mean gallons of petrol left between


cars that entered Station A and Station B at 2% significance
level?
Both questions above use different procedure number of
populations in the analysis. Question (i) is hypothesis
testing for one population mean while question (ii) is
hypothesis testing for two populations mean.

i. Ignoring the station where the samples were collected,


test the claim at 2% significance level.

Solution

Step 1: Hypothesis statement


Claim: the average car owner refilled the tank when there was more than 3 gallons
left. Thus:

Step 2: Identify a p-value


Step 3: State a Significance Level
Significance level:

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?

Note : Testing mean difference between


two independent samples
ü Checking whether the variance are equal or not
ü Test the hypothesis about the means
a. Checking whether the variance are equal or not

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 1: Hypothesis statement

Step 2: Identify a p-value


p-value : 0.299

Step 3: State a Significance Level


α = 0.10

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 1: Hypothesis statement


H 0 : µd = 0, H1 : µ d ≠ 0

Step 2: Identify a p-value


p-value : 0.749

Step 3: State a Significance Level


α = 0.10

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?

Independent Samples Test


Levene's Test for
Equality of Variances t-test for Equality of Means
95% Confidence
Interval of the
Difference
Mean Std. Error
F Sig. t df Sig. (2-tailed) Difference Difference Lower Upper
minutes Equal variances
assumed 2.093 .165 2.766 18 .013 5.700 2.060 1.371 10.029
Equal variances
not assumed 2.766 15.731 .014 5.700 2.060 1.326 10.074
Solution
First step: Second step:
Levene’s Test for equality of variance Independent sample t-test

i. Hypothesis Statement i. Hypothesis Statement


H0: σ12 = σ 22 H 0 : µ1 − µ 2 = 0
H1: σ 12 ≠ σ 22 H 1 : µ1 − µ 2 > 0

ii. p-value = 0.165 ii. p-value =


0.013
= 0.0065
iii. Significance Level (α) 2
α = 5% = 0.05
iii. Significance Level (α)
iv. Decision; α = 5% = 0.05
Since p-value > α,
Fail to Reject H0; iv. Decision
Since p-value < α, Reject H0;
v. Conclusion;
Equal Variance Assume v. Conclusion
Data provide sufficient evidence at
the 5% significance level to support
the consultant’s claim
Example 23:

On average 1 oz chocolate chip cookie contains 110


calories. Analysis on a random sample of 15 different
brands of 1 oz chocolate chip cookies resulted in the
SPSS output below. At α = 0.05, is there sufficient
evidence that the average calorie content is greater
than 110?

One-Sample Statistics

Std. Error
N Mean Std. Deviation Mean
calories 15 137.3333 24.11777 6.22718

One-Sample Test

Test Value = 110


95% Confidence
Interval of the
Mean Difference
Differe
T df Sig. (2-tailed) nce Lower Upper
calories 4.389 14 .001 27.33333 13.9774
40.6893
Example 24:
An attitude test which measures motivation (in unit scores) for
upward mobility was administered to a group of Japanese managers
and another group of American managers. Data was analyzed and
results are shown in SPSS output below.
Group Statistics
Std. Error
Manager N Mean Std. Deviation Mean
Score Japanese 10 7.1500 .47668 .15074
American 8 6.5250 1.41396 .49991

Independent Samples Test


Levene's Test
for Equality of
Variances t-test for Equality of Means
95% Confidence
Interval of the
Sig. Mean Std. Error Difference
F Sig. t df (2-tailed) Difference Difference
Lower Upper
core Equal
variances 8.586 .010 16 .207 .62500 .47493 -.38182 1.63182
assumed
Equal
variances
8.278 .264 .62500 .52214 -.57207 1.82207
not
assumed

Determine if the average test scores of Japanese managers differs from


the average test scores of American managers at 0.05 significance level.
Example 25:
Because of the rising costs of industrial accidents, many chemical,
mining, and manufacturing firms have instituted safety courses.
Employees are encouraged to take these courses designed to
heighten safety awareness. A company is trying to decide whether
course 2 is more suitable for the employees than course 1. To help
make a decision, ten employees take course 1 and the same
employees take course 2. Each employee graded the usefulness
of each course. Assume that the grades are normally distributed.
Does the company have enough evidence at the 5% level of
significance to infer that the grades for course 2 are higher than
those for course 1?

Paired Samples 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)

To obtain the SPSS output for both questions (i and ii)


discuss in section 2.4, follow these steps.

Step 1: Entering data

- Set the data variable as numeric


- let column 1 be the data obtained from the samples

- let column 2 be the population (station where the


data were collected)

o since there are 2 different station where the


data were collected, give values to data where
value 1= station A and value 2= station B
Vari abl e vi ew

~ ~
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

lnde11endent Samples Test

Levene's Testfor
Equality of Variances t-
testfor E

i assumed .028 .868 1.249 23 .224


rema ning
n gallons 1.194 16.4 71 .249
not assumed
F Sig. t df Sig. (2-
tailed) [
i petrol Equal variances

Equal variances
Example 26:

The federal government has granted funds for a


special program designed to reduce crime in eight
districts. The numbers of crimes before and after the
program implemented are shown below.

Number of Crimes by District


A B C D E F G H
Before 14 7 4 5 17 12 8 9
After 2 7 3 6 8 13 3 5

Has there been a decrease in the number of crimes


since the implementation of the program? Use .a= 0.01
Step 1: Entering Da ta
Set the data variable as numeric
Let column 1 be the district number.
Let column 2 be the data ob ta ined be fore study
Let column 3 be the data ob ta ined a fter stu dy

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 1: Hypothesis statement


H 0 : µd = 0, H1 : µd > 0

Step 2: Identify a p-value


0.072
p − value : = 0.036
2
Step 3: State a Significance Level
1% significance level

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.

The aims of doing hypothesis testing is to reject


the null hypothesis and thus, in decision we will
say either we have evidence or no evidence to
reject the null hypothesis.

The statistical test for testing the means(s)


depends on the sample size(s) and information
regarding the population variance(s). (Refer to
Central Limit Theorem)
The statistical test for testing the proportions(s)
depends on the sample size(s). When sample
size(s) is(are) large and all specific conditions
are satisfied, then the distributions for the
proportions will follow normal distribution.
Otherwise, it will follow Binomial distribution.

There are two different types of error namely


Type I error and Type II error.

The complimentary of Type II error is known


as the power of test.

END OF CHAPTER 2

You might also like