Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
22 views324 pages

SBST 3203 Module

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views324 pages

SBST 3203 Module

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 324

SBST3203

Elementary Data Analysis

Copyright © Open University Malaysia (OUM)


SBST3203
ELEMENTARY
DATA ANALYSIS
Prof Dr Mohd Kidin Shahran

Copyright © Open University Malaysia (OUM)


Fifth edition 2020
Fourth edition 2010
Third edition 2009
Second edition 2008
First edition 2007

Developed by Centre for Instructional Design and Technology, OUM.


Copyright © Open University Malaysia (OUM), SBST3203
All rights reserved. No part of this work may be reproduced in any form or by any means without
the written permission of the President of Open University Malaysia (OUM).

www.oum.edu.my

Copyright © Open University Malaysia (OUM)


Table of Contents
Course Guide ix–xiv

Topic 1 Comparison of Two Population Means 1


1.1 Concept of Mean Comparison 2
1.2 Null and Alternative Hypotheses and Type of Test 5
1.2.1 Adjustment of Hypothesis 6
1.2.2 Selection of Hypothesis 7
1.3 Rejection Region (RR), Significance Level and p-value 9
1.3.1 Test Statistics for Testing Population Mean 10
Difference
1.4 Mean Comparison for Unspecified Δ0 16
Summary 21
Glossary 22
Self-Test 1 23
Self-Test 2 24

Topic 2 Comparing Two Population Proportions 26


2.1 Concept of Production Comparison 26
2.2 Null and Alternative Hypotheses 28
2.2.1 Adjustments to Hypothesis 29
2.2.2 Selection of Hypothesis 29
2.3 Rejection Region (RR), Significance Level and p-value 32
2.3.1 Test Statistics for Testing Difference in Population 33
Proportions
2.3.2 Acceptance and Rejection of Null Hypothesis 34
Summary 37
Glossary 38
Self-Test 1 38
Self-Test 2 39

Copyright © Open University Malaysia (OUM)


iv  TABLE OF CONTENTS

Topic 3 Hypothesis Testing on Population Variance 41


3.1 Chi-square Distribution 42
3.1.1 Properties of Chi-square Distribution 43
3.1.2 Chi-square Distribution Table 44
3.1.3 Hypothesis Testing on Population Variance 50
3.2 F Distribution 56
3.2.1 Properties of F Distribution 56
3.2.2 F Distribution Table 58
3.3 Interval Estimation of Variance for Two Populations 61
3.4 Comparing Variances of Two Populations 64
Summary 70
Glossary 71
References 71
Appendix 72

Topic 4 Analysis of Variance (ANOVA) 73


4.1 Basic Concepts of ANOVA 74
4.1.1 ANOVA and Experiment 74
4.1.2 Within and Between Group Variation 80
4.2 Single-factor Experiment 87
4.2.1 One-way ANOVA 87
4.2.2 Model for a Single-factor Test 90
Summary 95
Glossary 96
References 96

Topic 5 Chi-squared Tests 97


5.1 Goodness-of-fit Test 98
5.1.1 Fitting to a Given Probability 98
5.1.2 Fitting to a Given Distribution 102
5.2 Tabulating Qualitative Data (Contingency Table) 111
5.2.1 Test of Independence 115
5.2.2 Test of Homogeneity 118
5.2.3 Yate’s Continuity Correction 121
Summary 127
Glossary 128
References 128

Copyright © Open University Malaysia (OUM)


TABLE OF CONTENTS  v

Topic 6 Correlation 129


6.1 Two-way Scatter Plot 132
6.2 Pearson Correlation Coefficient 136
6.2.1 Pearson Correlation Coefficient Significance Test 139
6.3 Spearman Rank Correlation Coefficient 141
6.3.1 Spearman Rank Correlation Coefficient 145
Significance Test
Summary 147
Glossary 148
References 148

Topic 7 Simple Linear Regression Analysis 149


7.1 Introduction to Regression Concepts 150
7.2 Simple Linear Regression Model and Its Assumptions 151
7.3 Least Squares Method 155
7.4 Inferences on Regression Coefficients 161
7.5 Model Adequacy Check 165
7.5.1 Coefficient of Determination, R2 165
7.5.2 Residual Plot 168
7.5.3 Some Transformations 170
7.6 Prediction and Estimation Using Regression Model 173
7.6.1 Prediction Interval for an Individual Value of y 174
7.6.2 Confidence Interval for a Mean Value of y 176
Summary 178
Glossary 179
References 179

Topic 8 Multiple Regression 181


8.1 Multiple Regression Model and Assumptions 183
8.1.1 Assumptions for Multiple Regression Model 184
8.1.2 Multiple Regression Model with Two Independent 185
Variables
8.1.3 Calculation Using Microsoft Excel Package 196
Summary 201
Glossary 202
References 202

Copyright © Open University Malaysia (OUM)


vi  TABLE OF CONTENTS

Topic 9 Hypothesis Testing (Single Population) 203


9.1 Multiple Regression Model and Assumptions 204
9.2 Sign Test 207
9.2.1 Sign Test for Large n 211
9.3 Wilcoxon Signed-rank Test 213
9.3.1 Wilcoxon Signed-rank Test for Large n 216
Summary 220
Glossary 220
References 221
Appendix 222

Topic 10 Hypothesis Testing (Two Populations) 223


10.1 Dependent and Independent Populations 224
10.2 Hypothesis Statement for Testing of Two Populations 225
10.3 Comparing Two Dependent Populations 228
10.3.1 Sign Test for Two Dependent Populations 229
10.3.2 Wilcoxon Signed-rank Test for Two Dependent 233
Population
10.4 Comparing Two Independent Populations 238
Summary 245
Glossary 245
References 246

Answers 247

Copyright © Open University Malaysia (OUM)


Copyright © Open University Malaysia (OUM)
Copyright © Open University Malaysia (OUM)
COURSE GUIDE  ix

COURSE GUIDE DESCRIPTION


You must read this Course Guide carefully from the beginning to the end. It tells
you briefly what the course is about and how you can work your way through the
course material. It also suggests the amount of time you are likely to spend in order
to complete the course successfully. Please keep referring to the Course Guide as
you go through the course material as it will help you to clarify important study
components or points that you might miss or overlook.

INTRODUCTION
SBST3203 Elementary Data Analysis is one of the courses offered at Open
University Malaysia (OUM). This course is worth 3 credit hours and should be
covered over 8 to 12 weeks.

COURSE AUDIENCE
This course is offered to all learners taking the Bachelor of Mathematics and
Management (Honours) programme.

As an open and distance learner, you should be acquainted with learning


independently and being able to optimise the learning modes and environment
available to you. Before you begin this course, please confirm the course material,
the course requirements and how the course is conducted.

Copyright © Open University Malaysia (OUM)


x  COURSE GUIDE

STUDY SCHEDULE
It is a standard OUM practice that learners accumulate 40 study hours for every
credit hour. As such, for a three-credit hour course, you are expected to spend
120 study hours. Table 1 gives an estimation of how the 120 study hours could be
accumulated.

Table 1: Estimation of Time Accumulation of Study Hours

Study
Study Activities
Hours
Briefly go through the course content and participate in an initial
4
discussions
Study the module 64
Attend tutorial sessions 6–8
Online participation 15
Revision 16
Assignment(s) 15
TOTAL STUDY HOURS ACCUMULATED 120

COURSE LEARNING OUTCOMES


By the end of this course, you should be able to:

1. Calculate Pearson’s correlation and rank Spearman correlation;

2. Construct a one-way analysis of the variance (ANOVA) test;

3. Determine simple and multiple linear regression models; and

4. Analyse non-parametric data, case single population and double population.

Copyright © Open University Malaysia (OUM)


COURSE GUIDE  xi

COURSE SYNOPSIS
This course is divided into 10 topics. The synopsis for each topic is listed as follows:

Topic 1 introduces you to the concept of mean comparison, null and alternative
hypotheses as well as type of test for two population means. In addition, it will
cover rejection region (RR), significance level and p-value for two population
means as well as mean comparison for unspecified Δ0.

Topic 2 explains production comparison, null hypothesis and alternative hypothesis


for two population proportions as well as rejection region (RR), significance level
and p-value for two population proportions.

Topic 3 describes the properties of chi-square and F distributions, the chi-square


and F distribution tables, the confidence interval to compare the variances for two
populations and variances of two populations.

Topic 4 teaches you how to use ANOVA in experiment as well as within and
between group variation. Then, one-way ANOVA and model for a single-factor test
will be demonstrated too.

Topic 5 covers chi-squared tests. In this topic, you will learn about goodness-of-fit
and contingency table tests as well as the expected frequencies for goodness-of-fit
and contingency table tests. Later, the degrees of freedom for all tests performed
and the procedures to obtain statistical decision for goodness-of-fit and contingency
table tests will be presented.

Topic 6 explains correlation concepts and the relationship between two variables,
followed by two-way scatter plot, Pearson correlation coefficient and Spearman
rank correlation coefficient.

Topic 7 teaches you about simple linear regression analysis. The contents of this
topic includes a discussion on regression concepts, simple linear regression model,
least squares estimate method, inferential concepts and methods to evaluate data
suitability in fitting a regression model.

Copyright © Open University Malaysia (OUM)


xii  COURSE GUIDE

Topic 8 concentrates on multiple regression. The discussion in this topic covers the
multiple regression concept, multiple regression model and assumptions made,
methods to evaluate the suitability of data on regression model and how to use the
regression equation for the prediction and estimation of parameter values.

Topic 9 shows you how to conduct hypothesis testing on a single population. In


order to do so, you will learn how to construct an appropriate null and alternative
hypothesis for a non-parametric single population test, and test a population using
sign test and Wilcoxon signed-rank test.

Topic 10 continues on hypothesis testing, but for two populations. Firstly, it


explains dependent and independent populations, followed by hypothesis statement
for two populations testing. Then, comparison between two dependent populations
using the Wilcoxon signed-rank method will be explained. Lastly, comparison
between two independent populations using the Mann-Whitney total rank method
will be demonstrated.

TEXT ARRANGEMENT GUIDE


Before you go through this module, it is important that you note the text
arrangement. Understanding the text arrangement will help you to organise your
study of this course in a more objective and effective way. Generally, the text
arrangement for each topic is as follows:

Learning Outcomes: This section refers to what you should achieve after you have
completely covered a topic. As you go through each topic, you should frequently
refer to these learning outcomes. By doing this, you can continuously gauge your
understanding of the topic.

Self-Check: This component of the module is inserted at strategic locations


throughout the module. It may be inserted after one subtopic or a few subtopics. It
usually comes in the form of a question. When you come across this component,
try to reflect on what you have already learnt thus far. By attempting to answer the
question, you should be able to gauge how well you have understood the
subtopic(s). Most of the time, the answers to the questions can be found directly
from the module itself.

Copyright © Open University Malaysia (OUM)


COURSE GUIDE  xiii

Activity: Similar to Self-Check, the Activity component is also placed at various


locations or junctures throughout the module. This component may require you to
solve questions, explore short case studies, or conduct an observation or research.
It may even require you to evaluate a given scenario. When you come across an
Activity, you should try to reflect on what you have gathered from the module and
apply it to real situations. You should, at the same time, engage yourself in higher
order thinking where you might be required to analyse, synthesise and evaluate
instead of only having to recall and define.

Summary: You will find this component at the end of each topic. This component
helps you to recap the whole topic. By going through the summary, you should be
able to gauge your knowledge retention level. Should you find points in the
summary that you do not fully understand, it would be a good idea for you to revisit
the details in the module.

Key Terms: This component can be found at the end of each topic. You should go
through this component to remind yourself of important terms or jargon used
throughout the module. Should you find terms here that you are not able to explain,
you should look for the terms in the module.

References: The References section is where a list of relevant and useful textbooks,
journals, articles, electronic contents or sources can be found. The list can appear
in a few locations such as in the Course Guide (at the References section), at the
end of every topic or at the back of the module. You are encouraged to read or refer
to the suggested sources to obtain the additional information needed and to enhance
your overall understanding of the course.

PRIOR KNOWLEDGE
Learners are required to pass SBST1203 Introductory Statistics.

ASSESSMENT METHOD
Please refer to myINSPIRE.

Copyright © Open University Malaysia (OUM)


xiv  COURSE GUIDE

REFERENCES
Freund, J. E. (2003). Mathematical statistics (7th ed.). Upper Saddle River, NJ:
Prentice-Hall, Inc.

Mann, P. S. (2005). Introductory statistics using technology (5th ed.). Upper Saddle
River, NJ: John Wiley & Sons, Inc.

Mendenhall, W., Beaver, R. J., & Beaver, B. M. (2013). Introduction to probability


and statistics (14th ed.). Belmont, CA: Thomson Brooks/Cole.

Walpole, R. E. (2006). Probability and statistics for engineers and scientist


(8th ed.). Upper Saddle River, NJ: Prentice-Hall, Inc.

TAN SRI DR ABDULLAH SANUSI (TSDAS)


DIGITAL LIBRARY
The TSDAS Digital Library has a wide range of print and online resources for
the use of its learners. This comprehensive digital library, which is accessible
through the OUM portal, provides access to more than 30 online databases
comprising e-journals, e-theses, e-books and more. Examples of databases available
are EBSCOhost, ProQuest, SpringerLink, Books24×7, InfoSci Books, Emerald
Management Plus and Ebrary Electronic Books. As an OUM learner, you are
encouraged to make full use of the resources available through this library.

Copyright © Open University Malaysia (OUM)


Topic  Comparison of
Two
1 Population
Means
LEARNING OUTCOMES
By the end of this topic, you should be able to:
1. State the concept of mean comparison;
2. Describe null and alternative hypotheses as well as type of test for
two population means;
3. Explain rejection region (RR), significance level and p-value for two
population means; and
4. Determine the mean comparison for unspecified Δ0.

 INTRODUCTION
In data analysis, the comparison of two population means is very common and
provides a way to test the hypothesis that the two groups differ from each other. In
this topic, learners will be introduced to the concept of mean comparison, null and
alternative hypotheses, type of test and decision rule.

Copyright © Open University Malaysia (OUM)


2  TOPIC 1 COMPARISON OF TWO POPULATION MEANS

1.1 CONCEPT OF MEAN COMPARISON


In the following cases, what are the comparison parameters under study? Suppose
that the variables under study are:

(a) The age of OUM first-year students in the 2010/2011 session as population 1;
and

(b) The age of UKM first-year students in the 2010/2011 session as population 2.

In this situation, the population mean is the appropriate parameter to be used in the
comparison statements of “the mean of population 1 is greater than the mean for
population 2.”

Examples of population mean comparisons are given in Table 1.1.

Table 1.1: Examples of Population Mean Comparisons

After Comparison Treatment Statement Mathematical Expression

1. Mean for blood pressure level decreases μ2 < μ1

2. Mean for blood pressure level increases μ2 > μ1

3. Mean for blood pressure level remains the same μ2 = μ1

4. Mean for blood pressure level changes μ2 ≠ μ1

Copyright © Open University Malaysia (OUM)


TOPIC 1 COMPARISON OF TWO POPULATION MEANS  3

Now, let us look at two examples that demonstrate this.

Example 1.1:

Population Statement:
The measurement level of blood pressure (in systolic unit) before treatment
compared to the measurement level of blood pressure (in systolic unit) after
treatment.

Population Selection:
The selection of population is arbitrary. Nevertheless, in this example:
(a) The level of blood pressure before treatment is chosen as population 1; and
(b) The level of blood pressure after treatment is chosen as population 2.

Variable Under Study:


Suppose that variable X represents the level of blood pressure (in systolic unit),
then we denote:

• X1 as the level of blood pressure from population 1, X 2 as the level of blood


pressure from population 2.

Random Sample:
If a random sample of size n1 is taken from population 1, we obtain:

• n1 observed values of blood pressure level with x1i is for an individual i


(i = 1, 2, …, n1 ) from population 1.

Copyright © Open University Malaysia (OUM)


4  TOPIC 1 COMPARISON OF TWO POPULATION MEANS

Subsequently, if n2 individuals are taken at random from population 2, we get:

• n2 observations with x2i is the blood pressure level for an individual i


(i = 1, 2, …, n2 ) from population 2.

Comparable Parameters:

(a) Population 1: Population mean μ1 , variance σ12 ; and

(b) Population 2: Population mean μ2 , variance σ 22 .

In general, various possible comparisons for parameter μ2 with μ1 are given in


Table 1.2, with subscripts 1 and 2 for populations 1 and 2, respectively. The
assignment of population 1 or 2 is arbitrary.

Table 1.2: Comparisons of Parameter Values

Comparison Statement Mathematical Expression


1. More than, greater, increase, improved μ2 > μ1
2. Less than, smaller, decrease, reduced μ2 < μ1
3. Same as, same value, remains μ2 = μ1
4. At least, same or greater than μ2 ≥ μ1
5. At most, same or less than μ2 ≤ μ1

6. Not equal to, or different from μ2 ≠ μ1

The discussions on the mean population or other population parameters involve


unknown population variance. This is important to note since in the real problems,
population variances are known, and are usually estimated by using the sample
variance.

Copyright © Open University Malaysia (OUM)


TOPIC 1 COMPARISON OF TWO POPULATION MEANS  5

Two cases will be discussed, namely:

(a) Population variance 1 ( σ12 ) and population variance 2 ( σ 22 ) are the same; and

(b) The population variances are not the same.

Both cases are discussed in detail in the following subtopics.

ACTIVITY 1.1

Population Statement:
Mathematics test scores for a group of students taught using a shortcut
method compared with those of another group of students who are not
taught using the shortcut method.

Based on the population statement:


(a) State population 1 and population 2;
(b) Identify the variable under study;
(c) Provide an example of a population mean comparison statement
with an appropriate mathematical expression.

Share your answers for discussion in the myINSPIRE forum.

1.2 NULL AND ALTERNATIVE HYPOTHESES


AND TYPE OF TEST
After identifying the form of comparison for the population parameter as in
Tables 1.1 or 1.2, the subsequent step is to write or formulate the appropriate null
hypothesis, H 0 and the alternative hypothesis, H1 .

Copyright © Open University Malaysia (OUM)


6  TOPIC 1 COMPARISON OF TWO POPULATION MEANS

Table 1.3 presents various hypothesis formulations for various relationships of two
population means. The determination of test type is based on the formulation of
alternative hypothesis, H1 as shown in the same table (see Table 1.3).

Table 1.3: Formulation of Hypothesis

Mean Comparison H0 & H1 Type of Test

μ 2 > μ1 H1 : μ 2 > μ1 ; 1 right-tailed


H 0 : μ 2 ≤ μ1

μ 2 < μ1 H 0 : μ 2 ≥ μ1 ; 1 left-tailed
H1 : μ 2 < μ1

μ 2 = μ1 H 0 : μ 2 = μ1 ; 2-tailed
H1 : μ 2 ≠ μ1

μ 2 ≥ μ1 H 0 : μ 2 ≥ μ1 ; 1 left-tailed
H1 : μ 2 < μ1

μ 2 ≤ μ1 H 0 : μ 2 ≤ μ1 ; 1 right-tailed
H1 : μ 2 > μ1

μ 2 ≠ μ1 H 0 : μ 2 = μ1 ; 2-tailed
H1 : μ 2 ≠ μ1

1.2.1 Adjustment of Hypothesis


Some adjustments to the hypothesis need to be made so that they are appropriate
according to the test statistics. Then, the distribution of the test statistics is identified
before carrying out the procedures in the hypothesis testing. This could be used here
but with some changes in the formulation of test statistics. Table 1.4 displays the
hypothesis adjustments for several comparisons of the population mean.

Copyright © Open University Malaysia (OUM)


TOPIC 1 COMPARISON OF TWO POPULATION MEANS  7

Table 1.4: Hypothesis Adjustments

H 0 & H1 Adjusted-1 H 0 & H1


(1) (2)
1. H1 : μ 2 > μ1 H1 : μ 2 − μ1 > 0
H 0 : μ 2 = μ1 or H 0 : μ 2 ≤ μ1 H 0 : μ 2 − μ1 = 0 or H 0 : μ 2 − μ1 ≤ 0

2. H1 : μ 2 < μ1 H1 : μ 2 − μ1 < 0
H 0 : μ 2 = μ1 or H 0 : μ 2 ≥ μ1 H 0 : μ 2 − μ1 = 0 or H 0 : μ 2 − μ1 ≥ 0

3. H 0 : μ 2 = μ1 H 0 : μ 2 − μ1 = 0
H1 : μ 2 ≠ μ1 H1 : μ 2 − μ1 ≠ 0

1.2.2 Selection of Hypothesis


In hypothesis testing involving parameters from two populations, the formulation
of the alternative hypothesis is in accordance with the comparison of the values
of the two parameters (refer to Table 1.3) as claimed or in need of testing the truth
of the comparison based on the independent random samples from the respective
populations. Examples of the parameter comparisons are given in Tables 1.1, 1.2
and 1.3.

The original objective is to accept or reject H1 . Nevertheless, the measurements


in statistical tests are rather difficult for this hypothesis since the values are
expressed in some intervals.

Thus, the hypothesis testing is done onto H 0 with the implication of rejecting H 0
at a specified significance level, which also means accepting H1 . As such, the
formulations of H1 and H 0 as indicated in Table 1.3, and the adjustments as given
in Table 1.4 must be made with caution so that the decision made based on samples
conforms to (as if supporting) H1 .

Copyright © Open University Malaysia (OUM)


8  TOPIC 1 COMPARISON OF TWO POPULATION MEANS

The following are three categories of statements for testing population mean
parameter (see Table 1.5).

Table 1.5: Three Categories of Statements for Testing Population Mean Parameter

Category Description Example


U1: Statement H 0 is as stated in the The statement “the mean lifetime for an
involving statement and H1 is electric bulb from Population 2 is the same
equality in with the mean for Population 1”, or “mean
the opposite.
value, sign is for Population 1 does not change.”
“=” H 0 : μ 2 = μ1 ; H1 : μ 2 ≠ μ1 ⇔
H 0 : μ 2 − μ1 = 0 ; H 1 : μ 2 − μ1 ≠ 0

U2: Statement H 0 is as stated in the The statement “the mean lifetime for an
involving statement and H1 is electric bulb of Population 2 is at least equal
inequality in to the mean lifetime for an electric bulb of
the opposite.
value, sign is Population 1.”
“≤” or “≥” H 0 : μ 2 ≥ μ1 ; H 1 : μ 2 < μ1 ⇔
H 0 : μ 2 − μ1 ≥ 0 ; H1 : μ 2 − μ1 < 0

U3: Statement H1 is as stated in the The statement “the mean lifetime for an
involving strict statement and H 0 is electric bulb of Population 2 exceeds the mean
inequality in lifetime for an electric bulb of Population 1”
the opposite.
value, sign is (write this statement as H1 , and its
“<”or “>” complement as the H 0 ).
H1 : μ2 > μ1 ; H 0 : μ2 ≤ μ1 : ⇔
H1 : μ2 − μ1 > 0 ; H 0 : μ2 − μ1 ≤ 0

Note that every H 0 statement contains the equality sign “=”.

The categories of statement are applicable to the population proportion parameter, p.

ACTIVITY 1.2

“The statement categories are applicable for the population proportion p”.
What do you understand from this statement? Discuss this statement in
the myINSPIRE forum.

Copyright © Open University Malaysia (OUM)


TOPIC 1 COMPARISON OF TWO POPULATION MEANS  9

EXERCISE 1.1

State two population means observations that are comparable for the case
Δ 0 = 0. Select one comparison in Table 1.4.

1.3 REJECTION REGION (RR), SIGNIFICANCE


LEVEL AND p-VALUE
Since the rejection region (RR) and significance level are closely related to the test
statistics, let us first discuss the test statistics. In hypothesis testing, random samples
are usually used as the basis of a test either to reject or accept the null hypothesis at
the specified significance level.

This means the hypothesis testing, among others, involves:

(a) Sampling distribution; and

(b) A sample statistics used in the testing which is referred to as test statistics.

The test statistics is chosen based on the population parameter discussed in the
problem. This statistics is actually the point estimator for the population parameter
being discussed. For example, in the testing of population means difference as
stated in the null hypothesis:

H 0 : μ2 − μ1 = 0 : μ 2 − μ 1 = 0

Thus, the test statistics used is the difference between the sample means obtained
from the respective populations, that is:

Statistics B = X 2 − X 1

Hypothesis testing on a single parameter value usually ends with a decision to either
accept or reject the null hypothesis H 0 . To make the decision, one can follow a
method or hypothesis rejection rules as specified by the researcher. This rule is
named the decision rule.

Copyright © Open University Malaysia (OUM)


10  TOPIC 1 COMPARISON OF TWO POPULATION MEANS

Decision rule for testing H 0 on population parameter usually involves mapping


a set of estimate values for parameter difference:

B = X 2 − X1

There are two subsets, namely:


(a) AR (acceptance region AR); and
(b) RR (rejection region RR).

These two subsets complement each other.

Both subsets are usually separated by a number k whose value may be given/known
or not but can be calculated when the value of a is known by using the distribution
of test statistics.

SELF-CHECK 1.1

How do we determine acceptance region (AR) and rejection region (RR)?

1.3.1 Test Statistics for Testing Population Mean


Difference
Suppose there are two populations:

(a) Population 1 with mean μ1 and variance, σ12 ; and

(b) Population 2 with mean μ2 and variance σ 22 .

The null hypothesis for testing population means difference as in Table 1.4 for
various comparison cases are either:

(a) H 0 : μ2 − μ1 ≤ 0; or

(b) H 0 : μ2 − μ1 = 0; or

(c) H 0 : μ2 − μ1 ≥ 0.

Copyright © Open University Malaysia (OUM)


TOPIC 1 COMPARISON OF TWO POPULATION MEANS  11

Then, by using the central limit theorem we get:

(a) X1 is a mean for a random sample of size n1 (≥ 30) from population 1 which
follows normal distribution or approximately normal, N μ1 , σ 12 n1 ; and( )
(b) X 2 is a mean for a random sample of size n2 (≥ 30) from population 2 which
follows normal distribution or approximately normal N μ2 , σ 22 n2 . ( )
Thus, the statistics B = X 2 − X 1 is normally distributed or approximately normal
( )
N μ B , σ B2 where μB = μ2 − μ1 , and σ B2 is expressed in the terms of σ12 and σ 22
depending on the following situations (see Table 1.6).

Table 1.6: Situations that Affect σ12 and σ 22 Expressions

Situation Description
1
(a) Population variances σ12 and σ 22 are known and σ 12 ≠ σ 22 .
(b) Both populations are normally distributed.
(c) No requirements on sample size.
(d) Random sample 1 and random sample 2 are independent.

Thus, statistics B is normally distributed with:

σ 22 σ 12
Variance σ B2 = +
n2 n1

Then, the test statistics is a Z score test, where:

X 2 − X1
Z= Formula 1.1
σ 22 σ 12
+
n2 n1

and has standard normal distribution N(0,1).

Copyright © Open University Malaysia (OUM)


12  TOPIC 1 COMPARISON OF TWO POPULATION MEANS

2 (a) Population variances σ12 and σ 22 are known and σ 12 ≠ σ 22 .

(b) Distributions of both populations are not given or unknown.

(c) Both sample sizes are large ( n1 ≥ 30, n2 ≥ 30).

(d) Random samples 1 and 2 are independent.


Thus, statistics B is approximately normally distributed with:

σ 22 σ 12
Variance σ B2 = +
n2 n1

Then, test statistics is a Z score test where:

X 2 − X1
Z= Formula 1.2a
σ 22 σ 12
+
n2 n1

and has the standard normal distribution N(0,1).

3 (a) Population variances σ12 and σ 22 are unknown but σ 12 ≠ σ 22 , and


both sample variances S12 and S22 are known or can be calculated.

(b) Distributions of both populations are not given or unknown.

(c) Both sample sizes are large ( n1 ≥ 30, n2 ≥ 30).

Random samples 1 and 2 are independent.


Thus, statistics B is approximately normally distributed with variance
σ B2 estimated by:

S22 S12
σˆ B2 = +
n2 n1

Copyright © Open University Malaysia (OUM)


TOPIC 1 COMPARISON OF TWO POPULATION MEANS  13

Then, test statistics is a Z score test where:

X 2 − X1
Z= Formula 1.2b
S 22 S12
+
n2 n1

It has standard normal distribution N(0,1).

4 (a) Population variances σ12 and σ 22 are unknown but σ 12 = σ 22 , and


both sample variances S12 and S22 are known or can be calculated.

(b) Both populations are normally or approximately normally


distributed.

(c) Both sample sizes are small ( n1 < 30, n2 < 30).

(d) Random samples 1 and 2 are independent.


Thus, statistics B follows a t distribution with:

v = n1 + n2 – 2 degrees of freedom

and when H 0 is true, the variance σ B2 is estimated using pooled


variance:

S B2 =
( n1 − 1) S12 + ( n2 − 1) S22
n1 + n2 − 2

Then, test statistics is a T test score where:

X 2 − X1
T= Formula 1.3a
1 1
SB +
n2 n1

and has a t distribution with v = n1 + n2 – 2 degrees of freedom.

Copyright © Open University Malaysia (OUM)


14  TOPIC 1 COMPARISON OF TWO POPULATION MEANS

5 (a) Population variances σ12 and σ 22 are unknown but σ 12 ≠ σ 22 , and


both sample variances S12 and S22 are known or can be calculated.

(b) Both populations have normal or approximately normal distribution.

(c) Both sample sizes are small ( n1 < 30, n2 < 30).

(d) Random samples 1 and 2 are independent.


Thus, statistics B follows a t distribution with v degrees of freedom
(df) as in Formula 1.3b, where the variance σ B2 is estimated by:

S12 S22
σˆ B2 = +
n1 n2

Thus, test statistics is a T score test where:

X 2 − X1
T= Formula 1.3b
S 22 S12
+
n2 n1

and has a t distribution with:


2
 S12 S 22 
 + 
ν '=  n1 n2 
(
 S2 n 2
) (
S22 n2  )
2
 1 1  df (round off to the next integer)
+
 n1 − 1 n2 − 1 
 
Formula 1.4

Copyright © Open University Malaysia (OUM)


TOPIC 1 COMPARISON OF TWO POPULATION MEANS  15

6– (a) Population variances σ12 and σ 22 are unknown but σ 12 = σ 22 .


Paired
data t (b) Both populations have normal or approximately normal distribution.
test
(c) Both sample sizes are small ( n1 < 30, n2 < 30), and n1 = n2 = n.

(d) Random samples 1 and 2 are dependent.


Let us use Example 1.1; the level of blood pressure before treatment
(as population 1) and the level of blood pressure after treatment (as
population 2) for individuals in random samples from the same population
(this means, σ 12 = σ 22 ).

Population 1 (before treatment/not given treatment) is usually referred to as


the control population. In this case, random sample from “population 1” is
said to be dependent from the random sample from “population 2”, thus it
would be better if the analyses becomes a single sample analysis with data:

D1 , D2 , ..., Dn

where:

Di = X i − Yi , i = 1, 2, ..., n

is the difference of the matched observations of the ith individual (the same
topic).

Thus, hypothesis test for the mean difference μ X − μY becomes a


hypothesis test for a single population with test statistics:

D
T= Formula 1.5a
SD
n

where Δ 0 is as explained earlier.

Mean difference D =
 Di
n

(  Di )
2

Di2 −
Standard deviation S D = n Formula 1.5b
n −1

Statistics T has t distribution with v = n – 1 df

Copyright © Open University Malaysia (OUM)


16  TOPIC 1 COMPARISON OF TWO POPULATION MEANS

Take note that in the case of a non-normal population, you may use a non-
parametric technique. Please refer to other advanced data analysis books. For a
detailed explanation on the central limit theorem, you may refer to the following
webpage:

http://www.pinkmonkey.com/studyguides/subjects/stats/chap8/s0808601.asp

SELF-CHECK 1.2

In general, how to formulate the null hypothesis to compare means of two


populations?

1.4 MEAN COMPARISON FOR UNSPECIFIED


Δ0
In this last subtopic, the comparison between the two population means include
directive and non-directive changes.

Since the formulations of H 0 and H1 are important but difficult to implement, thus
we focus on problems where both hypotheses are not given. For testing problems
where H 0 and H1 are given, you can straight away use the testing procedures. Let
us look at an example.

Example 1.2:
A researcher is assigned to conduct a study on the beginning salary for executives
in a private company which consists of two groups:

(a) Group A: The members possess a professional diploma; and

(b) Group B: The members possess a general degree.

The study has two following objectives:

(a) Determine whether there is a difference in the starting salary for groups A
and B; and

(b) Determine whether the starting salary for group A is less than the starting
salary for group B.

Copyright © Open University Malaysia (OUM)


TOPIC 1 COMPARISON OF TWO POPULATION MEANS  17

Two independent random samples have been chosen from their respective
population groups:

(a) Sample A: Consists of 60 people with the mean beginning salary of


RM1,167 per month and the standard deviation of RM150.

(b) Sample B: Consists of 64 people with the mean beginning salary of


RM1,200 per month and the standard deviation of per month and the
standard deviation of RM100.

Test at the significance level of 5%.

Answer:
For both objectives, there is no statement on the amount/quantity for population
mean difference. For the given objectives, the population parameter under study
is the population mean for the respective groups.

(a) To Determine if There is a Difference in the Beginning Salary for


Group A and Group B

Step 1: As stated above, the population parameter to be tested is the


comparison between population means μ A and μB .

Step 2: Population distribution is approximately normal.

Step 3: Formulation of hypothesis: The comparison of the population


means is a case of non-directive change since the researcher only
wants to know if there is any difference.

Thus, the statement:

There is difference ⇔ Statement μB ≠ μ A :

H1 : μ B ≠ μ A ; and

H 0 : μ B = μ A (the complementary)

This test is a two-tailed test. Adjustments for the hypothesis:

H 0 : μB − μ A = 0; H1 : μB − μ A ≠ 0; .

Copyright © Open University Malaysia (OUM)


18  TOPIC 1 COMPARISON OF TWO POPULATION MEANS

Step 4: Although RR is not given, the significance level α is given as


0.05. Thus, we can calculate the probability value, p or construct
RR for the testing.

RR for the two-tailed test is RR = {z : z ≤ –1.96} ∪ {z : z ≥ 1.96}


Step 5: Even though the population is not assumed to be normally
distributed with the population variance unknown, both samples
are large, and by applying a central limit theorem, the population
distribution can be assumed to be approximately normal. Then,
the test statistics.

B = X 2 − X 1 is the Z score where:

X 2 − X1
Z= Formula 1.6
S22 S12
+
n2 n1

has a standard normal distribution, N(0,1).

Step 6: Test decision when H 0 is true. Based on the information given


by the sample, the value for B score is given by Formula 1.6:

XB − XA 1, 200 − 1,167
ZB = = =1.4496 = 1.45
S22 S12 1002 1502
+ +
n2 n2 64 60

Test decision: Since the value z B = 1.45 < 1.96, thus H 0 is


accepted.

Step 7: Testing conclusion: The information from the sample gives


enough evidence that the starting salary for workers from both
groups is not significantly different.

Copyright © Open University Malaysia (OUM)


TOPIC 1 COMPARISON OF TWO POPULATION MEANS  19

(b) To Determine if the Starting Salary for Group A is Less Than the
Starting Salary for Group B

Step 1: Given the population parameters to be tested for comparison are


μ A and μB .

Step 2: The population distribution is assumed normal.

Step 3: Hypothesis testing: The comparison is considered as a case of


directive changes since the researcher wants to know if there is a
higher starting salary for group B. Thus, the statement:

“Starting salary for A is less than the starting salary for group B”
⇔ Statement μB > μ A , thus, we write:

(a) H1 : μB > μ A (this test is a one-tailed test)

(b) H 0 : μB ≤ μ A (complementary)

Hypothesis adjustments:

(a) H1 : μB > μ A ⇔ H1 : μB − μ A > 0

(b) H 0 : μB ≤ μ A ⇔ H 0 : μB − μ A ≤ 0

Step 4: Although the RR is not given, the significance level α is given


as 0.05. Thus, we can calculate the probability value, p or
construct RR for testing.

The RR for a two-tailed test is RR = {z : z ≥ 1.645}

and has a standard normal distribution N(0,1).

Copyright © Open University Malaysia (OUM)


20  TOPIC 1 COMPARISON OF TWO POPULATION MEANS

Step 5: Even though the population is not assumed normal and the
variance population is unknown, both samples are large. Thus, by
the central limit theorem, the sampling mean can be assumed to
be approximately normal. The test statistics B = X 2 − X 1 is a
standard Z score where:

X 2 − X1
Z=
S22 S12
+
n2 n1

Step 6: Test decision when H 0 is true.

Based on the given sample information, the value for B score is


given by Formula 1.6:

XB − XA 1, 200 − 1,167
ZB = = = 1.4496 ≈ 1.45
S22 S12 1502 1002
+ +
n2 n1 64 36

Test decision: Since the value for zB = 1.45 < 1.645, thus we do
not reject H 0

Step 7: Testing conclusion: Sample information provides enough


evidence that the starting salary for group B does not exceed that
of group A. The difference existing in the average starting salary
between the two groups is just coincidental.

To view the procedures for hypothesis testing on two population means in a


flowchart, you can visit https://online.stat.psu.edu/stat200/book/export/html/176.

Copyright © Open University Malaysia (OUM)


TOPIC 1 COMPARISON OF TWO POPULATION MEANS  21

EXERCISE 1.2

A special examination to evaluate understanding of the English language


is given to two groups of students at a secondary school. Group A consists
of 24 arts stream students and group B has 22 science stream students.
The average score for students of group A is 80 and the standard deviation
is 8. Students from group B have an average score of 78 marks with a
standard deviation of 9 marks. Assuming that the distribution of marks for
both groups is normal with equal population variance, test the difference
in means for the two populations at 5% significance level.

• Population mean is the appropriate parameter to be used in the comparison


statements of “the mean of population 1 is greater than the mean for
population 2.”

• The hypothesis testing procedure for comparing two population means is


similar to that of a single population mean.

• After identifying the form of comparison for the population parameter, the
subsequent step is to write or formulate the appropriate null hypothesis, H 0
and the alternative hypothesis, H1 .

• Take note of parameter changes (directive or not) and identify a suitable


comparison. Then, the formulation of the hypothesis is made with appropriate
adjustments.

• In hypothesis testing involving parameters from two populations, the


formulation of the alternative hypothesis is in accordance with the comparison
of the values of the two parameters.

Copyright © Open University Malaysia (OUM)


22  TOPIC 1 COMPARISON OF TWO POPULATION MEANS

• The test statistics used is the difference between the sample means obtained
from the respective populations.

• Hypothesis testing on a single parameter value usually ends with a decision to


either accept or reject the null hypothesis H 0 .

• The comparison between the two population means include directive and non-
directive changes.

• Since the formulations of H 0 and H1 are important but difficult to implement,


thus we focus on the problems where both hypotheses are not given. For testing
problems where H 0 and H1 are given, you can straight away use the testing
procedures.

Central limit theorem – The theorem from which it is inferred that for a large
sample size ( n ≥ 30 ) , the shape of the sampling
distribution of x is approximately normal. Also, by the
same theorem, the shape of the sampling distribution of
p is approximately normal for a sample for which
np > 5 and nq > 5.

Hypothesis – A (statistical) hypothesis is an assertion or conjecture


about the distribution of one or more random variables.

Test statistics – A function of a sample of observations that provides the


basis for testing a statistical hypothesis.

Copyright © Open University Malaysia (OUM)


TOPIC 1 COMPARISON OF TWO POPULATION MEANS  23

Instruction: Answer Each Question in 15 Minutes

1. State the appropriate null and alternative hypotheses to test the following
claims:

(a) There is statistical difference between the mean ages of employees in


two different large companies.

(b) The mean of population A is less than 50 than the mean of population B.

(c) The average length of the work week in mining is longer than that in
manufacturing.

2. Determine the p-value for the following hypothesis tests of the difference
between two means given that the population variances are unknown.

(a) H1 : μ1 − μ2 > 0, n1 = 6, n2 = 10, test statistics = 1.3.

(b) H1 : μ1 − μ2 ≠ 0, n1 = 26, n2 = 35, test statistics = 1.8.

3. Determine the critical values that would be used for the following hypothesis
tests about the difference between two means given that the population
variances are unknown.

(a) H1 : μ1 − μ2 < 0, n1 = 36, n2 = 27, α = 0.01.

(b) H1 : μ1 − μ2 ≠ 0, n1 = 14, n2 = 15, α = 0.01.

4. Determine the test statistics that would be used in the following hypothesis
testing.

(a) n1 = 200, n2 = 200, σ given for both populations.

(b) n1 = 20, n2 = 15, σ unknown for both populations.

(c) n1 = 50, n2 = 65, σ unknown for both populations.

Copyright © Open University Malaysia (OUM)


24  TOPIC 1 COMPARISON OF TWO POPULATION MEANS

5. Sketch the rejection region and mark the critical value on the sketch for the
following hypothesis testing on difference mean where population variances
are assumed to be equal.

(a) H1 : μ1 − μ2 < 0, n1 = 45, n2 = 50, α = 0.01.

(b) H1 : μ1 − μ2 ≠ 0, n1 = 14, n2 = 15, α = 0.01.

(c) H1 : μ1 ≠ μ2 , n1 = 110, n2 = 112, α = 0.05.

(d) H1 : μ1 − μ2 > 0, n1 = 8, n2 = 12, α = 0.05.

Instruction: Answer Each Question in 30 Minutes

1. Many students have complained that soft-drink vending machine A which is


in the student recreation room dispenses a different amount of drink than
machine B which is located at the faculty lounge. To test this complaint, a
student randomly sampled several servings from each machine and carefully
measured them. The results obtained are as shown in the following table.

Standard
Machine Sample Mean
Deviation
A 10 5.38 1.59
B 12 5.92 0.83

(a) State the null and alternative hypotheses to conduct a hypothesis testing
regarding the students’ complaints.

(b) State the assumptions that should be made to conduct the test.

(c) At α = 0.05 level, what can you conclude regarding the complaints?

Copyright © Open University Malaysia (OUM)


TOPIC 1 COMPARISON OF TWO POPULATION MEANS  25

2. A study is arranged to compare the attitudes of two groups of nursing students


towards computers. Group 1 had taken a statistical methods course which
involved significant interaction through the use of a statistical package. Group
2 had taken a statistical methods course which did not use the computer. The
students’ attitudes are measured by administering the Computer Anxiety
Index (CAIN). The results are as follows:
Group 1 (with computers) n = 10 x = 60.3 s = 7.5
Group 2 (without computers) n = 15 x = 67.2 s = 2.1

Does the data show that the mean score for those with computer experience is
significantly less than the mean score for those without computer experience?
Use α = 0.05.

3. An experiment is performed to determine whether the average nicotine


content of a kind of cigarette exceeds that of another kind by 0.20mg. If
n1 = 50, cigarettes of the first kind has an average of x1 = 2.61mg with a
standard deviation of s1 = 0.12mg. The other kind with n2 = 40 cigarettes has
an average nicotine content of x2 = 2.38mg with a standard deviation of
s2 = 0.14mg.

(a) Formulate appropriate null and alternative hypotheses to be tested.

(b) Is the test right-tailed, left-tailed or two-tailed?

(c) Calculate the test statistics for the test.

(d) Calculate the p-value.

(e) Interpret your findings at a 0.05 significance level of hypothesis testing.

Copyright © Open University Malaysia (OUM)


Topic  Comparing
Two
2 Population
Proportions
LEARNING OUTCOMES
By the end of this topic, you should be able to:
1. Describe the concept of production comparison;
2. Formulate null hypothesis and alternative hypothesis for two
population proportions; and
3. Determine rejection region (RR), significance level and p-value for
two population proportions.

 INTRODUCTION
In Topic 1, we have discussed the comparison of parameter mean for two
populations. Now in this topic, we will discuss the comparison between two
population proportions. Happy reading!

2.1 CONCEPT OF PRODUCTION COMPARISON


Did you know that the comparison of proportion usually occurs in the case of a
binomial population? What does this mean?

Copyright © Open University Malaysia (OUM)


TOPIC 2 COMPARING TWO POPULATION PROPORTIONS  27

Binomial population means that the population consists of some subjects


with a certain attribute while others do not have that attribute.

Let us look at an example that demonstrates this.

Example 2.1:
Population 1 comprises employees from company A who had a heart attack.
They consist of those who smoke and those who do not smoke. Smoking is an
attribute in the population. The population proportion parameter of subjects who
smoke can be denoted as π1 (sample 1).

Population 2 is a typical population from company B where the proportion of


smokers is π 2 (sample 2).

The population proportion parameters, π1 and π 2 , are usually unknown and must
be estimated from the sample proportion.

For this purpose:

(a) A random sample of size n1 is chosen from population 1 with:

X1
P1 =
n1

as the proportion of smokers in sample 1.

(b) Then, a random sample of n2 is chosen from population 2 with:

X2
P2 =
n2

as the proportion of smokers in sample 2.

Both samples are assumed to be independent from each other. The comparison
of population proportion is based on the following terms:

π1 < π 2 and π1 > π 2

Copyright © Open University Malaysia (OUM)


28  TOPIC 2 COMPARING TWO POPULATION PROPORTIONS

Other comparisons are shown in Table 2.1.

Table 2.1: Examples of Comparison between Population Proportions

Assertions of Comparison between


Mathematical Expression
Two Population Proportions
1. The proportion of smokers in population B is π 2 < π1
smaller than that of population A.
2. The proportion of smokers in population B is π 2 > π1
greater than that of population A.
3. The proportion of smokers in population B and π 2 = π1
population A are the same.
4. The proportion of smokers in population B and π 2 ≠ π1
population A are not the same.

SELF-CHECK 2.1

Define binomial population in your own words.

ACTIVITY 2.1

In your opinion, what are the parameter and attribute compared in


Example 2.1? Discuss your answer in the myINSPIRE forum.

2.2 NULL AND ALTERNATIVE HYPOTHESES


After identifying the forms of proportion comparisons, it is important to state
correctly the corresponding mathematical expression of the comparison as shown
in Table 2.1. The next step is to write or formulate the appropriate null hypothesis,
H 0 , and alternative hypothesis, H1 . The simple rule is that the mathematical
expression which does not contain an equality sign is used to formulate the
alternative hypothesis. The null hypothesis is then formulated by complementing
the expression in the alternative hypothesis.

Copyright © Open University Malaysia (OUM)


TOPIC 2 COMPARING TWO POPULATION PROPORTIONS  29

Let us look at Table 2.2 which displays the formulation of hypothesis for various
comparisons between two population proportions.

Table 2.2: Hypothesis Statements

Mathematical H 0 and H 1
Form of Comparison Values
Expressions
1. Greater than, > π 2 > π1 H1 : π 2 > π 1 ; H 0 : π 2 = π 1
2. Less than, < π 2 < π1 H1 : π 2 < π 1 ; H 0 : π 2 = π 1
3. Equals to, = π 2 = π1 H1 : π 2 ≠ π 1 ; H 0 : π 2 = π 1
4. Greater than or equal, ≥ π 2 ≥ π1 H1 : π 2 < π 1 ; H 0 : π 2 ≥ π 1
5. Less than or equal, ≤ π 2 ≤ π1 H1 : π 2 > π 1 ; H 0 : π 2 ≤ π 1
6. Not equal, ≠ π 2 ≠ π1 H1 : π 2 ≠ π 1 ; H 0 : π 2 = π 1

Note that the expressions of H 0 usually contain complete equality and incomplete
inequality.

2.2.1 Adjustments to Hypothesis


Adjustments to the hypothesis need to be made to match the test statistics. After
that, we could identify the distribution of the test statistics before carrying out the
procedures in the hypothesis testing.

2.2.2 Selection of Hypothesis


What might happen if the formulated hypothesis is incorrect? In a hypothesis
testing, a problem which involves parameters from two populations, the
specification of the alternative hypothesis usually matches the comparison of the
parameters which need to be tested. The lists of parameter comparisons were given
in Tables 2.1 and 2.2.

The original objective is to either accept or reject H1. However, the measurement
in hypothesis testing is rather difficult for this hypothesis since the value is stated
in a specified interval.

Copyright © Open University Malaysia (OUM)


30  TOPIC 2 COMPARING TWO POPULATION PROPORTIONS

Thus, statistical testing is done onto H 0 . The implication is that if we reject H 0 ,


this means that H1 is accepted. Hence, the formulation of H 0 and H1 (as in
Table 2.2) or the adjustments have to be made with care, so that the decisions of the
test, which is based on the random sample, conforms to (as if it supports) H1 .

Let us look at Table 2.3 which shows the three categories of statements for the
testing of population proportion parameter.

Table 2.3: Three Categories of Statements for the Testing of


Population Proportion Parameter

Category Description Example


U1: Statement H 0 is as stated in the The statement “the proportion of
involving equality statement and H1 is defective electric light bulbs in
in value, sign is “=” population 1 is the same as the
the opposite.
proportion of defective electric light
bulbs in population 2.”
H 0 : π 2 = π1 H 0 : π 2 − π1 = 0

H1 : π 2 ≠ π 1 H1 : π 2 − π 1 ≠ 0

U2: Statement H 0 is as stated in the The statement “the proportion of


involving statement and H1 is defective electric light bulbs in
inequality in value, population 2 is at least the same as the
the opposite.
sign is “ ≤ ” or “ ≥ proportion of defective electric light
” bulbs in population 1.”
H 0 : π 2 ≥ π1 H 0 : π 2 − π1 ≥ 0

H1 : π 2 < π 1 H1 : π 2 − π 1 < 0

U3: Statement H1 is as stated in the The statement “the proportion of


involving strict statement and H 0 is defective electric light bulbs in
inequality in value, population 2 exceeds the proportion of
the opposite.
sign is “<”or “>” defective electric light bulbs in
population 1” (write this statement as
H1 , and the complementary as H 0 ).
H1 : π 2 > π 1 H1 : π 2 − π 1 > 0

H 0 : π 2 ≤ π1 H 0 : π 2 − π1 ≤ 0

Copyright © Open University Malaysia (OUM)


TOPIC 2 COMPARING TWO POPULATION PROPORTIONS  31

Note that every H 0 statement contains the equality sign “=”. Let us look at another
example.

Example 2.2:
A new technique in teaching statistics has been designed by a professor at a local
university. This technique was tested on 150 students at a private college with
60% of the students admitting that the technique is very effective in learning
statistics. For comparison, another group of 120 students in the same private
college is taught using the traditional technique and 40% of them understand
statistics. Write appropriate null and alternative hypotheses to test the
effectiveness of the new technique.

Answer:
From the problem, we observed that:

(a) There is no observation made;

(b) The rates of 60% and 40% indicate that the population proportion is the
parameter being compared; and

(c) In this case, πˆ 2 = 0.6 is the estimate of population proportion 2 and is


greater than πˆ1 = 0.4 which is the estimate of population proportion 1.

This situation fits the notion that the new technique is effective. Assume that:

(a) The group of 150 students learning statistics using the new method is a
random sample from population 2.

(b) The other 120 students are a random sample from population 1.

Here, the assumption is that a random sample is independent.

From the previous observations and selection of hypothesis statement (U3), the
following is the appropriate hypothesis:
H1 : π 2 > π1 H :π −π > 0
⇔ 1 2 1
H 0 : π 2 ≤ π1 H 0 : π 2 ≤ π1 ≤ 0

Copyright © Open University Malaysia (OUM)


32  TOPIC 2 COMPARING TWO POPULATION PROPORTIONS

SELF-CHECK 2.2

1. How do we formulate the alternative hypothesis?


2. What are the three categories of statements for the testing of
population proportion parameter?

ACTIVITY 2.2

Name two binomial populations which have the same attributes. Also
state the attributes. Then, compare the proportion of the attributes by
choosing one of the comparisons and mathematical expressions shown in
Table 2.3. Share your answer for discussion in the myINSPIRE forum.

2.3 REJECTION REGION (RR), SIGNIFICANCE


LEVEL AND p-VALUE
The test statistics is chosen based on the population parameter discussed in the
problem. It is actually the point estimator for the population parameter being
discussed. For example, in the testing of population means difference as stated in
the null hypothesis:

H 0 : π 2 − π1 = 0

Thus, the test statistics used is the difference between the sample proportions
obtained from the respective populations, which is:

Statistics B = P2 − P1

ACTIVITY 2.3

In your opinion, what is the difference between hypothesis testing for


mean parameter and proportion parameter? Discuss the answer in the
myINSPIRE forum.

Copyright © Open University Malaysia (OUM)


TOPIC 2 COMPARING TWO POPULATION PROPORTIONS  33

2.3.1 Test Statistics for Testing Difference in


Population Proportions
For a large sample size of both samples and by central limit theorem (refer to
Subtopic 1.3 in Topic 1), then:

Statistics B = P2 − P1 follows a normal or approximately normal distribution


( )
N μ B , σ B2 where μB = π 2 − π1 .

When H 0 is true, the variance σ B2 is given by:

1 1 
σ B2 = P (1 − P )  +  Formula 2.1a
 n1 n2 

n1P1 + n2 P2 x1 + x2
with P = = Formula 2.1b
n1 + n2 n1 + n2

Such that:
X
(a) P1 = is the attribute proportion for sample 1 of size n1 ; and
n
X
(b) P2 = is the attribute proportion for sample 2 of size n2 .
n

However, a normal approximation is good if the following conditions are satisfied:

(a) n1π 1 ≥ 5, n1 (1 − π 1 ) ≥ 5; and

(b) n2π 2 ≥ 5, n2 (1 − π 2 ) ≥ 5.

Take note that the larger the sample size, the better the approximation.

Copyright © Open University Malaysia (OUM)


34  TOPIC 2 COMPARING TWO POPULATION PROPORTIONS

Hence, when H 0 is true, the test statistics is a Z score where:

P2 − P1
Z= Formula 2.2
1 1 
P (1 − P )  + 
 n1 n2 

has a standard normal distribution N(0,1).

However, if both conditions are not satisfied, the probability of rejecting H 0 can
be calculated by using the binomial distribution table. Nevertheless, in this topic,
discussion is limited to a random sample of a large sample size.

2.3.2 Acceptance and Rejection of Null Hypothesis


The technique and procedure for hypothesis testing on population proportion
parameter is the same as the case of mean parameter, especially for a large sample
size.

Thus, this topic will skip discussions on the following aspects:

(a) Rejection region (RR);

(b) Probability p-value; and

(c) Type I error and Type II error.

Good comprehension of the technique and procedure of hypothesis testing for mean
difference is important to help you learn and understand hypothesis testing for
proportion difference. Let us look at Example 2.3.

Copyright © Open University Malaysia (OUM)


TOPIC 2 COMPARING TWO POPULATION PROPORTIONS  35

Example 2.3:
Inspection is carried out on 200 items produced by company A and 2% is found
to be defective. A sample of 300 items from company B contains 3% defective
items. Can we conclude that items from company A are better? Test at the 0.05
level of significance.

Answer:

Step 1: The percentage of defective items is of interest. Thus, the parameter


to be tested in the hypothesis is the population proportion. Suppose
that π 2 is the proportion of defective items in the population of
company A, and π1 is the proportion of defective items in the
population of company B.

Step 2: The sample sizes obtained from both populations are large, thus
the distribution for sample proportion is assumed to be normal
distribution.

Step 3: Hypothesis formulation:

In this problem, it is stated that:

“Items in company A are better than items in company B” ⇔ π 2 < π1

Thus, we write:

H1 : π 2 < π1 against H 0 : π 2 ≥ π1 . This is a one-tailed test (left-tailed).

Then,
H 0 : π 2 ≥ π1 H 0 : π 2 − π1 ≥ 0

H1 : π 2 < π1 H1 : π 2 − π1 < 0

Copyright © Open University Malaysia (OUM)


36  TOPIC 2 COMPARING TWO POPULATION PROPORTIONS

Step 4: Significance level α = 0.05 is given. Thus, from the standard normal
table, the critical value for a one-tailed test (to the left):

zα = −1.645

Step 5: Test statistics and the distribution:

Both sample sizes are large.


4 9
πˆ 2 = P2 = = 0.02 , πˆ1 = P1 = = 0.03 ,
200 300

4 + 9 13
P= = = 0.026
500 500

Hence, the test statistics is a Z score, where:


P2 − P1 − 0
Z=
1 1 
P (1 − P ) + 
 n1 n 2 

has a standard normal distribution N(0,1).


P2 − P1 − 0
Z=
 1 1 
0.026(0.974 ) + 
 300 200 

Step 6: Test decision when H 0 is true. Based on the given sample


information,
0.02 − 0.03
Zc = = –0.688 ≈ −0.69
 1 1 
0.026 ( 0.974 )  + 
 300 200 

Copyright © Open University Malaysia (OUM)


TOPIC 2 COMPARING TWO POPULATION PROPORTIONS  37

Test decision: Since z = −0.69 > z0.05 = −1.645, then

Do not reject H 0 at 0.05 significance level. This means we reject the


H1 : π 2 < π1 at 5% level of significance.

The following claim is rejected: The proportion of defective items is


smaller in company A than in company B.

Step 7: Test conclusion: There is no evidence from the sample to conclude


that items in company A are better than in company B.

• The comparison of proportion usually occurs in the case of a binomial


population.

• Binomial population means that the population consists of some subjects with
a certain attribute while others do not have that attribute.

• The simple rule is that the mathematical expression which does not contain an
equality sign is used to formulate the alternative hypothesis. The null hypothesis
is then formulated by complementing the expression in the alternative
hypothesis.

• Hypothesis testing procedures for a single population proportion are applicable


for two population proportions.

• Hypothesis formulation and adjustments are guided by the direction of changes


from the proportion in one population to a proportion in another population.

• The test statistics used is the difference between the sample proportions
obtained from the respective populations, which is:

Statistics B = P2 − P1

• For a large sample size taken from both samples, normal distribution can be
used as an approximation.

Copyright © Open University Malaysia (OUM)


38  TOPIC 2 COMPARING TWO POPULATION PROPORTIONS

Alternative hypothesis, H1 – A claim about a population parameter that will be


true if the null hypothesis is false.

Null hypothesis, H 0 – A claim about a population parameter that is


assumed to be true until proven otherwise.

Instruction: Answer Each Question in 15 Minutes

1. State the null hypothesis, H 0 , and the alternative hypothesis, H1 , which


would be used to test these claims:

(a) There is no difference between the proportions of men and women who
will vote for the incumbent in next month’s election.

(b) The percentage of boys who cut classes is greater than the percentage of
girls who cut classes.

(c) The percentage of college students who drive an old car is higher than
the percentage of non-college people of the same age who drive an old
car.

2. Determine the critical region and critical value(s) which would be used to test
the following hypotheses when z is used as the test statistics.

(a) H 0 : π1 = π 2 vs. H1 : π1 > π 2 with α = 0.05.

(b) H0 : π1 = π 2 vs. H1 : π1 ≠ π 2 with α = 0.01.

(c) H 0 : π1 − π 2 = 0 vs. H1 : π1 − π 2 < 0 with α = 0.01.

3. Describe the shape of the sampling distribution of p1 − p2 for two large


samples. Compute the mean and standard deviations of this sampling
distribution.

4. What conditions determined that both samples are large and normal
approximation can be applied?

Copyright © Open University Malaysia (OUM)


TOPIC 2 COMPARING TWO POPULATION PROPORTIONS  39

5. Independent random samples of n1 = 140 and n2 = 140 observations were


randomly selected from binomial populations 1 and 2 respectively. Sample 1
had 74 successes and sample 2 had 81 successes.

(a) Suppose you have no preconceived idea as to whether parameter π1 or


π 2 is larger, but you want to detect only the differences between the two
parameters if these exist. What should you choose as the alternative
hypothesis for a statistical test? What about the null hypothesis?

(b) Suppose for some practical reasons, you know that π1 cannot be larger
than π 2 .

(i) Given this knowledge, what should you choose for the alternative
hypothesis? What about the null hypothesis?

(ii) Does your alternative hypothesis imply a one-tailed or two-tailed


test?

Instruction: Answer Each Question in 30 Minutes

1. A study of the Y2K problem investigated consumer opinions on what should


be done to handle the situation and who should be responsible for monitoring
the progress. In response to the question, “Who should monitor the report on
progress in solving the Y2K problem?”, 34% of the respondents surveyed felt
that is was the government’s responsibility. Let us say you believed that
differences in opinion exist between rural and city dwellers on whether the
government should monitor the Y2K problem. A study asks the above
question to 250 heads of households in the city and 200 rural heads of
households. You found out that 100 of the city dwellers and 64 of the rural
dwellers believed that it was the government’s responsibility. Is there a
significant difference in the opinions of the two groups? Use α = 0.05.
(a) Solve using the p-value approach; and
(b) Solve using the classical approach.

Copyright © Open University Malaysia (OUM)


40  TOPIC 2 COMPARING TWO POPULATION PROPORTIONS

2. A researcher aims to estimate the difference between the percentages of users


of two brands of toothpaste who will never switch to other brands. In a sample
of 500 users of toothpaste A, 100 users said that they would never switch to
another brand.

Meanwhile, in a sample of 400 users of toothpaste B, 68 users said that they


would never switch to another brand. At the 1% significance level, can we
conclude that the proportion of users of toothpaste A who will never switch
to another toothpaste is higher than that of toothpaste B?

3. An article reported that smoking boosts the death risk of diabetics. Suppose
that as a follow-up study, we investigate the smoking rates for male and
female diabetics and obtain the following data.

Gender n Number Who Smoke


Male 500 215
Female 500 170

(a) Formulate the null and alternative hypotheses to test whether the
smoking rate is higher for males than for females.

(b) Calculate the test statistics and the p-value.

(c) State the conclusion at a 0.05 level of significance and at a 0.01 level of
significance.

Copyright © Open University Malaysia (OUM)


Topic  Hypothesis
Testing on
3 Population
Variance
LEARNING OUTCOMES
By the end of this topic, you should be able to:
1. Explain the properties of chi-square and F distributions;
2. Apply the chi-square and F distribution tables;
3. Construct the interval estimation of variance for two populations; and
4. Compare variances of two populations.

 INTRODUCTION
Previously, you have been exposed to several methods of testing and estimating a
population mean. Similarly, they might be interested in making inferences on
changes in population; therefore, the correct parameter to be used in this case is the
population variance, σ 2 . There are several reasons of important to test hypotheses
concerning the variances of populations. Inferences on variance can be applied in
daily life.

Copyright © Open University Malaysia (OUM)


42  TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE

As an example, a quality control engineer needs to monitor the consistency of


products manufactured by the factory as this ensures that the products meet the
required specifications. One of the methods for consistency checking is calculating
the variance of size, weight or volume of the product. If the variation in these
measurements is large, this means more products will be outside the specification
limits.

In the financial area, investors use variation in the returns from portfolio stock, bond
or any type of investments as a measure on uncertainties and risks. With this
method, investors will be able to reduce the risk of investment.

Two types of distributions will be used:

(a) Chi-square distribution (single-population variance); and

(b) F distribution (at least two distributions variance).

Both distributions are non-symmetrical and skewed to the right. The chi-square
distribution is used for testing the hypothesis on a single population variance.
σ 2 , the population standard deviation, σ , and to construct their confidence
intervals.

On the other hand, the F distribution is required for studies involving two or more
independent populations. The sample variance, s12 , will be calculated and used as a
point estimation for the first population variance, σ12 , and the second sample
variance, s22 , will be calculated and used as a point estimation for the second
population variance, σ 22 .

3.1 CHI-SQUARE DISTRIBUTION


This first subtopic will explain to you the properties, distribution table and
hypothesis testing on population variance of chi-square distribution.

Copyright © Open University Malaysia (OUM)


TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE  43

3.1.1 Properties of Chi-square Distribution


The value of sample mean, x , and sample variance, s 2 , differ from one sample to
the other. It is also important to know the properties of the sample variance. Let us
look at Theorem 1 which explains the properties of sample variance, s 2 .

Theorem 1
Suppose a random sample, X of size n is chosen from a normal distribution with
mean μ and variance σ 2 , hence X can be defined as:

X=
( n − 1) s 2
σ2

a random variable that follows a chi-square distribution with v = n – 1 degrees of


freedom. For this distribution, X only takes positive values starting from zero at the
horizontal axis. X is usually written in Greek symbol, that is χ 2 .

Graph of f (x) for various values of v is shown in Figure 3.1.

Figure 3.1: Graph of f(x) for various values of v

Copyright © Open University Malaysia (OUM)


44  TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE

The bigger the value of v, the flatter the density curve is, which is skewed to the
right.

Using v = 1, 2, 3 and 4, sketch the graph of f (x) versus X separately. What can you
observe? Give your comment.

SELF-CHECK 3.1

Explain the properties of chi-square distribution.

3.1.2 Chi-square Distribution Table

The chi-square distribution, χ 2 (v) table, is created based on the degrees of


freedom, v = n – 1 and α (see Table 3.1).

Table 3.1: Relationship between Degrees of Freedom and χ c2

ν Large α χ c2 Small α χ c2

5 0.95 1.145 0.05 11.07


5 0.975 0.831 0.025 12.833
20 0.95 10.851 0.05 31.410
25 0.975 13.120 0.025 40.646

The values of χ 2 variable satisfy the equation:

Pr ( χ 2 > χc2 ) = α , 0 ≤ α ≤ 1

Copyright © Open University Malaysia (OUM)


TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE  45

To facilitate the usage of Table 3.1, we use the term “small α” if its values are in
the range of 0 ≤ α ≥ 0.1 and the term “large α” if its values are in the
complementary interval of 0.9 ≤ α ≥ 1. Usually, the χc2 values are big for small α,
and χc2 is small when α is large. Let us look at two examples in Figure 3.2 where
Pr ( χ(2ν ) ≥ χc2 ) = α .

(a) (b)

Figure 3.2: Examples of “small α” and “large α”

Based on Table 3.1, it can be seen that for the same v degrees of freedom (v = 5),
the χc2 value approaches zero when the value of α increases for the “large α” case.

On the other hand, the value of χc2 increases and approaches ∞ when α value
decreases for the “small α” case. This is an important property especially when α
is used as significance level in hypothesis testing or confidence interval
construction for population, σ 2 .

Copyright © Open University Malaysia (OUM)


46  TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE

Meanwhile, Table 3.2 shows part of χc2 values for some α values and the
corresponding degrees of freedom v where ν = n –1.

Table 3.2: Relationship between v, α and χ


2

Degrees of Probability (or Area Under χ 2 Distribution Curve on the


Freedom,
ν Right-hand Side of the Critical Point for a Given χ 2 Value)

0.975 0.95 0.90 0.10 0.05 0.030

χ 2 Value
1
2
.
.
11 4.575 5.578 17.275 19.675
12 5.226 6.304 18.549 21.026
13 5.892 7.042 19.812 22.362
14 22.362 7.790 21.064 33.685
.

Table 3.2 was constructed in a similar way as the t-table that contains the t values.
The top row of Table 3.2 represents the right-hand side section of the point as in
Figure 3.4, in reference to the rows with the appropriate degrees of freedom.
2
If v = 12 and α = 0.05 then χ0.05 = 21.026 and if v = 12 and α = 0.95, the
2
χ0.95 = 5.226 . Since the chi-square distribution is non-symmetrical, the values on
the left-hand side of the distribution need to be determined similar to how the values
in the right-hand side of the distribution are determined from Table 3.2.

Copyright © Open University Malaysia (OUM)


TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE  47

2 2
Based on two values of χ0.05 = 21.026 and χ0.95 = 5.226 , it is known that

Pr (χ 2 > 21.026) = 0.05

Pr (χ 2 > 5.226) = 0.95

with degrees of freedom.

Based on these two statements,

Pr (5.226 < χ 2 < 21.026) = 0.90

The values and area for chi-square distribution with v = 12 degrees of freedom are
shown in Figure 3.3(a). Since Pr (χ 2 > 5.226) = 0.95 , hence Pr (χ 2 < 5.226) =
0.05.

Figure 3.3(a): Values and area for chi-square distribution with v = 12 degrees of freedom

It is important to note that the χ 2 point represents its position on the horizontal
axis. As such, all points and probabilities/areas in the Table 3.2 satisfy

Pr ( χ (2ν ) ≥ χ c2 ) = α .

The non-symmetrical property of chi-square distribution causes the points to


decrease with the increasing value of α and increase when α decreases. As such, a
general statement can be written,

Pr ( χ12−α /2 < χ 2 < χα2 /2 ) = 1 − α

Copyright © Open University Malaysia (OUM)


48  TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE

For example, when α = 0.05,


2
Pr ( χ0.975 < χ 2 < χ0.025
2
) = 0.95

Let us refer to the properties in Figure 3.3(b).

Figure 3.3(b): Values and area for chi-square distribution when α = 0.05

Let us look at two examples to further understand this concept.

Example 3.1:
2 2
Suppose that n = 20, determine χ 0.975 and χ 0.025 .

Answer:

When n = 20, v = n – 1 = 20 – 1 = 19 degrees of freedom.

From the chi-square distribution table (see Appendix 3.1),


2
χ0.975 = 8.907
2
χ0.025 = 32.852

Copyright © Open University Malaysia (OUM)


TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE  49

Figure 3.4 clearly depicts the area on the left side of point 8.907 is 0.975 and the
area on the right side of point 32.852 is 0.025.

Figure 3.4: Areas on the left and right

Example 3.2:
Suppose that X and Y are independent random variables distributed as χ 2 (2) and
χ 2 (6) respectively, determine the probability of:

(a) X > 7.38 (b) X < 0.103 (c) Y < 22.46 (d) X + Y > 2.18

Answer:

(a) It is known that X is distributed as χ 2 (2). From Appendix 3.1, the value of
0.025 from the distribution was situated on the right side of point 7.378
(column α = 0.025, row v = 2)
∴ Pr(X > 7.378) = 0.025

(b) Pr(X > 0.103) = 0.95 (based on column α = 0.95, row v = 2)


∴ Pr(X < 0.103) = 1 – 0.95 = 0.05

Copyright © Open University Malaysia (OUM)


50  TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE

(c) Y~ χ 2 (6). Hence, Pr(Y > 22.46) = 0.001 (from column α = 0.001,
row v = 6)
∴ Pr(Y < 22.46) = 1 – 0.001 = 0.999

(d) X + Y ~ χ 2 (2 + 6). From Appendix 3.1, with column = 0.975 row = 8

∴ Pr(X + Y > 2.18) = 0.975

EXERCISE 3.1

Explain the meaning of the following figures:

3.1.3 Hypothesis Testing on Population Variance


In most cases, population variance is a parameter with a rarely-known value. We
are interested to test if a sample taken from a normal population (parent) contains
variance σ 02 that is given/assumed a value/quantity. If a random sample with size n
is drawn from a normal population with σ 2 as the variance, we can prove that
( n − 1) S 2 (n − 1) S 2
2
 χ 2 (n − 1) statistics. This means 2
follows a χ 2 (n − 1) distribution
σ σ
and can be used as a test statistics if the null hypothesis is true.

Copyright © Open University Malaysia (OUM)


TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE  51

Statement 1
To test whether a random sample of size n with sample variance, S 2 was drawn
(n − 1) S 2
from a normal population with variance σ 2 , we use χ =
2

σ2
statistics, which
is distributed as χ 2 (n − 1) when the null hypothesis is true.

Figure 3.5 shows three critical regions to test H 0 : σ 2 = σ 02 versus

(a) H1 : σ 2 ≠ σ 02 (b) H1 : σ 2 < σ 02 (c) H1 : σ 2 > σ 02

(a) H1 : σ 2 ≠ σ 02 (b) H1 : σ 2 < σ 02 (c) H1 : σ 2 > σ 02

Figure 3.5: Three critical regions to test H 0 : σ 2 = σ 02

Let us look at an example.

Example 3.3: Rejection Region (RR)

(a) Suppose that we want to find the RR region for a one-sided right side
(small) hypothesis testing at 5% significance level (α = 0.05) with sample
size, n = 9.

It is known that Pr (χ 2 > χ 5%


2
(9)) = 0.05, hence from Appendix 3.1 (critical
2
value), χ 5% (9) = 16.92. The graph is shown in Figure 3.8.

Copyright © Open University Malaysia (OUM)


52  TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE

Figure 3.6: Pr (χ 2 > χ 5%


2
(9)) = 0.05

(b) Find the critical region for a one-sided left side (large α) at 1% level (α =
0.01) and sample size n = 21.

We know that Pr (χ 2 > χ 99%


2
(21)) = 1 − α = 0.99, hence, the critical value,
2
χ 99% (21) = 8.897 (see Figure 3.7).

Figure 3.7: Pr (χ 2 > χ 99%


2
(21)) = 1 − α = 0.99

Copyright © Open University Malaysia (OUM)


TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE  53

(c) Determine the critical value at α = 0.05 level and sample size, n = 20, for a
two-sided test.

(i) Step I (see Figure 3.8)

Figure 3.8: First step to determine critical value at α = 0.05 level and
sample size, n = 20 for a two-sided test

(ii) Step II (see Figure 3.9)

Figure 3.9: Second step to determine critical value at α = 0.05 level and
sample size, n = 20 for a two-sided test

Copyright © Open University Malaysia (OUM)


54  TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE

Table 3.3 displays the RR for various combinations of null hypothesis, H 0 , and
alternative hypothesis, H1.

Table 3.3: Rejection Region (RR) for Various Combinations of H 0 and H1

Alternative Rejection Region


Null Hypothesis Test Statistics
Hypothesis (RR)
(a) One-sided (a) One-sided
(right) (right)
H1 : σ 2 > σ 02 χ 2 ≥ χα2 ,n−1
(b) One-sided (left) (b) One-sided (left)
2
H0 : σ = σ 2
0 H1 : σ 2 < σ 02 χ 2 ≤ χ12−α ,n −1
(c) Two-sided (n − 1) s 2 (c) Two-sided
χ2 =
H1 : σ 2 ≠ σ 02 σ 2
χ 2 ≥ χα2 ,n−1
0 or
2 2
χ ≤χ 1−α , n −1

H 0 : σ 2 ≥ σ 02 H1 : σ 2 < σ 02 χ 2 ≤ χ12−α ,n−1

H 0 : σ 2 ≤ σ 02 H1 : σ 2 > σ 02 χ 2 ≥ χ12−α ,n−1

Let us look at Example 3.4.

Example 3.4:
A normal population has a variance of 9.0. A random sample of size 9 and
variance 8.01 was drawn from a normal population. Determine whether the
variance from this random sample is 9.0. Test at 5% level of significance.

Answer:
There are a few steps to be considered to answer this question:

Step 1: Determine the Parameter of Interest


The population parameter is the population variance, σ 2 . Our result
will depend on the value of the sample variance; that is 8.01.

Copyright © Open University Malaysia (OUM)


TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE  55

Step 2: Gather All Available Information


The population is normally distributed with mean, μ (not included in
the test) and assumed variance for testing, s02 = 9.0.

Step 3: Construct Hypothesis Statements


The population variance is given as 9.0. Since the statement does not
state to test larger or smaller, a two-sided test will be carried out, that
is:

H 0 : σ 2 = 9.0

H1 : σ 2 ≠ 9.0

Step 4: Determine the Significance Level and Rejection Region


The two-sided hypothesis will be performed at 5% level of
significance; the chi-square distribution has n – 1 = 9 – 1 = 8 degrees
2
of freedom. From Appendix 3.1, the critical value χ 2.5% (8) = 17.53
2
and χ97.5% (8) = 2.180. We will reject the null hypothesis if:

χ 2 < χ97.5%
2
(8) or χ 2 > χ 2.5%
2
(8)

Step 5: Calculate the Test Statistics

2 (n − 1) S 2 8(8.01)
Test statistics, χ = 2
= = 7.12
σ 9

Step 6: The Result


Since the value of test statistics, χ 2 is within the acceptance region,
that is 2.180 < 7.12 < 17.53, therefore, do not reject the H 0 .

Step 7: Conclusion
In conclusion, we have evidence to state that the sample is from
a normal population with population variance, σ 2 = 9.0 (see
Figure 3.10).

Copyright © Open University Malaysia (OUM)


56  TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE

Figure 3.10: Final answer

Let us try Exercise 3.2.

EXERCISE 3.2

Previous experience has shown a certain population was distributed as a


normal with variance 42. A random sample of size 16 drawn gave a
variance value of 18.4. Is there any significant evidence to suggest that
the current population variance is less than 42?

3.2 F DISTRIBUTION
Now, let us move on to F distribution by learning about its properties and table. Let
us continue with the lesson.

3.2.1 Properties of F Distribution


F distribution has two different degrees of freedom known as v1 = n1 − 1 and
v2 = n2 − 1. Although the F distribution has several common properties, each pair
of v1 and v2 produces different curve. The common type of curve is displayed in
Figure 3.11.

Copyright © Open University Malaysia (OUM)


TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE  57

Figure 3.11: Common type of curve for F distribution

Based on Figure 3.11, it shows that the F distribution is non-symmetrical and


skewed to the right (similar to the chi-square distribution). The f values as in the
figure is non-negative since the quantity of s12 , s22 , σ12 , σ 22 , required in f statistics
is always positive. Hypothesis testing on σ12 and σ 22 were based on F distribution.
This distribution is also important for analysis of variance (ANOVA) that will be
learned in Topic 4.

Chi-square distribution is suitable to test a single population variance while the F


distribution could be used to test variances of two populations. These two
populations must be independent and normally distributed.

The F distribution was introduced by Sir Ronald A. Fisher. In general, the F


distribution can be viewed as a sampling distribution for the ratio of two
independent random variables of chi-square distribution divided by their respective
degrees of freedom. This is shown in Theorem 2.

Theorem 2
Let U and V be two independent random variables with chi-squared distribution
given that v1 and v2 degrees of freedom, respectively. Then,

U / v1
F=
V / v2

becomes a random variable that follows the F distribution with v1 and v2 degrees
of freedom.

Copyright © Open University Malaysia (OUM)


58  TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE

SELF-CHECK 3.2

Explain the properties of the F distribution.

3.2.2 F Distribution Table


The table for the F distribution is prepared based on two degrees of freedom, which
are v1 = n1 − 1 and v2 = n2 − 1. The contents of the table are values of the F variable
satisfying the following equation:

Pr ( F ≥ Fν1,ν 2 ;α ) = α .

The critical value of the F distribution lies on the right side of the function graph
(see Figure 3.11). For each pair of v1 and v2 ; the first, second and third row in the
F distribution table are critical values at 0.05, 0.025 and 0.01 significance levels.
To determine the critical values on the left side, the following equation of
relationship has been applied:
1
Fν1,ν 2 ;α =
Fν 2,ν1;1−α

To facilitate the usage of the F distribution table (see http://www.z-table.com/f-


distribution-table.html), we will observe several critical values of F such as:

(a) v1 is fixed and v2 varies, significance level is fixed:

v1 v2 Fν1 ,ν 2 ;0.05

6 5 4.950
6 6 4.284
6 7 3.866
6 8 3.581

Comment: The F critical value decreases when v1 is fixed and v2 varied.

Copyright © Open University Malaysia (OUM)


TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE  59

(b) v1 varies and v2 is fixed, significance level is fixed:

v1 v2 Fν1 ,ν 2 ;0.05

5 6 4.387
6 6 4.284
7 6 4.207
8 6 4.147

Comment: The F critical value decreases when v1 is varied and v2 is fixed.

(c) v1 and v2 fixed, significance level varies:

v1 v2 Fν1 ,ν 2 ;0.05 Fν1 ,ν 2 ;0.025 Fν1 ,ν 2 ;0.01

6 6 4.284 5.820 8.466


7 7 3.787 4.995 6.993
8 8 3.438 4.433 6.029
9 9 3.179 4.026 5.351

Comment: The F critical value increases when significance level decreases


and v1 , v2 fixed.

(d) v1 fixed and v2 fixed, significance level varies:

v1 v2 Fν1 ,ν 2 ;0.05 Fν1 ,ν 2 ;0.025 Fν1 ,ν 2 ;0.01

6 6 4.284 5.820 8.466


7 6 4.207 5.695 8.260
8 6 4.147 5.600 8.102
9 6 4.099 5.523 7.976

Comment: The F critical value also increases when the significance level
decreases, v1 varies and v2 is fixed.

Copyright © Open University Malaysia (OUM)


60  TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE

(e) v1 fixed and v2 changes, significance level changes:

v1 v2 Fν1 ,ν 2 ;0.05 Fν1 ,ν 2 ;0.025 Fν1 ,ν 2 ;0.01

6 6 4.284 5.820 8.466


6 7 3.866 5.119 7.191
6 8 3.581 4.652 6.371
6 9 3.374 4.320 5.802

Comment: The F values increase when significance level decreases, ν1 fixed


and ν2 changes.

1
Using special property of F distribution, that is, Fν1,ν 2 ;α = we can find the
Fν 2,ν1;1−α
values of F distribution at α = 0.95, 0.975 and 0.99. Let us look at Example 3.5.

Example 3.5:
Determine the value of F10,11,α = 0.95

Answer:
Using the property,
1 1 1
F10,11,0.95 = = = = 0.3398
F11,10,1−0.95 F11,10,0.05 2.943

Copyright © Open University Malaysia (OUM)


TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE  61

EXERCISE 3.3

1. Determine the following values based on the F distribution table:


(a) F0.05(3,16) (b) F0.05(12,25)

(c) F0.01(4,15) (d) F0.01(7,4)

2. Determine the values (using the F distribution table) that satisfy the
equation below:
(a) (6,14) = 3.50 (b) (10,32) = 2.93
(c) (24,38) = 1.81 (d) (2,24) = 5.61

Please refer to the F distribution table at http://www.z-table.com/


f-distribution-table.html.

3.3 INTERVAL ESTIMATION OF VARIANCE


FOR TWO POPULATIONS
If S12 and S22 are variances for two independent random samples of size n1 and n2
taken from normal populations with variances σ12 and σ 22 respectively, then

σ 22 S12
F=
σ 12 S22

is a random variable following an F distribution with n1 − 1 and n2 − 2 degrees of


freedom.

Copyright © Open University Malaysia (OUM)


62  TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE

Hence, we write the equation as follows where the illustration of the equation could
be seen as in Figure 3.12.

 σ 2S 2 
Pr  F1−α /2,n1 −1,n2 −1 < 22 12 < Fα /2,n1 −1,n2 −1  = 1 − α
 σ 1 S2 

Figure 3.12: Illustration of the equation

1
Since F1−α /2,n1 −1,n2 −1 = then,
Fα /2,n2 −1,n1 −1

 σ 2S 2 
Pr  F1−α /2 (ν 1 ,ν 2 ) < 22 12 < Fα /2 (ν 1 ,ν 2 )  = 1 − α
 σ1 S2 

 S 22 σ 22 
⇔ Pr  2 F1−α /2 (ν 1 ,ν 2 ) < 2 < Fα /2 (ν 1 ,ν 2 )  = 1 − α
 S1 σ1 

we obtained Theorem 3.

Theorem 3
If s12 and s22 are variances for independent random variables from a normal
population, then

S12 1 σ 12 S12
⋅ < < ⋅ Fα /2,n2 −1,n1 −1
S 22 Fα /2,n1 −1,n2 −1 σ 22 S 22

σ12
is defined as (1 – α)100% confidence interval for . Let us look at Example 3.6.
σ 22

Copyright © Open University Malaysia (OUM)


TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE  63

Example 3.6:
In one experiment, the first sample with n1 = 9 has a standard deviation, s1 = 0.5
while the second sample with n2 = 7 has a standard deviation, s2 = 0.7.
σ 12
Determine a 98% confidence interval for 2 ratio.
σ2

Answer:
From the F distribution table, we obtained the values of f 0.01,9,7 = 6.72 and
f 0.01,7,9 = 5.61 for α = 0.02. Therefore, substitutes the values above into
following equation,

( 0.5)2 × 1 < σ12 < ( 0.5)2 × 5.61


( 0.7 )2 6.72 σ 22 ( 0.7 )2
σ 12
0.076 < < 2.862
σ 22

σ 12
The confidence interval for ratio shows that the value of 1 is in the interval,
σ 22
therefore σ12 = σ 22 is true.

EXERCISE 3.4

Let n1 = 15, s1 = 12, n2 = 3.07 and s2 = 0.80. Construct a 98% confidence


σ 21
interval for the ratio.
σ 22

Please refer to the F distribution table at http://www.z-table.com/f-


distribution-table.html.

Copyright © Open University Malaysia (OUM)


64  TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE

3.4 COMPARING VARIANCES OF TWO


POPULATIONS
Consider a test to check whether two samples taken from a normal population has
equal variance. Suppose that these two random samples written as X1, ....., X n and
Y1, ....., Ym with n and m sample sizes respectively (where n not necessarily equals
to m) with sample variances, S X2 and SY2 .

Now, if both samples come from normal population with equal variance, σ 2 then
(n − 1) S X2 2 (m − 1) SY2
2
 χ ( n − 1) and 2
~ χ 2 (m − 1)
σ σ

(n − 1) S X2 (m − 1) S X2
Hence, are F(n – 1, m – 1) variable.
(n − 1)σ 2 (m − 1)σ 2

To test whether two random samples of sizes n and m with sample variance S X2 and
SY2 respectively taken from a normal population with equal variance, we use
σˆ X2
F= statistics distributed as F(n – 1, m – 1) when the null hypothesis is true
σˆY2
(that is samples have equal variance) with unbiased estimated variance:

( n − 1) S X2 ( m − 1) SY2
σˆ X2 = and σˆY2 = respectively. Table 3.4 summarises the test on
n −1 m −1
variance comparison.

Copyright © Open University Malaysia (OUM)


TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE  65

Table 3.4: Variance Comparison Test

Alternative Test
Null Hypothesis Critical Region
Hypothesis Statistics
(a) One-sided (a) One-sided test-right
test-right S12
H1 : σ 12 > σ 22 ≥ fα (ν 1 ,ν 2 )
S 22
σ 12
⇔ H1 : >1 (b) One-sided test-left
σ 22
S12
≤ f1−α (ν 1 ,ν 2 )
(b) One-sided test- S 22
H 0 : σ 12 = σ 22 left
σ 12 H1 : σ 12 < σ 22 (c) Two-sided test
⇔ H0 : =1
σ 22 σ 2 S12
⇔ H1 : 1
<1 ≥ fα / 2 (ν 1 ,ν 2 )
σ 2 S 22
2

S12 or
(c) Two-sided test F=
S 22
H1 : σ 12 ≠ σ 22
S12
σ 2 ≤ f1−α / 2 (ν 1 ,ν 2 )
⇔ H1 : 1
≠1 S 22
2
σ 2

H 0 : σ 12 ≥ σ 22 H 1 : σ 12 < σ 22 S12
≤ f1−α (ν 1 ,ν 2 )
σ 12 σ 12 S22
⇔ H0 : ≥1 ⇔ H1 : <1
σ 22 σ 22

H 0 : σ 12 ≤ σ 22 H1 : σ 12 > σ 22 S12
≥ fα (ν 1 ,ν 2 )
σ 12 σ 12 S 22
⇔ H0 : ≤1 ⇔ H1 : >1
σ 22 σ 22

Let us look at Example 3.7 which shows you the situation in comparing two
different variances.

Copyright © Open University Malaysia (OUM)


66  TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE

Example 3.7:
A random sample with size n1 = 16 and n2 = 25 were taken from two normal
populations. The variances for both samples are s12 = 48 and s22 = 26 respectively.
By using α = 0.05 and appropriate hypothesis, carry out a test to determine
whether the variance from the first population greater than the second population
variance.

Answer:
The steps to solve the problem are:

Step 1: Determine the Parameter of Interest


Population parameters of interest are variances of the first and second
populations, σ12 and σ 22 , respectively.

Step 2: Gather All Available Information

Population 1 Population 2
(a) Shape: Normal (a) Shape: Normal
(b) Mean: μ1 (unknown) (b) Mean: μ 2 (unknown)
(c) Standard deviation: σ 1 (unknown) (c) Standard deviation: σ 2 (unknown)

Step 3: Construct Hypothesis Statement


The statement “ σ12 is greater than σ 22 ” means H1 is chosen as

σ 12
H1 : σ12 > σ 22 ⇔ H1 : 2 > 1
σ2

where H 0

σ12
H 0 : σ12 ≤ σ 22 ⇔ H 0 : ≤1
σ 22

(refer to Table 3.4).

Copyright © Open University Malaysia (OUM)


TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE  67

Step 4: Determine the Significance Level and Rejection Region (RR)


Therefore, a one-sided test will be carried out at α = 0.05 significance
level. The RR is on the right side of F distribution. From the
http://www.z-table.com/f-distribution-table.html table, we obtain the
value of F0.05,15,24 = 2.11. Hence, will we reject the H 0 if the value
of F statistics is greater than 2.11?

Step 5: Calculate the Test Statistics


Test statistics:

s12 48
F= = = 1.85
s22 26

Step 6: The Result


Since the value of F statistics is in the acceptance region, which is
1.85 < 2.11, we do not reject the H 0 .

Step 7: Conclusion
Hence, there is strong evidence to say that σ12 = σ 22 , where the
variances for both populations are equal.

Finally, let us try Exercise 3.5 to test your understanding of Topic 3.

EXERCISE 3.5

1. Two independent random samples were chosen from two normal


populations. Both samples gave the following information:

Sample 1 Sample 2
n1 = 16 n2 = 25

x1 = 48.7 x2 = 39.2

s12 = 10.6 s22 = 7.3

Carry out the appropriate hypothesis testing using α = 0.02 to


determine whether both populations have equal variance.

Copyright © Open University Malaysia (OUM)


68  TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE

2. If independent random variables, X1, X 2 and X 3 are distributed as


χ 2 (1), χ 2 (5) and χ 2 (10) respectively, determine the distribution
(with mean and variance) for

(a) X1 + X 2 (b) X1 + X 3

3. If a random variable X1 is distributed as N (μ1 , σ12 ) and random


variable X 2 is distributed as N ( μ2 , σ 22 ), show that

 ( X − μ )2 ( X − μ )2 
E 1 2 1 + 2 2 2  = 2
 σ σ 
 

4. Using Appendix 3.1,

(a) Determine the value for α if:

(i) χα2 = 19.02 (v = 9)

(ii) χα2 = 24.43 (v = 40)

(b) Determine the value for x if:


2
(i) χ 0.005 = x (v = 29)
2
(ii) χ0.99 = x (v = 4)

5. A test has been suggested at 5% level of significance to check a


sample of nine items drawn from a normal population with a
variance of 11. If the calculated sample variance is 12.1, determine
the result of that test.

Copyright © Open University Malaysia (OUM)


TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE  69

6. A sample of size 15 drawn from a normal population gave the


following results:
9.1, 14.3, 11.2, 8.4, 8.5, 14.0, 9.9, 8.9, 11.0, 10.2, 10.8, 11.4, 13.0,
9.9, 10.4

(a) Compute the sample mean and sample variance. Test at 5%


level of significance whether the sample variance is 1.9.

(b) If a test is conducted to check whether the population variance


is greater than 1.9, will the result differ from what is obtained
in 6(a)?

7. A firm would like to conduct a study on the sequence of its


production channels. Since both sequences resulted in almost
similar daily output, it has been suggested that the production
channel with a sequence that results in less variation be selected.
Two random samples are obtained as shown in the table below.
Construct a 95% confidence interval for the variance ratio of daily
output. Which channel sequence would you suggest?

Production Channel 1 n1 = 21 days s12 = 1,432

Production Channel 2 n2 = 25 days s22 = 3,761

8. Two random samples of sizes 8 and 11 from one population are


assumed to be normally distributed with variances 12.4 and 19.3
respectively. Test at 5% level of significance to determine whether
both samples have equal variance.

9. The following two samples are drawn from a normal population.


By using α = 0.01, test an appropriate hypothesis to determine
whether the first population variance is greater than the second
population variance.

Sample 1 24.3 46.0 56.6 40.3 64.1 69.5 48.1 37.1 56.5 50.6
Sample 2 31.9 42.8 55.4 52.3 46.5 42.0 45.5 42.4 32.0 51.5

Copyright © Open University Malaysia (OUM)


70  TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE

(n − 1) s 2
• Chi-square distribution is a sampling distribution for the variable
σ2
possessing the following properties:
– The chi-square value is always greater than or equal to 0, a property which
is not applicable for z and t distribution.
– The distribution is non-symmetrical.
– The distribution will vary according to the sample size. This means the
distribution shape is very dependent on the value ν, which is the degrees of
freedom value that exists in a sampling situation.
– The mean for any distribution is equal to its degrees of freedom.
– It is used to compare the variance of a population.

• The F distribution is a sampling distribution for the variable possessing the


following properties:
– There are no negative values in F distribution (similar to chi-square
distribution), where the scale for F values starts with 0 and extends towards
the positive side on the right side.
– F distribution is also non-symmetrical.
– There are various shapes of F distribution depending on sample size, which
is the respective sample degrees of freedom. The F distribution is used to
compare two independent population variances.

• Steps to carry out hypothesis testing on variance:


– Determine the parameter of interest;
– Gather all available information;
– Construct appropriate hypothesis statement;
– Determine the significance level and rejection region (RR);
– Calculate the test statistics;
– State the result; and
– Make a conclusion.

Copyright © Open University Malaysia (OUM)


TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE  71

Chi-square distribution – A distribution, with degrees of freedom (df) as the only


parameter, that is skewed to the right for small df and
looks like a normal curve for large df.

F distribution – A continuous distribution that has two parameters – df


for the numerator and df for the denominator.

Freund, J. E. (2003). Mathematical statistics (7th ed.). Upper Saddle River, NJ:
Prentice-Hall, Inc.

Mann, P. S. (2005). Introductory statistics using technology (5th ed.). Upper Saddle
River, NJ: John Wiley & Sons, Inc.

Mendenhall, W., Beaver, R. J., & Beaver, B. M. (2013). Introduction to probability


and statistics (14th ed.). Belmont, CA: Thomson Brooks/Cole.

Mendenhall, W., & Sincich, T. (2003). A second course in statistics: Regression


analysis (6th ed.). Upper Saddle River, NJ: Prentice-Hall, Inc.

Walpole, R. E. (2006). Probability and statistics for engineers and scientist


(8th ed.). Upper Saddle River, NJ: Prentice-Hall, Inc.

Copyright © Open University Malaysia (OUM)


72  TOPIC 3 HYPOTHESIS TESTING ON POPULATION VARIANCE

3.1 Chi-square Table

Source: http://www.z-table.com/chi-square-table.html

Copyright © Open University Malaysia (OUM)


Topic  Analysis of
Variance
4 (ANOVA)
LEARNING OUTCOMES
By the end of this topic, you should be able to:
1. Use ANOVA in experiment as well as within and between group
variations; and
2. Apply one-way ANOVA and model for a single-factor test.

 INTRODUCTION
Can we use the methods learned in Topics 1 and 2 to compare three or more
populations? Well, there are situations when we are interested to broaden our test
scope to more than two populations. The following are two situations which
compare three or more populations:

A teacher is interested in comparing the mean of Mathematics marks obtained


from three groups of students following different teaching methods. Similarly,
a researcher is interested to compare the strength of pulps produced by using
different techniques.

Each production method may result in producing a different mean strength and a
researcher would like to test the equality of several means. This investigation could
use a procedure known as analysis of variance (ANOVA). ANOVA is a basic
method in experimental design and also widely used for inferential statistics.

Copyright © Open University Malaysia (OUM)


74  TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)

In general, ANOVA is used to estimate and test the hypothesis of population


mean and variance. Although subsequent topics emphasise hypothesis testing on
population mean, any conclusion made is very dependent on the observed
magnitude of the variance.

The application of ANOVA depends on several required assumptions. We will


discuss the assumptions required for the test, the hypothesis that should be
constructed, the calculation involved, ANOVA table construction and type of
results that can be expected from this analysis. Let us continue with the lesson.

4.1 BASIC CONCEPTS OF ANOVA


In this topic, let us look at ANOVA and experiment as well as group variation.

4.1.1 ANOVA and Experiment


What is an experiment?

An experiment is a study or research designed with the purpose of checking


the effect of one variable on the value of another variable e.g. the effect
of tuition classes on students’ performance.

What is an independent variable?

An independent variable is an observed or controlled variable for the


purpose of determining its effect on the dependent variable(s).

In ANOVA, the independent variable can be qualitative (such as gender) or


quantitative (such as student’s age).

Relevant terms related to experiment are:

(a) Independent variables are also known as factors. A study may involve 1, 2
or more factors e.g. type of tuition classes, time of classes and students’
commitment.

Copyright © Open University Malaysia (OUM)


TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)  75

(b) Each factor may involve different factor levels (categories) (see Table 4.1 for
examples).

Table 4.1: Examples of Relevant Terms

Factor Level
Type of tuition classes Method 1: Tuition
Method 2: Intensive class
Tuition class time Time 1: Afternoon
Time 2: Night
Time 3: Weekends

(c) The combination of one level of a factor to another factor’s level is known as
treatment or run.

Notes:
(a) For a single factor experiment, the factor level and treatment carry the same
meaning.
(b) In this book, only a single-factor experiment is considered. For multiple
factors, please refer to the appropriate reference books.

In general, ANOVA is an approach to investigate by using sample data whether the


unknown means of three or more populations are equal. If comparison was made
on two population means, the result from the ANOVA procedure discussed here is
equivalent to the mean testing procedures for two small populations (using t
distribution).

Therefore, the focus of Topic 4 is to compare the means for three or more
unknown populations with restriction on one variable or one factor. The examples
of experiments involved the comparison of means for three or more populations
such as:
(a) A college principal is interested in comparing the marks obtained by students
from Years 1, 2 and 3;
(b) An engineer wants to compare the current flow for five different conductors;
and
(c) A pharmacist is interested in comparing the effectiveness of three types of
medicine used to treat patients in a hospital.

Copyright © Open University Malaysia (OUM)


76  TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)

You have learned about display plots in the SBST1203 Introductory Statistics
module. Now, the focus is more on the uses of the box-plot and dot-plot which
provide a visual display before calculation on mean comparison is carried out.
Figure 4.1 displays the box-plot graph for comparison of mean speed according to
the types of car.

Figure 4.1: Box-plot on the type of car vs speed

Figure 4.1 shows information about five cars that have different means or medians
and variances for their speed at different levels. Do the observed differences yield
significant statistical results? No.

Therefore, ANOVA should carry out a numerical significance test on the equality
of each mean. The null hypothesis is there is no significant difference on the mean
speed for all cars. If the null hypothesis rejected, this shows there is a significant
difference in the mean speed for all cars. If we are interested, we can determine the
mean speed of the car that caused the difference.

There are several assumptions that we should consider before running the ANOVA
procedure, which are:

(a) Each population under study must be normal distributed;

(b) Samples taken are random and independent; and

(c) Each population that produces a sample value equal has unknown and equal
population variance, that is σ12 = σ 22 = ... = σ k2 .

Copyright © Open University Malaysia (OUM)


TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)  77

Figure 4.2 displays the graph shape for populations that satisfy the previous
assumptions of ANOVA.

Figure 4.2: Graph shape for populations that satisfy the


previous assumptions of ANOVA

The first assumption about population distribution is normal with homogeneous


population variance, it satisfies the property of F distribution. If the assumptions on
the F procedure are not satisfied for a population distribution, a non-parametric
statistical test must be used which will be discussed in Topic 5.

Let us carefully observe Figure 4.3 and comment on the means; μ1, μ2 , and μ3.

Figure 4.3: What can you say on μ1 , μ 2 , and μ 3 ?

Now, let us look at Example 4.1.

Copyright © Open University Malaysia (OUM)


78  TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)

Example 4.1:
The following is a one-way experiment/test. Measurement in the table is the final
examination score for 12 students according to type/category of tuition class.

Type of Tuition Class


1 2 3 Total
65 66 70 201
64 64 68 196
67 63 65 195
66 67 69 202
797
Mean, x x1 = 65.5 x2 = 65 x3 = 68 x.. = = 66.17
12

Notes:

1. The factor is tuition class; factor level is the type/category.

2. The four observations for factor level 1 is known as group 1.

3. There are three groups in this experiment with dot plot as shown in
Figure 4.4.

Figure 4.4: Three groups with dot plot

Copyright © Open University Malaysia (OUM)


TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)  79

4. There exists variation within each respective group (as observed from
variation in marks value).

5. There exists variation between groups (observe the varying position of the
group centre).

6. Do the three types of extra classes result in similar effects on students’


performance? Or, in other words, is the mean population for group 1 ( μ1 )
= Mean population for group 2 ( μ2 ) = Mean population for group 3 ( μ3 )?

SELF-CHECK 4.1

1. Define analysis of variance (ANOVA) by using your own words.


2. What are the assumptions that we should consider before running the
ANOVA procedure?

ACTIVITY 4.1

Discuss the following questions in the myINSPIRE forum:


(a) Can you suggest several similar examples that use ANOVA?
(b) Provide an example for a one-factor experiment with four factor
levels. Identify the independent and dependent variables involved.
(c) Give an example for two-factor experiment with two factor levels.
Identify the independent and dependent variables involved.

Copyright © Open University Malaysia (OUM)


80  TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)

EXERCISE 4.1

Table shows two data sets which are data 1 and data 2. By using these
datasets, construct a dot-plot graph. Give your comment.

Data 1 Data 2
A B C A B C
14.9 14.4 14.5 16.6 13.2 13.5
14.9 14.4 14.5 16.8 14.7 16.9
14.9 14.4 14.5 13.2 15.7 15.4
14.9 14.4 14.5 15.3 12.3 12.8
14.9 14.4 14.5 12.6 16.1 13.9
Total 74.5 72.0 72.5 74.5 72.0 72.5
Mean 14.9 14.4 14.5 14.9 14.4 14.5
Variance 0 0 0 3.71 2.63 2.71
Overall total 219.0 219.0
Mean total 14.6 14.6

4.1.2 Within and between Group Variation


Changes within one dataset containing n measurements are proportional to the total
n 2
sum of squares,  ( xi − x ) and this quantity is used to calculate the sample
i =1
variance for a population. The term “ANOVA” comes from the decomposition of
the total variability of its components.
k n 2
The total sum of squares, that is  ( xij − x ) , is a measurement of total
i =1 j =1
variability in the data. Observe Table 4.2.

Copyright © Open University Malaysia (OUM)


TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)  81

Table 4.2: Measurement Collected from Observations Under Study (Subject) i and j

Observation
1 x11 x12 … xn1
2 x21 x22 … xn2
Treatment
⋅ ⋅ ⋅ … ⋅
⋅ ⋅ ⋅ … ⋅
k xk1 xk 2 xnk

Table 4.2 shows the measurement collected from observations under study (subject)
i and j where i = 1,2, … k, and j = 1,2, …, n. The sample sizes are not necessarily
k
equal and the total sample size is N =  ni . The overall mean was obtained by
i =1
dividing the total overall observation from samples with the total sample size, that
k
is x =  Ti / N .
i =1

Note that the total sum of squares SST can be written as:
k n 2 k n 2
 ( xij − x ) =  ( xi − x ) + ( xij − x ) Formula 4.1
i =1 j =1 i =1 j =1

or
k n 2
 ( xij − x )
i =1 j =1

k n k n
( ) ( )
2 2
= n ( xi − x ) +  xij − xi + 2 ( xi − x ) xij − xi Formula 4.2
i =1 j =1 i =1 j =1

n
However, the cross-product term in Formula 4.2 is zero since  ( xij − xi ) =
i =1
xi − nxi = xi − n ( xi / n ) = 0

Copyright © Open University Malaysia (OUM)


82  TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)

Hence, we have:
k n 2 k k n 2
 ( ) = n ( xi − xi ) +  xij − xi ( )
2
xij − x Formula 4.3
i =1 j =1 i =1 i =1 j =1

Formula 4.3 states that total variability in the data, as measured by the total sum
of squares can be partitioned into the sum of squares deviation between means
in the treatment and within means of the treatments. This means the differences
between mean of observed treatment and the overall mean is a measure of
differences between treatments means, while the observed differences between a
treatment with the treatment mean can only be caused by random error. As such,
we can write Formula 4.3 (in symbol) as:

SST = SS(TR) + SSE

where SS(Tr ) is the sum of squares due to treatments (that is between observations)
and SS E is the sum of squares due to error (that is within observations). Since there
exists kn = N total observations, we have N – 1 degrees of freedom. SS(Tr ) has
k – 1 degrees of freedom since there are k factor levels (and k treatment means).

Finally, in every treatment there are n replicates that provide n – 1 degrees of


freedom used in estimating the experimental error. Since there are k treatments, we
have k(n – 1) = kn – k = N – k degrees of freedom for error.

It is important for us to check intrinsically both terms on the right side of the basic
identity for analysis of variance (Formula 4.3). Consider the following sum of
squares for error:

k n 2 k  n 2
SS E =  xij − xi ( ) =   ( xi − xi ) 
i =1 j =1 i =1  i =1
  

It is easier for us to see that the term inside the square bracket is equivalent to the
sample variance at the i-th treatment divided by n – 1, that is
n
 ( xij − xi )
2

Si2 = i =1
i = 1, 2, …, k
n −1

Copyright © Open University Malaysia (OUM)


TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)  83

Now, the sample variance can be combined to get an equal estimation for the
population variance, that is,

k  n 2

  xij − xi ( ) 
( n − 1) S12 + ( n − 1) S22 + ... + ( n − 1) Sk2 = i =1  j =1 
( n − 1) + ( n − 1) + ... + ( n − 1) k
 ( n − 1)
i =1

= SS E / ( N − k )

As such, SS E /(N – k) is an unbiased estimator of variance for each treatment.

In the same way, if there is no difference between k treatment means, we can use
the changes in treatment means from the total mean to estimate σ 2 . Especially when
n is equal for each k treatments, as such,
k 2
n ( xi − x )
SS(Tr ) / ( k − 1) = i =1
.
k −1

is an estimation for σ 2 when the treatment means are the same. If n is unequal, we
have
k 2
n ni ( xi − x )
SS(Tr ) / ( k − 1) = i =1
k −1

Note that the identity analysis of variance (Formula 4.3) provides two estimations,
which are based on the existence of changes within treatments and between
treatments. If there are no differences in treatment means, both estimations should
be almost equal. If both estimations are not the same, it is suspected that the
observed differences must be due to differences within treatment means. The
quantity
SS(Tr )
= MS(Tr )
k −1

and

Copyright © Open University Malaysia (OUM)


84  TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)

SS E
= MS E
N −k

where MS is the mean squares. Let us look at Example 4.2.

Example 4.2:
Using data on students’ test marks according to classes (full marks = 20),
calculate the mean squares between classes, mean squares between students
(errors) and total deviation of overall marks.

Class A Class B Class C


15.2 14.8 15.1
15.4 14.4 14.3
14.8 14.3 14.6
14.4 14.1 13.9
14.7 14.4 14.6

Answer:
The results are as below:

Class A Class B Class C


15.2 14.8 15.1
15.4 14.4 14.3
14.8 14.3 14.6
14.4 14.1 13.9
14.7 14.4 14.6
Total 74.5 72.0 72.5

Mean = x j 14.9 14.4 14.5

Variance 3.71 2.63 2.71

Overall total 74.5 + 72.01 + 72.5 = 219.0

Overall mean x 219.0/15 = 14.7

Copyright © Open University Malaysia (OUM)


TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)  85

We obtained:

1. Variation of marks between classes (treatments)

Sum of squares treatments

nj (xj − x )
2
=
2 2 2
= 5(14.9 – 14.6) + 5(14.14 – 14.6) + 5(14.5 – 14.6)
= 5(0.09 + 0.04 + 0.01)
= 0.7

Degrees of freedom, df = k – 1 = 3 – 1 = 2

As such,

Mean squares of treatments = Sum of squares treatments/df


= 0.7/2
= 0.35

This means that changes in measurement between the three samples, that is
variation of students’ marks between classes is 0.35.

2. Variation of marks between students (error)

Sum of squares error

= ( n1 − 1) s12 + ( n2 − 1) s22 + ( n3 − 1) s32

= 4(0.16) + 4(0.065) + 4(0.195)


= 4(0.42)
= 1.68

Degrees of freedom, df = n1 + n2 + ... + nk – k = 5 + 5 + 5 – 3 = 12

Hence, the mean square error = Sum of squares error/df


= 1.68/12 = 0.14

Copyright © Open University Malaysia (OUM)


86  TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)

This means the changes in measurement within the three samples, which is
variation of marks between students in respective classes is 0.14.

3. The total deviation in overall marks, SST .

Hence,

( )
2
SST =  xij − x
2 2 2
= (15.2 − 14.6 ) + (15.4 − 14.6 ) + ... + (14.6 − 14.6 )
= 2.38

In this topic, the usage of mean squares is synonym with the term covariance.
Therefore, when discussing about the changes in measurement for a set of data, the
word mean squares is used compared to the word variance. When the value of mean
squares of treatments is greater than mean squares of errors, we can make an early
conclusion that there exists significant difference between treatments in giving
effects towards experimental results. The following subtopic will demonstrate how
the existing differences can be verified using appropriate statistical test.

ACTIVITY 4.2

Using the answer in Example 4.2,

(a) Determine
(i) Sum of squares of treatment + Sum of squares of error

(ii) df  SS(Tr )  + df [ SS E ]

(b) Compare the value of mean square of treatment ( MSTr ) and mean
square of error ( MS E ).

Comment on (a) and (b) in the myINSPIRE forum.

Copyright © Open University Malaysia (OUM)


TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)  87

EXERCISE 4.2

Four groups of students were chosen and given different methods of


teaching. At the end of the period, they were given a test to evaluate the
effectiveness of the teaching method. The number of students in each
group is different according to group. Using the following marks data,
calculate the mean squares between methods, mean squares between
students and the total deviation on overall marks.

G1 G2 G3 G4
65 75 59 94
87 69 78 89
73 83 67 80
79 81 62 88
81 72 83
69 79 76
90

4.2 SINGLE-FACTOR EXPERIMENT


Finally, let us look at one-way ANOVA and model for a single-factor test in this
last subtopic.

4.2.1 One-way ANOVA


For a single factor experiment, ANOVA is called one-way ANOVA. The purpose
of this analysis is to check the equality of population means for three or more
random samples. There are a few steps in carrying out the ANOVA procedure,
which are:

Copyright © Open University Malaysia (OUM)


88  TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)

Step 1: Determine the Null and Alternative Hypotheses


The null hypothesis in ANOVA is an independent sample taken from different
populations with equal mean and the alternative hypothesis is the vice-versa. It can
be written as:

H0 : μ1 = μ2 = ... = μk

(no mean difference for k factor levels, k = Number of populations)


H 1 : Not all populations have equal mean

Note that ANOVA does not provide information on how much the mean
populations differ, as well as accurate information on which population mean
differs. If H 0 is true and the three previous assumptions were satisfied, we can say
the three samples were taken from a same population as shown in Figure 4.5(a) and
variance contribution to the total overall variability is zero.

On the other hand, if H 0 is false, the variation within the observed dependent
variable is mostly due to difference in treatment and its contribution is viewed as
SS(Tr ) percentage towards the total deviation. The greater the SS(Tr ) percentage is,
the closer it is towards the truth of H1 that is the mean for each population is not
equal. This event implies that the samples taken were from the following
populations as shown in Figure 4.5(b).

Figure 4.5: Three samples from a same population

Copyright © Open University Malaysia (OUM)


TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)  89

Step 2: Choose a Significance Level


A criteria to reject H 0 is required and test is performed at a specific significance
level value, usually taken at α = 0.01 or α = 0.05.

Step 3: Determine the Rejection Region (RR)


To determine the F value that separates the acceptance region (AR) and RR, we
need information on two things:

(a) The degrees of freedom for the treatment, v1 = k – 1 with k sample size; and

(b) The degrees of freedom for the error, v2 = N – k where N is the total number
of observations in all samples that is n1 + n2 + ... + nk = N (for unequal
sample sizes) or kn = N (for equal sample sizes) and k is the number of groups/
treatments.

Determine the critical value, that is Fv1 ,v 2 ,α (obtained from the F distribution table
at http://www.z-table.com/f-distribution-table.html). Reject H 0 when F > Fv1 ,v2 ,α .

Step 4:Calculate the Test Statistics

MS(Tr ) SS(Tr ) / ( k − 1)
F= =
MS E SS E / ( N − k )

Step 5: Test Result


The result depends on the rejection region in Step 3.

Step 6: Test Conclusion


The conclusion of the test depends on the statistical test result obtained in Step 5.

Let us try the following exercise to test your understanding.

EXERCISE 4.3

How can a critical region be determined in an ANOVA test? What should


you know prior to obtain the critical value?

Copyright © Open University Malaysia (OUM)


90  TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)

SELF-CHECK 4.2

1. Define one-way ANOVA in your own words.


2. What is the purpose of one-way ANOVA?
3. What are the steps in carrying out one-way ANOVA?

4.2.2 Model for a Single-factor Test


The outcome of a single-factor test is:
Observed data = Mean + Unexplained variation

where the unexplained variation is sampling variation.

The mean model is the model usually used for single-factor testing that is the
model used to compare means ( μ j ) of factor levels. This model is

X i , j = μ j + ε ji i = 1,2, ..., k; j = 1,2 ..., n

where X i, j = The ith observation for j factor level


k = Number of factor levels
n = Number of sample observations for k factor level
ε ji = The independent error identified as normally distributed N(0, σ 2 )

For hypothesis testing, the model error is assumed as an independent random


variable, which is normally distributed with zero mean and variance σ 2 . The
variance σ 2 is assumed constant for all factor levels. This model is known as one-
way analysis of variance since only the single factor is being tested. The test
method is summarised in the following ANOVA table (see Table 4.3).

Copyright © Open University Malaysia (OUM)


TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)  91

Table 4.3: ANOVA Summary

Sum of Degrees of Mean Square


Source F Value
Squares Freedom Error
Treatments SS (Tr ) k–1 MS (Tr ) MS (Tr ) / MS E

Error SS E N–k MS E
Total SST N–1

As we know, MS(Tr ) and MS E are measure of changes between treatments and


changes and within treatments. The combination of both terms will result in the
total variability in the sample data. This means:

The total sum of squares = Sum of squares treatment + Sum of squares error

Let us look at Example 4.3.

Example 4.3:
A private accounting firm carried out a study to investigate whether the efficiency
of its employees is related to their former schools. A few selected accountants
from the company chose four schools at random and the number of mistakes
made by other accountants in two weeks’ duration were recorded as below:

School A School B School C School D


14 17 19 23
16 16 20 12
17 18 22 21
13 15 21 10
22 16 18 9
9 12 19 15

Carry out an ANOVA test at 0.01 significance level. Is there any significant
difference in evaluating the employees’ efficiency?

Copyright © Open University Malaysia (OUM)


92  TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)

Answer:
The factor involved here is the former school; the factor level is the four original
schools selected by the accountants.

Step 1: Determine the Null and Alternative Hypotheses


H 0 : μ1 = μ 2 = μ 3 = μ 4 (no mean difference for the 4 factor levels)

H 1 : Not all populations have an equal mean.

Step 2: Choose a Significance Level


The significance level is fixed at α = 0.01.

Step 3: Determine the Rejection Region (RR)


(a) The degree of freedom for treatments, v1 = k – 1 = 4 – 1 = 3.

(b) The degree of freedom for error, v2 = N – k = 24 – 4 = 20.

Determine the critical value, that is F3,20,0.01 = 4.938 (obtained


from the F distribution table, http://www.z-table.com/f-distribution-
table.html). Reject H 0 when F > 4.938.

Step 4: Calculate the Test Statistics

MS(Tr ) SS(Tr ) / (k − 1)
F= =
MS E SS E / ( N − k )

94.8333 / 3
= = 2.129
297 / 2

Step 5: Test Result


Since the calculated test statistics value, F = 2.129 < 4.938, do not
reject the H 0 .

Step 6: Conclusion
Hence, we have strong evidence to state that the mean mistakes done
by the accountants are equal. In conclusion, there is no significant
difference in evaluating employees’ efficiency based on schools.

Copyright © Open University Malaysia (OUM)


TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)  93

How was it? Can you understand? If not, please re-read. Then, try out the
following exercise to strengthen your understanding. You can also visit the
following websites to find out more about chi-square and F distribution at
http://mathforum.org/library/drmath/view/52808.html.

EXERCISE 4.4

1. A teacher claims that the frequencies of watching television are


equal for all students in Year 6, Forms 1 and 2. He conducted a
survey on a random sample of selected students and their total time
(in minutes) spent watching television after school until just before
bedtime were recorded as below:

Primary 6 Form 1 Form 2


459 115 272
311 153 88
152 201 374
293 30 178

Carry out an ANOVA test at 5% level of significance and make a


conclusion.

2. List all the assumptions needs in carrying out the analysis of


variance procedures.

3. State the null and alternative hypotheses used in any analysis of


variance test.

4. Determine:
(a) The critical value for ANOVA test at α = 0.01 if the test
consists of 6 samples with 34 items in each sample.
(b) The critical value for ANOVA test at α = 0.05 if the test
consists of 4 samples with 44 items in each sample.

Copyright © Open University Malaysia (OUM)


94  TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)

5. Calculate:

(a) Test statistics, F when MS E =14.6 and MS(Tr ) = 35.7 (use the
information in Question 3(a)).

(b) Test statistics, F when MS E =73.81 and MS(Tr ) = 215.23 (use


the information in Question 3(b)).

6. A research showed no difference in the decision-making process


between student populations taken from different socioeconomic
backgrounds. The score results for this behavioural test, which was
conducted on a random sample, is as below:

Lower Middle Higher


32 45 38
36 42 38
40 34 31
32 42 41
33 29
37 33
34

Test the research claim at 1% level. Comment on the result.

Copyright © Open University Malaysia (OUM)


TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)  95

• The main purpose of analysis of variance (ANOVA) technique is to enable a


decision-maker to compare means for three or more independent samples and
to check if there are exists any statistical significance difference between
population means from where the samples were taken.

• There are three assumptions that need to be verified before the ANOVA
technique can be carried out, namely:
– The population distribution approaches normality;
– The samples chosen at random and independent; and
– The population variances are equal.

• There are six steps to carry out hypothesis testing procedures, namely:
– S1: Determine the null and alternative hypotheses;
– S2: Choose a significance level;
– S3: Determine the rejection region;
– S4: Calculate the test statistics;
– S5: Test result; and
– S6: Conclusion.

• The hypothesis testing process using ANOVA is summarised through the


construction of ANOVA one-way table which consists of sources of variation
(treatment, error and total), degrees of freedom, mean squares values (treatment
and error), and F ratio.

Copyright © Open University Malaysia (OUM)


96  TOPIC 4 ANALYSIS OF VARIANCE (ANOVA)

Analysis of variance – A statistical technique used to test whether the means of


(ANOVA) three or more populations are equal.

Mean square between – A measure of the variation among the samples taken
samples, MS(Tr ) from different populations.

Mean square within – A measure of the variation within the data of all sample
samples, MS E taken from different populations.

One-way ANOVA – The analysis of variance technique that analyses one


variable only.

SS(Tr) – The sum of squares of the factor or treatment. Also


called the sum of squares between samples.

SSE – The sum of squares of errors. Also called the sum of


squares within samples.

SST – The total sum of squares given by the sum of SS(Tr ) and
SS E .

Freund, J. E. (2003). Mathematical statistics (7th ed.). Upper Saddle River, NJ:
Prentice-Hall, Inc.

Mann, P. S. (2005). Introductory statistics using technology (5th ed.). Upper Saddle
River, NJ: John Wiley & Sons, Inc.

Mendenhall, W., Beaver, R. J., & Beaver, B. M. (2013). Introduction to probability


and statistics (14th ed.). Belmont, CA: Thomson Brooks/Cole.

Mendenhall, W., & Sincich, T. (2003). A second course in statistics: Regression


analysis (6th ed.). Upper Saddle River, NJ: Prentice-Hall, Inc.

Walpole, R. E. (2006). Probability and statistics for engineers and scientist


(8th ed.). Upper Saddle River, NJ: Prentice-Hall, Inc.

Copyright © Open University Malaysia (OUM)


Topic  Chi-squared
Tests
5
LEARNING OUTCOMES
By the end of this topic, you should be able to:
1. Explain the importance of goodness-of-fit and contingency table
tests;
2. Calculate the expected frequencies for goodness-of-fit and
contingency table tests;
3. Determine the degrees of freedom for all tests performed; and
4. Apply procedures to obtain statistical decision for goodness-of-fit
and contingency table tests.

 INTRODUCTION
Previous topics have discussed analysis and hypothesis on quantitative and
continuous data where the statistical techniques discussed required measurement
values such as weight, height, diameter, distance, total money or total score/marks
for a test.

In addition, various types of surveys and experiments resulted in qualitative rather


than quantitative response variables, so that responses can be classified but not
quantified. Data from these experiments consist of the count or number of
observations that fall into each of the response categories included in the
experiment.

Topic 5 will explore the methods to analyse categorical data. Firstly, what is a
categorical variable? A categorical variable is a variable that classifies or
categorises each individual into exactly one of several cells or classes.
Copyright © Open University Malaysia (OUM)
98  TOPIC 5 CHI-SQUARED TESTS

Categorical data analysis is a technique used to analyse qualitative data with


specific categories that we are interested in.

For example, in a public poll, respondents’ feedback on certain issues are recorded
and the data is in categorical form, that is whether the respondents “agree”,
“disagree” or have “no opinion”. Other examples are as follows:

(a) An experimenter who is carrying out a study on leukaemia patients can record
the number of cancer patients according to the patient’s family category; and

(b) An administrative executive at a university records the number of candidates


according to gender and number of courses taken.

Each of these examples is a categorical variable and the data taken is the number of
frequency that fall into each category of variable. The chi-square test will be used
to carry out categorical data analysis by comparing observed frequencies with the
expected frequencies under a pre-specified null hypothesis. Let us find out more in
the following subtopics.

ACTIVITY 5.1

Discuss in the myINSPIRE forum some examples of qualitative data.

5.1 GOODNESS-OF-FIT TEST


In this first subtopic, we will look at how to fit to a given probability and given
distribution.

5.1.1 Fitting to a Given Probability


When do we use a goodness-of-fit test? The goodness-of-fit test is used to perform
hypothesis tests to determine whether a population of interest is suitable or follow
a probability distribution of a random variable.

In addition, you should understand the multinomial experiment concept, which is


an extension of the binomial experiment, to understand the principles of the
goodness-of-fit test.

Copyright © Open University Malaysia (OUM)


TOPIC 5 CHI-SQUARED TESTS  99

Multinomial Experiment

1. The experiment consists of n identical trials.

2. The outcome of each trial falls into one of k categories or cells.

3. The probability that the outcome of a single trial will fall in a particular cell,
say, cell i, is pi , where i = 1,2, …, k, and remains the same from trial to
trial and P1 + P2 + ..., Pk = 1.

4. The experimenter counts the observed number of outcomes in each


category, written as O1, O2 , ..., Ok where O j ( j = 1, 2, ..., k ) with n =
O1 + O2 + ... + Ok . .

5. In performing goodness-of-fit test, there are two assumptions required,


which are that:
(a) The experiment satisfies the properties of a multinomial experiment.
(b) All expected frequencies are at least 1 and at most 20% of the
expected frequencies are less than 5, the required alternative
hypothesis:

H1 : At least one of the multinomial probabilities is unequal.

6. In n trials, the expected number that falls into the j-th category under the
null hypothesis is E j = np j .

Let us look at Example 5.1.

Example 5.1:
Suppose that an unbiased die was tossed 120 times and each outcome was
recorded in the following frequency table.

Number that Appears 1 2 3 4 5 6 Total


Total Frequency 20 10 10 20 20 40 120

Test whether the toss of the die was biased.

Copyright © Open University Malaysia (OUM)


100  TOPIC 5 CHI-SQUARED TESTS

Answer:

Step 1: Construct the Appropriate Hypothesis Statement

H 0 : P1 = P2 = ... = P6 = 1/ 6, that is, each toss of the die is fair

H1 : At least p j ≠ 1/ 6 for i = 1,2, …, 6 interval

Theoretically, if the die is balanced, we would expect each face to


occur 20 times, that is, it follows a uniform distribution. This means,
each face of the die from 120 throws is repetitive, as shown in the
following table:

Face 1 2 3 4 5 6 Total
Frequency 20 20 20 20 20 40 120

Hence, the H 0 test above is a goodness-of-fit test for a uniform


distribution.

Step 2: Determine the Significance Level and the Rejection Region (RR)
The test was performed at 5% level of significance, therefore we reject
(O − E )2
the null hypothesis when the test statistics X =  >
E
2
χ5% (5) = 11.070 with degrees of freedom, v = number of columns –
1 = 6 – 1 = 5.

Step 3: Calculate the Value of Test Statistics


6 (O j − E j )2
Test statistics is calculated as X =  distributed as χ 2
j =1 Ej
with v = 5 degrees of freedom. The following table gives the
information needed.

Copyright © Open University Malaysia (OUM)


TOPIC 5 CHI-SQUARED TESTS  101

Face 1 2 3 4 5 6 Total
The observed frequency, O 20 10 10 20 20 40 120
The expected frequency, E (when
20 20 20 20 20 20 120
the null hypothesis is true)
O–E 0 –10 –10 0 0 20 0

( O − E )2 0 5 5 9 9 20 20
E

( O − E )2 ( O − E )2
Hence, we obtain X =  = 30. Under H 0 ,  is
E E
distributed as χ 2 distribution. To calculate the test value in this case,
the information of the value of the 6 pairs’ needs. The 6 pairs are
independent and their total frequency must be 120 and the difference
for each added pair must be zero. This means, as many as 6 – 1
observed independent pairs (degrees of freedom) would be used to
calculate the χ 2 test value.

In other words, there are six cells to fill based on 1 restriction where
the total frequency for the 6 sets must be 120. For this reason, 6
choices – 1 restriction = 5 degrees of freedom.

Step 4: Test Result


2
Since the test statistics value, X = 30 > χ 5% (5) = 11.070, we reject the
H 0 . Observe the rejection region on the right side in Figure 5.1.

Figure 5.1: Result for Example 5.1

Copyright © Open University Malaysia (OUM)


102  TOPIC 5 CHI-SQUARED TESTS

Step 5: Conclusion
Hence, we have strong evidence to state that the throw of the die is
unbalanced, that is, it is not uniformly distributed.

Let us try Exercise 5.1 to test your understanding.

EXERCISE 5.1

A personnel manager at a government agency is very concerned about the


employees’ attendance record. He took a sample from their record to
investigate whether their absenteeism is uniformly distributed according
to the six working days. The following is the data obtained:

Day Number of Absenteeism

Monday 12

Tuesday 9

Wednesday 11

Thursday 10

Friday 9

Saturday 9

Test whether the employees’ absenteeism is uniformly distributed at 1%


level of significance.

5.1.2 Fitting to a Given Distribution


Goodness-of-fit also applies to situations in which we want to determine whether a
set of data may be looked upon as a random sample from a population having a
given distribution. We would like to check whether a given frequency distribution
could be considered as binomial, Poisson or normal distribution based on the
following properties:

(a) The chi-square test statistics approaches the chi-square distribution with k – 1
degrees of freedom in goodness of fit test and (r – 1)(k – 1) in test of
independence and test of homogeneity.

Copyright © Open University Malaysia (OUM)


TOPIC 5 CHI-SQUARED TESTS  103

(b) In each case, the approximation to chi-square distribution is accurate if


all expected frequencies are at least 1 and at most 20% of the expected
frequencies are less than 5.

(c) The Yate’s continuity correction statistics, that is:

( O − E − 0.5)2
X cc =
E
This continuity correction is required as a result of approximating a discrete
distribution by a continuous probability distribution.

Let us learn more on binomial, Poisson or normal distribution.

(a) Binomial Distribution


Let us look at Example 5.2.

Example 5.2:
A lecturer would like to investigate the frequency of students taking
elective classes at a local university. Consider whether the following
number of students is distributed as a binomial distribution. Use 5%
significance level.

Number of Elective
0 1 2 3 4 5 or 6 Total
Courses
Number of Students 12 16 8 3 1 0 40

Answer:

Step 1: Construct the Appropriate Hypothesis Statement

H 0 : The number of students taking elective courses is


x
distributed as binomial ⇔ H 0 : X  b ( 6, p ) where p = =
n
45 / 40
= 0.1875
6

H1 : Otherwise

Copyright © Open University Malaysia (OUM)


104  TOPIC 5 CHI-SQUARED TESTS

Step 2: Calculate the Test Statistics


Using n = 6 and p = 0.1875, we can generate a theoretical
binomial distribution, where X (representing number of events
in the experiment) ~ Bin (6, 0.1875), derived from P ( X = x) =
n x n− x
  p (1 − p) and the following table was obtained:
x
 

X 0 1 2 3 4 5 or 6
Expected
11.51 15.93 9.19 2.83 0.49 0.05
Values

Since there are three cells with frequency less than 5 (X = 3,


4 and 5 or 6), all of them will be combined together with
frequency at X = 2 resulting in the value of 12.56 (that is 9.19 +
2.83 + 0.49 + 0.05).

Hence, combining the observed and expected frequencies table


to perform subsequent analysis:

X 0 1 2 or more Total
Observed 12 16 12 40
Expected 11.51 15.93 12.56 40

X=
(12 − 11.51) (16 − 15.93) (12 − 12.56 )
2
+
2
+
2
= 0.05
and
11.51 15.93 12.56

Step 3: Determine the Significance Level and Rejection Region


(RR)
In the table above, there are 3 frequency cells. There are 2
restrictions placed in finding the expected values, which are:

(a) Overall total = 40

(b) Using overall total = 40, the mean value x = 1.125, we


will have one degree of freedom.
2
Hence, the critical value for this test is χ5% (1) = 3.84 (check
Appendix 3.1, Topic 3).

Copyright © Open University Malaysia (OUM)


TOPIC 5 CHI-SQUARED TESTS  105

Step 4: Test Result


2
Since X = 0.05 < χ5% =3.84 , do not reject the H 0 .

Step 5: Conclusion
Hence, we do not have strong evidence to reject the null
hypothesis. In conclusion, it is clear that the distribution of
students taking the elective classes is binomial.

Note:

1. When n is known and p is unknown:

The sample mean needs to be determined to obtain p and the total


frequencies, ΣO, to be multiplied with the calculated probabilities (p)
to obtain the expected frequencies. In this case, there are two
restrictions, which are the mean and total, ΣΟ.

2. When n is known and p is known:

The sample mean will not be used. It is sufficient to use ΣΟ to get the
expected frequencies. There is only one restriction, which is total, ΣΟ.

(b) Poisson Distribution


The process to test Poisson distribution is similar to the one performed in a
binomial test. We are going to use a given frequency distribution to test
whether the data have similar mean value and follows Poisson distribution.

In theory, Poisson distribution is generated by using information from the data


given. Two distributions can be compared based on means using the chi-
(O − E ) 2
square test that is χ 2 =  .
E

However, the binomial test will be in two forms, depending on whether:

(i) p unknown; or

(ii) p known, and here, we will only consider Poisson distribution for one
case.

Copyright © Open University Malaysia (OUM)


106  TOPIC 5 CHI-SQUARED TESTS

Similar to the previous case, to generate the expected distribution (when H 0


is true), it is necessary to generate a theoretical distribution and this requires:

(i) Mean parameter, μ; and

(ii) Total frequencies.

Let us see Example 5.3.

Example 5.3:
Test whether the Poisson distribution can be fitted to the frequency
distribution below:

X 0 1 2 3 4 5 6 or more
Frequency 19 26 27 13 11 2 0

Answer:

Step 1: Construct the Appropriate Hypothesis Test

H 0 : The frequency follows a Poisson distribution

⇔ H0 : X  P ( λ )

where

173
λˆ = x = = 1.765
98

H1 : Otherwise

Step 2: Calculate the Test Statistics


Using this mean value, we can calculate f ( x) = Pr ( X = x ) =
e− λ λ x
, where λˆ = x . We can also use the formula f ( x + 1) =
x!
λ
f ( x) to calculate Pr ( X = x ) . The following table was
x +1
generated based on this information on mean and observed
frequency:

Copyright © Open University Malaysia (OUM)


TOPIC 5 CHI-SQUARED TESTS  107

X 0 1 2 3 4 or more Total
Observed 19 26 27 13 13 98
Expected 16.8 29.6 26.1 15.4 10.1 98

Hence,

(O − E ) 2 (19 − 16.8) 2 (13 − 10.1) 2


X = = + ... + = 1.964
E 16.8 10.1

Step 3: Determine the Significance Level and Rejection Region


(RR)
Since there are 5 pairs of frequency with 2 restrictions, there will
be 5 – 2 = 3 degrees of freedom. Hence, the critical value of the
2
test is χ5% (3) = 7.81.

Step 4: Test Result


2
Since the test statistics, X = 1.964 < χ5% = 7.81, we do not reject
H0.

Step 5: Conclusion
This means there is strong evidence to accept H 0 and to state
that Poisson distribution is the best fit for this data.

(c) Normal Distribution


The goodness-of-fit test for a normal distribution uses a similar method as the
previous two distributions.

However, in general, to test normality for a given frequency distribution, we


need information on the sample x value, sample standard deviation, s and
total frequency. This means, there will be three restrictions in getting the
expected values. These procedures can be followed, which are:

(i) Calculate the x and s values for the given frequency distribution;

(ii) Using x and s values as approximation to μ and σ along with the total
frequency given, construct a theoretical normal distribution; and

Copyright © Open University Malaysia (OUM)


108  TOPIC 5 CHI-SQUARED TESTS

(iii) Compare the observed frequency with expected frequency using the chi-
square test with 3 restrictions.

If the values of μ and σ for theoretical distribution are known, it is unnecessary to


use the given frequency distribution to estimate both parameters. Let us look at
another example.

Example 5.4
The following table shows information on height (measured to the nearest cm)
for 694 nine-year old girls.

Height 117–120 121–124 125–128 129–132 133–136


Frequency 8 28 82 140 188

Height 137–140 141–144 145–148 149–152


Frequency 148 69 15 16

Test the sample to check normality at 5% level of significance.

Answer:

Step 1: Construct the Appropriate Hypothesis Test

H 0 : The frequency follows a normal distribution

( )
⇔ H 0 : X  N μ , σ 2 where x = μ̂ = 134.356 and s = σˆ = 6.195

H1 : Otherwise

Step 2: Calculate the Test Statistics


The calculation for observed frequency is under the assumption that
the normal distribution using the values obtained results in the
following table:

Copyright © Open University Malaysia (OUM)


TOPIC 5 CHI-SQUARED TESTS  109

Upper x − 134.256 Expected


Z= Pr(Z < z) p Observed
Interval 6.195 (p*Observed)
x-class
120.5 –2.24 0.013 0.013 9.0 8
124.5 –1.59 0.056 0.043 29.9 28
128.5 –0.95 0.171 0.115 79.8 82
132.5 –0.3 0.382 0.211 146.4 140
136.5 0.35 0.637 1.255 177.0 188
140.5 0.99 0.839 0.202 140.2 148
144.5 1.64 0.950 0.111 77.0 69
148.5 2.28 0.989 0.039 27.1 15
– – 1.000 0.011 7.6 16

Hence,

(O − E )2 (8 − 9)2 (28 − 29.9)2 (16 − 7.6)2


X = = + + ... + = 17.21
E 9 29.9 7.6

Step 3: Determine the Significance Level and Rejection Region (RR)


The data provides 9 actual cells with 3 restrictions that are mean,
standard deviation and total, giving v = 9 – 3 = 6 degrees of freedom.
2
Hence, we obtain χ5% (6) =12.59.

Step 4: Test Result


2
Since X = 17.21 > χ 5% = 12.59, we reject H 0 .

Step 5: Conclusion
We have evidence to state that the normality assumption on the
observed data is not satisfied.

SELF-CHECK 5.1

State the importance of the goodness-of-fit test.

Copyright © Open University Malaysia (OUM)


110  TOPIC 5 CHI-SQUARED TESTS

EXERCISE 5.2

1. Test whether the sampling distribution below can be considered as


binomial distribution (using 5% significance level).

X 0 1 2 3 4 5
Frequency 1 6 14 33 31 15

2. The following table is the distribution of number of rainfall and


storm reported by 330 weather stations in the United States of
America for a one-year duration.

Number of
0 1 2 3 4 5 >5
Storm
Number of
Station (f) 10 11
that Reports
2 4 74 28 10 2 0

(a) Determine the expected frequency.

(b) Perform a goodness-of-fit test to check whether the above data


can be modelled with Poisson distribution.

3. Use the chi-square goodness-of-fit test to determine whether the


following distribution can be considered normal.

Weight (g) 50–59.9 60–69.9 70–79.9 80–89.9


Number of
8 10 16 14
Specimens

Weight (g) 90–99.9 100–109.9 110–119.9


Number of
10 5 2
Specimens

Copyright © Open University Malaysia (OUM)


TOPIC 5 CHI-SQUARED TESTS  111

5.2 TABULATING QUALITATIVE DATA


(CONTINGENCY TABLE)
In some situations, the researcher classifies an experimental unit according to two
qualitative variables. In this case, if two categorical variables are recorded, the data
can be presented in a two-way cross-classification table known as contingency
table. The contingency table test cannot be used if n < 20 or 20 < n < 40 and if any
expected frequency is less than 5.

However, if n > 40, each expected frequency in table r × c has a value of more than
1 (r is number of columns for level of the first factor, c is the number of rows for
the level of the second factor).

For example, a political analyst may be interested in investigating whether the


opinions of the voting residents concerning a new tax reform are independent of
their political affiliation. A random sample of 1,000 registered voters is classified
as to whether they support party A, B or C and whether they favour a new tax
reform. The observed frequencies are presented in Table 5.1, which is known as a
contingency table.

Table 5.1: Contingency Table

Political Affiliation
Tax Reform
Party A Party B Party C Total
For 308 190 102 600
Against 92 160 148 400
Total 400 350 250 1,000

Table 5.1 also called a 2 × 3 (or 3 × 2) table since it consists of two rows and three
columns. The two categorical variables involved are the political affiliation (at three
levels, which are party A, party B, and party C) and their views on tax reform (at
two levels, “For” or “Against”). The values inside the table: 308, 190 and the rest
are the intersection given type of political affiliation and views on tax reform. These
values are observed frequencies as they represent the results obtained in the study
and identified as the number of individuals in all of the six categories or cells. For
example, the number of people who are members of party A and agree on tax reform
is 308 (row 1, column 1) while the number of people who are members of party C
and disagree on the tax reform is 148 (row 2, column 3).

Copyright © Open University Malaysia (OUM)


112  TOPIC 5 CHI-SQUARED TESTS

Investigation of any form or relationship between party membership and views on


tax reform can be viewed by converting information in Table 5.1 to percentage form
based on:

(a) Total number of individuals involved (1,000 people).

(b) Total row (“For” and “Against”).

(c) Total column (“Political Affiliation”).

The results are given in Tables 5.2, 5.3 and 5.4.

Table 5.2: Cross-classification Table between Political Affiliation and Views on Tax
Reform (Percentage Values in the Table are Based on Overall Total)

Political Affiliation
Tax Reform
Party A Party B Party C Total
For 30.8 19 10.2 60
Against 9.2 16 14.8 40
Total 40 35 25 100

Table 5.3: Cross-classification Table between Political Affiliation Views on Tax Reform
(Percentage Values in the Table are Based on Total Rows)

Political Affiliation
Tax Reform
Party A Party B Party C Total
For 51.33 31.67 17 100
Against 23 40 37 100
Total 40 35 25 100

Table 5.4: Cross-classification Table between Political Affiliation and Views on Tax
Reform (Percentage Values in the Table are Based on Total Columns)

Political Affiliation
Tax Reform
Party A Party B Party C Total
For 77 54.29 40.8 60
Against 23 45.71 59.2 40
Total 100 100 100 100

Copyright © Open University Malaysia (OUM)


TOPIC 5 CHI-SQUARED TESTS  113

What decisions can be made from Tables 5.2, 5.3 and 5.4? There are various
decisions which can be made from Tables 5.2, 5.3 and 5.4. Some of these are:

(a) 60% of chosen individuals support tax reform (Table 5.2).

(b) 51.33% of individuals from party A support tax reform (Table 5.3).

(c) 77% from those who agrees on tax reform are from party A (Table 5.4).

This study aims to investigate whether there is any relationship between


individuals’ opinions on tax reform based on political affiliation. This information
can be determined only if we know the expected frequency in each cell. Hence, the
expected frequency can be written as:

 Cj   Ri 
Eij = N    Formula 5.1
N  N 

where Eij = Expected frequency for ij-cell

N = Total overall observation


C j = Total jth column where j = 1, …, n j

Ri = Total ith row where i = 1, …, ni

that is

Table 5.5: Expected Frequency for Table 5.1

Political Affiliation
Tax Reform
Party A Agreement Party A Agreement
For 308 190 102 600 (R1)

Against 92 160 148 400 (R2)

Total 400 (C1) 350 (C2) 250 (C3) 1,000 (N)

Let us say that we are interested in determining the expected frequency for
individuals from party A who agree on tax reform, that is (A and “For”). Assume
the variables are independent,

Copyright © Open University Malaysia (OUM)


TOPIC 5 CHI-SQUARED TESTS  115

EXERCISE 5.3

A random sample of 200 selected people classified according to their age


(less than 30 and 30 or more) and their preferences on type of cars (local-
produced or imported). The results of this study are shown in the table
below.

Types of Cars Preferred

Age Local-produced Imported

< 30 68 42

30 or more 31 59

Construct an expected frequency table based on the information given.

5.2.1 Test of Independence


The question of independence of the two methods of classifications (variables) can
be investigated using a test of hypothesis based on the chi-square statistics. The
steps are:

Step 1: State the Null and Alternative Hypotheses


H 0 : The two methods of classifications / both variables are independent

H1 : Both variables are dependent

Step 2: Determine the Significance Level and Rejection Region (RR)


The significance level is usually set at α = 0.01 and α = 0.05.

Check the number of rows (r) and column (c) in the related table.
Calculate the degrees of freedom for the test, v = (r – 1) (c – 1).

Next, determine the critical value (based on the chi-square table,


Appendix 3.1), that is χα2 ,v . Reject H 0 if the test statistics value,
X > χα2 ,v .

Copyright © Open University Malaysia (OUM)


TOPIC 5 CHI-SQUARED TESTS  115

EXERCISE 5.3

A random sample of 200 selected people classified according to their age


(less than 30 and 30 or more) and their preferences on type of cars (local-
produced or imported). The results of this study are shown in the table
below.

Types of Cars Preferred

Age Local-produced Imported

< 30 68 42

30 or more 31 59

Construct an expected frequency table based on the information given.

5.2.1 Test of Independence


The question of independence of the two methods of classifications (variables) can
be investigated using a test of hypothesis based on the chi-square statistics. The
steps are:

Step 1: State the Null and Alternative Hypotheses


H 0 : The two methods of classifications / both variables are independent

H1 : Both variables are dependent

Step 2: Determine the Significance Level and Rejection Region (RR)


The significance level is usually set at α = 0.01 and α = 0.05.

Check the number of rows (r) and column (c) in the related table.
Calculate the degrees of freedom for the test, v = (r – 1) (c – 1).

Next, determine the critical value (based on the chi-square table,


Appendix 3.1), that is χα2 ,v . Reject H 0 if the test statistics value,
X > χα2 ,v .

Copyright © Open University Malaysia (OUM)


116  TOPIC 5 CHI-SQUARED TESTS

Step 3: Calculate the Test Statistics


(a) Calculate the expected frequency values for each cell.
(b) Compute the value of the chi-square statistics, that is

χ =
2 ( O − E )2 .
E
Step 4: Test Result
The results of the test depend on information in Steps 2 and 3.

Step 5: Conclusion
Based on Step 4, conclude whether the two variables are independent.

The following shows you an example of an independent test.

Example 5.5:
We will use the example given in Subtopic 5.2. Based on the data and result
obtained, construct and test the appropriate hypothesis (use α = 0.05).

Answer:

Step 1: State the Null and Alternative Hypotheses

H 0 : Two variables are independent ⇔ H 0 : There is no relationship


between the level of agreement on tax reform and political affiliation

H1 : Two variables are dependent.

Step 2: Determine the Significance Level and Rejection Region (RR)


The significance level which is used is α = 0.05.

We have r: Number of levels for opinions (2)

c: Number of levels for political affiliation (3)

Copyright © Open University Malaysia (OUM)


TOPIC 5 CHI-SQUARED TESTS  117

Hence,

v = (2 – 1) × (3 – 1) = 2

The critical value (based on the chi-square table, Appendix 3.1), is


2
χ 0.05,2 = 5.991. We will reject the H 0 if the test statistics value,
2
X > χ 0.05,2 = 5.991.

Step 3: Calculate Test Statistics

(a) The data on expected and observed frequencies are summarised


in the following table:
(The values inside the bracket represent the expected
frequencies calculated using Formula 5.1)

Vote Party A Party B Party C Total


For 308 190 102 600
(240) (210) (150)
Against 92 160 148 400
(160) (140) (100)
Total 400 350 250 1,000

(O − E ) 2
(b) Compute the chi-square statistics value, that is χ 2 =  .
E

From the table,

X=
( 308 − 240 ) (190 − 210 )
2
+
2
+ ... +
(148 − 100 )
2
= 91.329
240 210 100

Copyright © Open University Malaysia (OUM)


118  TOPIC 5 CHI-SQUARED TESTS

Step 4: Test Result


2
Since X = 91.329 > χ 0.05,2 = 5.991 that is 91.329 > 5.91, therefore we
reject the H 0 .

Step 5: Conclusion
Since the H 0 is rejected, we conclude that the two variables are
dependent where the individuals’ opinions on tax reform depend on
their political affiliation.

Let us try Exercise 5.4.

EXERCISE 5.4

Based on the result of Exercise 5.2, carry out an appropriate hypothesis


test by using α = 0.05.

5.2.2 Test of Homogeneity


The test of independence aims to determine whether two criteria or variables that
are associated with the subject in a population are independent of each other. For
example, subjects chosen at random from a population may be classified according
to their views on certain issues and their political affiliation.

In this test, we test the hypothesis that the population proportions within each
category are the same (homogenous). This applies when either the row or column
totals are predetermined. Data is in the form of a two-way contingency table, which
is on classification of variable and another one on population classification. It is
important to stress that the assumptions and statements under the null and
alternative hypotheses are different but the analysis techniques are the same. Let us
refer to Example 5.6 for a clear explanation.

Copyright © Open University Malaysia (OUM)


TOPIC 5 CHI-SQUARED TESTS  119

Example 5.6:
A two-year study has been carried out on 120 heart-problem patients who are
given two types of drugs, A and B. After a certain time-off period, the conditions
of the patients are classified as “no change”, “show improvement” and
“recovering”. The following table illustrates the distribution of patients.
Determine whether the patients’ conditions are the same although each of them
were given a different type of drug at α = 5%.

Patients’ Condition
Drug
Type No Show
Recovering Total
Change Improvement
A 15 22 33 70
B 20 18 12 50
Total 35 40 45 120

Answer:

Step 1: State the Null and Alternative Hypotheses


H 0 : For each type of drug (A or B), the conditions of patients are the
same

⇔ H 0 : For each type of drug (A or B), the proportions of the three


patients’ condition are the same.

H1 : Otherwise.

Step 2: Determine the Significance Level and Rejection Region (RR)


Since there are two rows and three columns, the degrees of freedom
is, v = (2 – 1)(3 – 1) = 2. Using this value, based on Appendix 3.1, the
2
chi-square value (at α = 5%) is χ 0.05,2 = 5.991. We will reject H 0 if
2
the test statistics X > χ 0.05,2 .

Copyright © Open University Malaysia (OUM)


120  TOPIC 5 CHI-SQUARED TESTS

Step 3: Calculate Test Statistics

(a) The following table contains data on expected frequencies (in


brackets) as well as observed frequencies:

Patients’ Condition
Drug
Type No Show
Recovering Total
Change Improvement
A 15 (20.42) 22 (23.33) 33 (26.25) 70
B 20 (14.58) 18 (16.67) 12 (18.75) 50
Total 35 40 45 120

(b) With this, we can calculate the test statistics as

X=
(15 − 20.42 ) 2
+
( 22 − 23.33) 2
+ ... +
(12 − 18.75) 2
= 7.801
20.42 23.33 18.75

Step 4: Test Result


Since X = 7.801 > 5.991, we reject the H 0 .

Step 5: Conclusion
We conclude that the condition of the patients depends on the type of
drug that they received.

Let us try Exercise 5.5 on tests for homogeneity.

EXERCISE 5.5
A random sample of 100 female students and 100 male students at a local
university were taken for an interview on their favourite sports. Of the
male students, 33% prefer football, 38% favour basketball, 24% love
baseball and the rest like tennis. Meanwhile, for the female students, their
preferences are quite balanced with 38% into football, 21% liking
basketball, 15% preferring baseball and the rest favouring tennis.
Determine the classification variables and population involved. Explain
an appropriate test with any calculation.

Copyright © Open University Malaysia (OUM)


TOPIC 5 CHI-SQUARED TESTS  121

ACTIVITY 5.3

Outline the differences between test of independence and test of


homogeneity. Discuss the answer in the myINSPIRE forum.

5.2.3 Yate’s Continuity Correction


We use Yate’s continuity correction statistics as a chi-square test correction, that is:

( O − E − 0.5)2
X cc =
E

This correction statistics is not only used in 2 × 2 table but also for any data
employing X test statistics and with only one degree of freedom. There are times
when this correction statistics results in a value which is very different from the
value of ordinary X test statistics and this results in the acceptance of H 0 . In this
case, a bigger sample size is needed and repeats the test or uses other appropriate
methods.

Note
It is important to know that the continuity correction will always cause a
reduction in the X value, a fact that can be proven through careful analysis of the
shape. If the test value is in favour of H 0 acceptance, we do not have to calculate
the X cc value as the test result would not give any effect.

Copyright © Open University Malaysia (OUM)


122  TOPIC 5 CHI-SQUARED TESTS

Let us see an application example of Yate’s continuity correction through


Example 5.7.

Example 5.7:
Students in two Form 1 classes, A and B, sat for an examination and the following
results were recorded.

Form 1
Results
Class A Class B
Passed 72 64
Failed 17 23

Carry out a hypothesis test to determine whether there is any difference between
examination results for the two classes using Yate’s continuity correction. Use
5% significance level.

Answer:

Step 1: State the Null and Alternative Hypotheses

H 0 : There is no difference in results for students in class A and B

H1 : Otherwise

Step 2: Determine the Significance Level and Rejection Region (RR)


Since there are two rows and two columns, the degrees of freedom,
ν = (2 – 1)(2 – 1) = 1. Using this value, we obtained from the chi-
2
square table (at α = 5%), χ5% = 3.84. Reject H 0 if the test statistics
2
> χ5% (1).

Copyright © Open University Malaysia (OUM)


TOPIC 5 CHI-SQUARED TESTS  123

Step 3: Calculate the Test Statistics

(a) The following table contains data on expected frequencies (in


brackets) as well as observed frequencies:

Results Class A Class B Total


Pass 72 64
(68.8) (67.2) 136
Fail 17 23
(20.2) (19.8) 40
Total 89 87 176

(b) Hence,

( 72 − 68.8 − 0.5)2 ( 23 − 19.8 − 0.5)2


X cc = + ... + = 0.94
68.8 19.8

Step 4: Test Result


2
Since X cc < χ5% (1) =3.84, we reject the H 0 .

Step 5: Conclusion
In conclusion, there is no significance difference in students’ results
between classes A and B.

SELF-CHECK 5.3

State the condition to use Yate’s continuity correction.

Copyright © Open University Malaysia (OUM)


124  TOPIC 5 CHI-SQUARED TESTS

EXERCISE 5.6

1. In a study involving 5,000 individuals, 2,400 are males. The


relationship between the level of colour-blindness and gender is of
interest. Around 92% of the males and 98% of the women do not
experience colour-blindness. Write down the information given in a
tabular form as shown below:

Factor I
Type
1 2 Total
Factor A a b nA
II
B c D nB

Total n1 n1 n

Test if there exists any significant difference in the level of


colour-blindness according to gender using X cc statistics at 5%
significance level.

2. The following table shows the number of books on loan from a


public library in one particular week.

Day Mon Tues Wed Thurs Fri Sat


Number 204 292 242 283 252 275
of
books

Is there any sufficient evidence to say that the number of books on


loan is the same for all days? Test at 1% significance level.

Copyright © Open University Malaysia (OUM)


TOPIC 5 CHI-SQUARED TESTS  125

3. Twenty football matches involving 40 teams took place between


schools at the national level in 2001. The frequency distribution
table shows the number of goals scored by the teams:

Number of
0 1 2 3 4 5 6 7 8
Goals
Number of
3 5 14 9 3 4 1 1 0
Teams

Test whether the frequency distribution for the number of goals


follows a Poisson distribution at 5% significance level.

4. The data below shows the number of defective items produced by a


local company.

Number of
0 1 2 3 4 5
Defective Items, X
Frequency 22 37 20 13 6 2

Test whether the number of defective items follows a binomial


model with n = 5 and p = 0.3. Use 5% significance level.

5. The frequency distribution for the X variable is shown below:

X 6.000 8.000 10.000 12.000 14.000 16.000 18.000


– – – – – – –
7.999 9.999 11.999 13.999 15.999 17.999 19.999
f 16 21 38 50 48 36 10

The distribution of X is believed to be N(13,3.42). Test whether this


claim is true at 5% significance level.

Copyright © Open University Malaysia (OUM)


126  TOPIC 5 CHI-SQUARED TESTS

6. An academic faculty at a university selected 150 students according


to their year of study to investigate the relationship between year of
study and their grade point average value. The following result is
obtained.

Year of Study
Grade Average
Year 1 Year 2 Year 3
<2.0 14 16 15
2.0–3.0 10 11 11
>3.0 26 23 24

Test at 5% significance level.

7. Using the following data, determine whether three population


proportions are equal in all four categories. Test at 1% significance
level.

Category
1 2 3 4 Total
1 16 38 5 41 100
Population 2 24 41 12 23 100
3 19 36 15 30 100

8. A survey asked 200 students their opinion on the implementation of


a rule regarding the wearing of helmets within the campus area.
Using χ2 test with Yate’s continuity correction and information as
given below, test if there is any difference in opinion between male
and female students. Test at 1% significance level.

Opinion
Gender
Agree Does not Agree
Male 32 11
Female 68 89

Copyright © Open University Malaysia (OUM)


TOPIC 5 CHI-SQUARED TESTS  127

• Analysis on frequency data is performed to determine these properties, which


are:
– The experiment is a multinomial experiment involving identification of
probability and type of distribution.
– Determining dependency and homogeneity between two factors.

• The chi-square statistics used, that is

(O − E ) 2
χ =
2
E

where O is the observed frequency at each cell/category and E is the expected


frequency calculated using formula

 Cj  R 
Eij = N    i 
 N  N 

where, Eij = expected frequency for ij-cell

N = total overall observation


C j = total jth column where j = 1, …, n j

Ri = total ith row where i = 1, …, ni

• The chi-square test statistics approaches the chi-square distribution with k – 1


degrees of freedom in goodness-of-fit test and (r – 1)(k – 1) in test of
independence and test of homogeneity.

• In each case, the approximation to chi-square distribution is accurate if all


expected frequencies are at least 1 and at most 20% of the expected frequencies
are less than 5.

• The Yate’s continuity correction statistics:

( O − E − 0.5) 2
X cc =
E

is used when the 2 × 2 contingency table has only one degree of freedom.
Copyright © Open University Malaysia (OUM)
128  TOPIC 5 CHI-SQUARED TESTS

Expected frequencies – The frequencies for different categories of a


multinomial experiment or for different cells of a
contingency table that are expected to occur when a
given null hypothesis is true.

Goodness-of-fit test – A test of the null hypothesis that the observed


frequencies for an experiment follow a certain pattern
or theoretical distribution.

Multinomial experiment – An experiment with n trials for which: (1) the trials
are identical, (2) there are more than two possible
outcomes per trial, (3) the trials are independent, and
(4) the probabilities of the various outcomes remain
constant for each trial.

Observed frequencies – The frequencies actually obtained from the


performance of an experiment.

Test of homogeneity – A test of the null hypothesis that the proportions of


elements that belong to different groups in two (or
more) populations are similar.

Test of independence – A test of the null hypothesis that two attributes of a


population are not related.

Freund, J. E. (2003). Mathematical statistics (7th ed.). Upper Saddle River, NJ:
Prentice-Hall, Inc.

Mann, P. S. (2005). Introductory statistics using technology (5th ed.). Upper Saddle
River, NJ: John Wiley & Sons, Inc.

Mendenhall, W., Beaver, R. J., & Beaver, B. M. (2013). Introduction to probability


and statistics (14th ed.). Belmont, CA: Thomson Brooks/Cole.

Walpole, R. E. (2006). Probability and statistics for engineers and scientist


(8th ed.). Upper Saddle River, NJ: Prentice-Hall, Inc.

Copyright © Open University Malaysia (OUM)


Topic  Correlation
6
LEARNING OUTCOMES
By the end of this topic, you should be able to:
1. Explain correlation concepts and the relationship between two
variables;
2. Use a two-way scatter plot to show the relationship between two
variables;
3. Utilise Pearson correlation coefficient to show the relationship
between two variables; and
4. Apply the Spearman rank correlation coefficient.

 INTRODUCTION
Firstly, what is correlation?

Correlation is a measurement of the strength of a linear relationship


between two variables.

Copyright © Open University Malaysia (OUM)


130  TOPIC 6 CORRELATION

Both variables are usually denoted as X and Y and their distributions approximate
to normal distribution. There are three types of relationships between X and Y,
which are explained in Table 6.1.

Table 6.1: Three Types of Relationship between X and Y

Type Meaning
Positive linear One variable increase, the other variable tends to increase linearly.
correlation
Negative linear One variable tends to decrease linearly as the other variable
correlation increases.
No correlation There is no linear relationship between two variables.

These three relationships between two variables can be categorised into four
conditions:
(a) Perfect;
(b) Strong;
(c) Weak; and
(d) No linear relationship.

The linear relationship for these four conditions can be clearly visualised by using
a graphical display, such as a two-way scatter plot.

However, judgment based on the graph is very subjective and at times, not accurate.
As such, to accurately determine the condition of this relationship, a quantitative
measurement known as correlation coefficient is needed. It is usually denoted by
ρ for population, which is usually unknown. This population parameter is
estimated by the sample correlation coefficient, r. The value of r always lies
between –1 and 1:
–1.00 ≤ r ≤ +1.00

Copyright © Open University Malaysia (OUM)


TOPIC 6 CORRELATION  131

Table 6.2 explains the r values for each of the four conditions with regard to the
three types of relationships between two variables.

Table 6.2: r Values and Relationship between Two Variables

No. r Value Relationship between Two Variables

1 r = –1.00 There exists a perfect negative linear relationship.

r = +1.00 There exists a perfect positive linear relationship.

2 –1.00 < r < –0.50 There exists a strong negative linear relationship.

+0.50 < r < +1.00 There exists a strong positive linear relationship.

3 –0.50 < r < 0 There exists a weak negative linear relationship.

0 < r < +0.50 There exists a weak positive linear relationship.

4 r=0 There is no linear relationship between the two variables.

There are two types of sample correlation coefficients, which are Pearson
correlation coefficient and Spearman correlation coefficient. Their application
depends on the types of data. The Pearson correlation coefficient is used for
quantitative data, in discrete and continuous forms.

Meanwhile, the Spearman correlation coefficient is used for rank data. So, the
name Spearman rank correlation coefficient is also sometimes used in other
discussions.

SELF-CHECK 6.1

1. Define the meaning of correlation.


2. Explain the differences in correlation situations between two
variables.

Copyright © Open University Malaysia (OUM)


132  TOPIC 6 CORRELATION

ACTIVITY 6.1

Give an idea on the type of correlations (positive, negative and none) that
we can expect from the following statements:
(a) Students’ grade and height;
(b) An individual’s weight and cholesterol level found in blood;
(c) The amount of ice-cream sold and ambient temperature; and
(d) Price of rubber and amount of rainfall.

Discuss the answers in the myINSPIRE forum.

6.1 TWO-WAY SCATTER PLOT


What is a two-way scatter plot?

A two-way scatter plot is a two-dimensional graph which shows the


relationship between two variables, X and Y.

The horizontal axis represents the X variable and the vertical axis represents
the Y variable. Let us look at some figures that show you the plots that could
explain the relationship between two variables. First, look at Figure 6.1.

(a) Perfect positive linear (b) Perfect negative linear


relationship relationship relationship

Figure 6.1: Two types of perfect linear relationship

Copyright © Open University Malaysia (OUM)


TOPIC 6 CORRELATION  133

Figure 6.1(a) shows the X and Y variables having a perfectly positive linear
relationship as every value of the Y variable increases as the value of X increases
and all points fall on a straight line.

Figure 6.1(b) presents a perfectly negative linear relationship as every value of Y


variable decreases as the value of X increases and all points fall on a straight line.

Now, let us move on to Figure 6.2 which shows you two types of strong linear
relationship.

(a) Strong positive linear (b) Strong negative linear


correlation correlation

Figure 6.2: Two types of strong linear relationship

Figures 6.2(a) and 6.2(b) display a strong positive and negative linear relationship
respectively. These are said to be strong conditions as most of the points fall near
the straight line. Next is Figure 6.3. It shows you two types of weak linear
relationship.

(a) Weak positive linear correlation (b) Weak negative linear correlation

Figure 6.3: Two types of weak linear relationship

Copyright © Open University Malaysia (OUM)


134  TOPIC 6 CORRELATION

As we can see, Figures 6.3(a) and 6.3(b) display a weak positive and negative linear
relationship respectively. This is because most of the points fall far from the straight
line.

Lastly, let us look at Figure 6.4. It shows no linear correlation between the X and Y
variables.

Figure 6.4: No linear relationship

You can try Exercise 6.1 on the application of the two-way scatter plot.

SELF-CHECK 6.2

1. What is a two-way scatter plot?


2. What are the possible relationships between two variables?

Copyright © Open University Malaysia (OUM)


TOPIC 6 CORRELATION  135

EXERCISE 6.1

For each pair of two-way scatter plot, identify which one has a higher
value of correlation coefficient, r, and state its direction.

Copyright © Open University Malaysia (OUM)


136  TOPIC 6 CORRELATION

6.2 PEARSON CORRELATION COEFFICIENT


Pearson ( rp ) correlation coefficient is used for quantitative data, for both discrete
and continuous forms. It is generated from the Pearson product moment for n pairs
of variables (X, Y). The formula is:
sxy
rp = Formula 6.1
sx s y

where

sxy = Covariance (X, Y) =  ( xi − x )( yi − y )


n −1

sx = Standard deviation of X = 
( xi − x )2
n −1

sy = Standard deviation of Y =
 (Yi − y ) 2
n −1

Formula 6.1 can be simplified to:

n  xi y i − (  xi )(  yi )
rp = Formula 6.2



( n xi2 − (  xi )
2
) ( n



yi2 − (  yi )
2
) 

Copyright © Open University Malaysia (OUM)


TOPIC 6 CORRELATION  137

In calculating the Pearson correlation coefficient using Formula 6.2, it is easier if


the values are arranged such as in Table 6.3.

Table 6.3: Pearson Correlation Coefficient Using Formula 6.2

xi yi xi yi x i2 yi2

x1 y1 x1 y 1 x12 y12

x2 y2 x2 y 2 x22 y 22

x3 y3 x3 y 3 x 32 y 32

⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅

 xi  yi  xi yi  xi2  yi2

Example 6.1:
A teacher would like to prove to her students that playing computer games
affected academic performance. She claimed that the more time they spent
playing computer games, the lower their examination marks would be. A random
sample of 10 students was taken and their data was recorded as below:

Time (Hours per Week) 4 10 14 12 4 5 8 11 13 15


Examination Marks 26 17 7 12 30 40 20 15 10 5

Copyright © Open University Malaysia (OUM)


138  TOPIC 6 CORRELATION

Answer:
To prove a negative linear relationship between time spent (in hours per week)
and students’ examination marks, we should calculate the Pearson correlation
coefficient, rp . In this problem, we define time spent on computer games as the
X variable and students’ examination marks as the Y variable. Next, we can
construct this table:

xi yi xi yi x i2 y i2

4 26 104 16 676
10 17 170 100 389
14 7 98 196 49
12 12 144 144 144
4 30 120 16 900
5 40 200 25 1,600
8 20 160 64 400
11 15 165 121 225
13 10 130 169 100
15 5 75 225 25
96 182 1,366 1,076 4,408

n  xi y i − (  xi )(  yi )
rp =



( n x − (  x ) )   ( n y − (  y ) ) 
2
i i
2 2
i i
2

10 (1,336 ) 96 (182 )
= −
10 (1, 076 ) − ( 96 ) 10 ( 4, 408 ) − (182 )
2 2

= −0.927

The Pearson correlation coefficient value –0.927 shows a strong negative linear
relationship between time spent on playing computer games and students’
performance. Hence, we can conclude that if a student spends a large amount of
time playing computer games, this will affect his or her academic performance.

Copyright © Open University Malaysia (OUM)


TOPIC 6 CORRELATION  139

EXERCISE 6.2

A farmer aims to investigate whether a new fertiliser which he has started


using is effective in increasing his crop production. He records the
frequency of time using that fertiliser in seven areas at his farm and the
production results of his crop in each of those areas. The following data
was recorded.

Farm Area A1 A2 A3 A4 A5 A6 A7

Frequency of Fertiliser Used 1 2 4 5 6 8 10


Crop Production (in kg) 2 3 4 7 12 10 7

Compute the correlation between the fertiliser use and crop production.
Give the conclusion on the value of the correlation coefficient obtained.

6.2.1 Pearson Correlation Coefficient Significance Test


The calculated Pearson correlation coefficient ( rp ) value is a sample statistics,
hence, it is only an estimation of the actual population parameter for correlation,
ρ. In this case, we need to test for its significance so that we can draw a conclusion
about the population parameter ρ based on information from sample correlation
coefficient rp .

If there is a non-linear relationship or no linear relationship between two variables,


then ρ p = 0. To determine whether we can conclude the population parameter ρ p
value is not zero, we will test the following hypothesis:

H0 : ρp = 0

H1 : 1. ρ p > 0

2. ρp < 0
3. ρp ≠ 0

Copyright © Open University Malaysia (OUM)


140  TOPIC 6 CORRELATION

n−2
Test statistics: T = rp
1 − rp2

Test result: T follows a t distribution with v = n – 2 degrees of freedom and α


significance level.

Reject H 0 when:
1. T > tá,v
2. T < –tá,v
3. |T| > tá/2,v

Let us look at Example 6.2.

Example 6.2:
Refer back to Example 6.1. Perform the Pearson correlation coefficient ρ p
significance test at a 0.05 significance level.

Answer:
We will use one-tailed hypothesis testing since we know that the correlation
coefficient ρ p value is negative. Hence,

H0 : ρp = 0

H1 : ρ p < 0

Test statistics:

n−2
T = rp
1 − rp2
10 − 2
= −0.927
1 − ( −0.927 )
2

= −6.99

Copyright © Open University Malaysia (OUM)


TOPIC 6 CORRELATION  141

Test result: T follows a t distribution with v = 10 – 2 = 8 degrees of freedom and


0.05 significance level.

Reject H 0 when:

T < −t0.05,8 = −1.86

Since T = –6.99 < – t0.05,8 = –1.86, we reject the H 0 and we have strong evidence
to conclude that ρ p < 0. This shows a significant relationship at 5% significance
level, if a student spends most of his/her time playing computer games, this
results in less time spent on revision, hence, their poor academic performance.

EXERCISE 6.3

Refer to Exercise 6.2. Test the significance of the Pearson correlation


coefficient ρ p at 1% significance level.

6.3 SPEARMAN RANK CORRELATION


COEFFICIENT
Another type of correlation coefficient is called the Spearman rank correlation
coefficient ( rs ), which is also a sample correlation coefficient. The Spearman
correlation coefficient is used if the data is qualitative but can be ranked. The rank
for the X variable value is denoted by the symbol U, while the rank for the Y variable
value is denoted by the symbol V. The Spearman rank correlation coefficient for n
numbers of rank (U, V) follows this formula:
suv
rs = Formula 6.3
su sv

where

suv = Covariance (U,V)


su = Standard deviation of U
sv = Standard deviation of V

Copyright © Open University Malaysia (OUM)


142  TOPIC 6 CORRELATION

However, to facilitate the calculation, Formula 6.3 can be simplified to:

6 D 2
rs = 1 − Formula 6.4
(
n n2 − 1 )
with D = U – V that is the difference between ranks U and V. The calculation process
using Formula 6.4 can be further simplified if the values are placed in Table 6.2.

Table 6.2: Spearman Rank Correlation Coefficient Using Formula 6.4

xi ui yi vi Di D i2

x1 u1 y1 v1 D1 D12

x2 u2 y2 v2 D2 D 22

x3 u3 y3 v3 D3 D32

⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅
xn un yn vn Dn D n2

 D2
Let us look at Example 6.3.

Example 6.3:
A teacher aims to investigate if there exists any difference between male and female
students on the level of difficulty faced in Form 5 subjects taken by social science
students. The teacher asks 10 male and 10 female students to provide their score on
the level of difficulty in 10 subjects, which are Additional Mathematics (AM),
History (HIS), Modern Mathematics (MM), Geography (GEO), English Language
(EL), Accounting Principle (AP), Islamic Studies (IS), Science (SC), Finance (FIN)
and Malay Language (ML). Each student is requested to give a score of 1–5 for each
subject whereby Score 1 means the easiest and Score 5 means the most difficult. Is
there any relationship between male and female students on the level of difficulty
for the subjects that they took?

Copyright © Open University Malaysia (OUM)


TOPIC 6 CORRELATION  143

Subjects AM HIS MM GEO EL AP IS SC FIN ML


Male Students’
45 33 20 24 43 39 13 36 28 15
Score
Female
34 15 30 38 26 45 17 20 48 40
Students’ Score

Answer:
Firstly, we need to determine the X and Y variables. Define total subjects’ scores
by male students as X variable and Y variable as total subjects’ scores by female
students. Prior to obtaining the Spearman rank correlation coefficient, rs , we
need to convert the data into rank form. In deciding the ranks, the scores can be
arranged in a descending order, that is, the highest score is given rank 1, the
second highest is rank 2 and the lowest score is rank 10. The subjects’ rank for
male (U) and female (V) students along with their differences (D) are displayed
in the following table:

xi ui yi vi Di D i2

45 1 34 5 –4 16
33 5 15 10 –5 25
20 8 30 6 2 4
24 7 38 4 3 9
43 2 26 7 –5 25
39 3 45 2 1 1
13 10 17 9 1 1
36 4 20 8 –4 16
28 6 48 1 5 25
15 9 40 3 6 36

 D 2 = 158

Copyright © Open University Malaysia (OUM)


144  TOPIC 6 CORRELATION

6 D 2 6 (158 )
rs = 1 − = 1− = 0.0424
(
n n2 − 1 ) (
10 10 2 − 1 )
The Spearman correlation coefficient value is 0.0424. This means there is almost
no linear relationship between the opinions of male and female students on the
level of difficulty of the subjects that they took.

EXERCISE 6.4

Ten athletes were ranked at the beginning of a sports match. After the
match, their position in the match was recorded. The data is in the table
below:

Athlete 1 2 3 4 5 6 7 8 9 10
Ranking 1 2 3 4 5 6 7 8 9 10

Position in
3 5 2 1 10 4 9 7 8 6
the Match

Obtain the correlation between ranking and their position in the match.
Comment on the value of the correlation coefficient.

SELF-CHECK 6.3

What is the difference between the Spearman and Pearson correlation


coefficients?

Copyright © Open University Malaysia (OUM)


TOPIC 6 CORRELATION  145

6.3.1 Spearman Rank Correlation Coefficient


Significance Test
Lastly, let us look at the Spearman rank correlation coefficient significance test.
The Spearman rank correlation coefficient ( rs ) is an estimation of the population
parameter ρ s . When there exists a non-linear relationship or no linear relationship
between two variables, ρs = 0. To examine whether we can conclude that the
population parameter ρ p value is not zero, we will carry out the following
hypothesis test:

H 0 : ρs = 0
H1 : 1. ρs > 0
2. ρs < 0
3. ρs ≠ 0
n−2
Test statistics: T = rs
1 − rs2

Test result: T follows a t distribution with v = n – 2 degrees of


freedom at α significance level.

Reject H 0 when:
1. T > tá,v
2. T < – tá,v
3. |T| > tá/2,v

Copyright © Open University Malaysia (OUM)


146  TOPIC 6 CORRELATION

Let us look at Example 6.4.

Example 6.4:
Refer to Example 6.3. Test the significance of the Pearson correlation coefficient
rs at a 0.05 level of significance.

Answer:
We will use a one-sided hypothesis test as we know the correlation coefficient
value rs is positive. As such,

H 0 : ρs = 0

H1 : ρs > 0

Test statistics:

n−2
T = rs
1 − rs2
10 − 2
= 0.0424
1 − ( 0.0424 )
2

= 0.12

Test result: T follows a t distribution with v = 10 – 2 = 8 degrees of freedom and


a 0.05 significance level.

Reject H 0 when T > t0.05,8 = 1.86

Since T = 0.12 < t0.05,8 = 1.86, we do not reject the null hypothesis ( ρs = 0).
Hence, we can conclude that the value of the population parameter ρ is zero. In
other words, there is no relationship between the opinions of male and female
students.

Now, do you know when the Pearson and Spearman coefficients are used? If you
are still not sure, please reread this topic carefully.

Copyright © Open University Malaysia (OUM)


TOPIC 6 CORRELATION  147

EXERCISE 6.5

Refer to Exercise 6.4. Test the significance of the correlation coefficient


at a 1% significance level.

• Correlation is a measurement of the strength of a linear relationship between


two variables.

• Three types of relationship exist between X and Y. These are positive linear
correlation, negative linear correlation and no correlation.

• These three relationships between two variables can be categorised into perfect,
strong, weak and no linear relationship.

• A two-way scatter plot can be used to roughly show the relationship between
two variables, whether there is a positive linear, negative linear or no
relationship.

• The Pearson (rp ) correlation coefficient is used for quantitative data, for both
discrete and continuous forms. It is generated from the Pearson product moment
for n pairs of variables (X, Y).

• The Spearman rank correlation coefficient ( rs ) is also a sample correlation


coefficient. It is used if the data is qualitative but can be ranked.

Copyright © Open University Malaysia (OUM)


148  TOPIC 6 CORRELATION

Linear correlation coefficient – A measure of the strength of the linear


relationship between two variables.

Scatter diagram – A plot of paired observations of x and y.

Dielman, T. E. (2004). Applied regression analysis: A second course in business


and economic statistics (4th ed.). Belmont, CA: Thomson Brooks/ Cole.

Freund, J. E. (2003). Mathematical statistics (7th ed.). Upper Saddle River, NJ:
Prentice-Hall, Inc.

Mann, P. S. (2005). Introductory statistics using technology (5th ed.). Upper Saddle
River, NJ: John Wiley & Sons, Inc.

Mendenhall, W., Beaver, R. J., & Beaver, B. M. (2013). Introduction to probability


and statistics (14th ed.). Belmont, CA: Thomson Brooks/Cole.

Walpole, R. E. (2006). Probability and statistics for engineers and scientist


(8th ed.). Upper Saddle River, NJ: Prentice-Hall, Inc.

William, M., & Terry, S. (2003). A second course in statistics: Regression analysis.
(6th ed.). Upper Saddle River, NJ: Prentice-Hall, Inc.

Copyright © Open University Malaysia (OUM)


Topic  Simple Linear
Regression
7 Analysis
LEARNING OUTCOMES
By the end of this topic, you should be able to:
1. Explain regression concepts;
2. Construct a simple linear regression model and identify the
assumptions made;
3. Prove mathematically how the regression model is constructed by
using the least squares estimate method;
4. Determine inferential concepts for regression parameters; and
5. Use appropriate methods to evaluate data suitability in fitting a
regression model.

 INTRODUCTION
In Topic 6, you were introduced to methods to visually check the relationship
between two variables by using a two-way scatter plot and to measure the strength
of the relationship by using correlation coefficient. If a relationship exists, we
would like to know the meaning of the relationship. Once we have determined the
relationship in terms of formula, we will be able to predict the value of a variable
given the value of the other variable.

Copyright © Open University Malaysia (OUM)


150  TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS

Simple linear regression is a statistical method used to examine a linear


relationship between two variables. Take note that only quantitative variables are
considered in this case.

Let us learn about simple linear regression in the following subtopics. Happy
reading!

7.1 INTRODUCTION TO REGRESSION


CONCEPTS
Regression analysis concepts deal with finding the best relationship between a
dependent variable, Y, and independent variable, X, quantifying the strength of that
relationship, and using methods that allow for the prediction of the response values
(Y) given the values of the regressor x. The y variable value can be determined only
if the independent variable values (denoted by x1 , x2 , …., xk where k is the
number of independent variables) are known.

What are examples of dependent variables? Amount of electricity consumption in


a house, profit made by a company, students’ grades for a final examination and
selling price of a house. These are considered as dependent variables as their values
depend on other variables.

For example, the amount of electricity consumption in a house depends on outside


temperature during the day. If the temperature for the day is high, the occupants of
the house would most probably turn on the air-conditioner or fan to cool down.
Hence, we can say that temperature is an independent variable since it is the factor
that influences the amount of electricity consumption in a house. Another possible
variable is the number of electrical appliances in a house. The more appliances the
house has, the greater the amount of electricity consumption in the house.

What is regression analysis?

Regression analysis is an analysis used to determine the mathematical


relationship between these variables through a linear equation termed as
regression model.

Copyright © Open University Malaysia (OUM)


TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS  151

From the regression model, we can predict the y value for a given value of x.

SELF-CHECK 7.1

Define regression analysis in your own words.

ACTIVITY 7.1
Discuss in the myINSPIRE forum the independent variables for the
following dependent variables:
(a) Profit made by a firm;
(b) Students’ final examination grade; and
(c) Selling price of a house.

7.2 SIMPLE LINEAR REGRESSION MODEL AND


ITS ASSUMPTIONS
A simple linear regression model involves only one variable, that is for k = 1 case.
Multiple linear regression is employed for cases involving more than one
independent variable (k > 1). A simple linear regression model is written as:

y = β0 + β1 x+ ∈

∈ refers to the random variable for errors/residuals. Errors/residuals exist due to


imperfect relationship between variables and measurements are rarely done without
errors. To further understand errors, let us see the following example.

A property development manager would like to know the estimation of the


selling price for each house that will be built. He knows that the cost to build
a house is RM90 for each square feet and the land price is RM25,000 for an
area of 4,500 square feet.

Copyright © Open University Malaysia (OUM)


152  TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS

Hence, the manager can estimate the selling price using the model below:
y = 25,000 + 90x Formula 7.1

where y = Selling price and x = House size in square feet. If the house is 2,000
square feet, the price would be RM205,000, that is:
y = 25,000 + 90(2,000) = 205,000

However, this is only an estimated price and the actual price (based on observation)
would be between RM180,000 and RM250,000. For this reason, to reflect the actual
situation, another simple linear regression model replaces the previous model, that
is:
y = 25,000 + 90x + ∈ Formula 7.2

where ∈ is a random variable for errors representing all other variables which are
not considered in the model (see Figure 7.1).

Figure 7.1: Estimation model

In other words, the selling price for the same size will also differ due to other factors
such as location, number of bedrooms, toilets and other unknown factors.

Copyright © Open University Malaysia (OUM)


TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS  153

Simple linear regression model y = β 0 + β1 x is a population model and regression


coefficients β 0 and β1 values are population parameters. It is difficult to get these
values of the population parameter and for this purpose, sample data is collected to
estimate the values. The estimation model is as seen in Formula 7.3.

yˆ = βˆo + βˆ1x Formula 7.3

where ŷ is the predicted/fitted value for y, β̂0 is the estimation for population
parameter β 0 and β̂1 is the estimation for population parameter β1. The estimation
model (Formula 7.3) is a linear formula with the β̂1 parameter as the regression
slope and β̂0 parameter as the y-intercept, which is the y value when x is zero (see
Figure 7.1).

However, in most cases, when x = 0, the y value does not carry any significant
meaning and at times, it is not possible for x = 0 to happen. The slope of a straight
line is a fixed value that explains the changes (increasing or decreasing) in the y value
given a one unit change in the x value.

Errors (see Figure 7.1) are obtained from the difference between y observed values
with ŷ fitted values. This is denoted by ∈i for i = 1, 2…n and the formula is:

∈i = yi − yˆi Formula 7.4

The residuals, ∈i is a random variable. To determine whether a calculated simple


linear regression is a good estimate for the population, we need to ensure that the
∈i random variable satisfies a few conditions. The assumptions made on the ∈i
random variable are:

(a) ∈i is distributed as normal; that is ∈i ~ N(0, s 2 ), i = 1, 2,…, n.

(b) The mean for ∈i is zero, that is E(∈i ) = 0, i = 1, 2,…, n.

(c) The standard deviation for ∈i is s; that is s(∈i ) = s, i = 1, 2, …., n fixed

(d) ∈i for any y value is independent of ∈i for other values of y.

Copyright © Open University Malaysia (OUM)


154  TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS

Assumption 1 is made to facilitate the inferential processes (hypothesis test and


confidence interval) on the significance of relationship between x and y, as
displayed by the fitted line. Assumptions 2 and 3 refer to the linearity of a regression
model. Suppose we have the population regression model as below:

y = β0 + β1x + ∈ Formula 7.5

For each x value, y is distributed as normal with mean

E ( y ) = β0 + β1 x Formula 7.6

and standard deviation

s ( y ) = ∈∈ Formula 7.7

Observe from Formula 7.6, mean E(y) depends on x, but the standard deviation does
not depend on anything. This is because σ∈ is fixed for all x values. The visual
display of simple linear regression is shown in Figure 7.2.

Figure 7.2: Simple linear regression model

Copyright © Open University Malaysia (OUM)


TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS  155

Let us try Exercise 7.1 to test your understanding.

EXERCISE 7.1

Given the regression equation ŷ = –12.84 + 36.18x, state the values of β̂0
and β̂1 and explain both values. Next, calculate the residuals using the
following data:

x 8.3 8.3 12.1 12.1 17.0 17.0 17.0 24.3 24.3 24.3 33.6

y 227 312 362 521 640 539 728 945 738 759 1263

7.3 LEAST SQUARES METHOD


Using the data available, how can we derive a simple linear regression model
yˆ = βˆo + βˆ1 x ? In Topic 6, we learned about two-way scatter plot to visualise the
relationship between two variables and in this topic, between independent and
dependent variables. If there exists a linear relationship, we would be able to draw
a straight line across all available data. However, this situation is rare due to errors
or residuals.

When the straight line fails to capture all the data (point (x,y) on the graph), what
must we do to obtain the best straight line? This best straight line refers to the fitted
straight line that we build in the two-way scatter plot that best represents the
relationship between the two variables. This fitted line would be a straight line that
is close to points (x,y) and when the errors between the points on the straight line
(estimated) and actual observed points are minimised.

Copyright © Open University Malaysia (OUM)


156  TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS

However, the total errors∈i does not represent the distance between the actual
and observed points. Let us look at an example to prove why  ( yi − yˆi ) is not
suitable to represent the distance value of the actual and observed points in
Figure 7.3.

Figure 7.3: Data (a) and (b)

With reference to Figures 7.3(a) and 7.3(b), we can see that the positions of the two
data sets, data (a) and (b), are different. The total errors for data (a) and data (b) are
calculated as in Table 7.1.

Table 7.1: Total Errors for Data (a) and Data (b)

Data (a) Data (b)

∈i = yi − yˆi ∈i = yi − yˆi
8–6=2 7–6=1
1 – 5 = –4 6–5=1
6–4=2 2 – 4 = –2

∈i = 0 ∈i = 0

Copyright © Open University Malaysia (OUM)


TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS  157

Total errors are zero for both data (a) and (b), and this always holds. This figure
shows that the distance of data points (a) and (b) from the regression line is the
same.

However, from both graphs in Figure 7.3, we can see this is not true. There are
differences in positions of data points (a) and (b) from the regression line where
data points (b) are closer to the regression line compared to data points (a). Hence,
∈i is not suitable to be used as a selection criteria.
How can we solve this problem? We can solve this by squaring each error before
 ( yi − yˆi )
2
summing them up. Table 7.2 gives you the values of for data (a)
and (b).

 ( yi − yˆi )
2
Table 7.2: The Values of for Data (a) and Data (b)

Data (a) Data (b)

∈i2 = ( yi − yˆi ) ∈i2 = ( yi − yˆi )


2 2

( 8 − 6 )2 = 4 ( 7 − 6 )2 = 1
(1 − 5) ( 6 − 5)
2 2
= 16 =1

( 6 − 4 )2 = 4 ( 2 − 4)2 = 4

 (∈i )  (∈i )
2 2
= 24 =6

 ( yi − yˆi )
2
Based on values for both data (a) and (b), it shows that the total sum
of squares for data (b) is smaller than (a). This proves that points for data (b) are
nearer to the regression line and this line is the best fitted line. This method to obtain
the best fitted line based on least squares summation is known as the least squares
method.

Copyright © Open University Malaysia (OUM)


158  TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS

To fit the regression line, we need to compute the estimates for regression
coefficients β 0 and β1. Using the least squares method, the formula for regression
coefficient β1 is as in Formula 7.8.
n
 xi yi − nxy
βˆ1 = i =1
n
Formula 7.8
 xi2 − nx 2

i =1

where

β̂1 = Estimated value of regression coefficient ß1


xi = Value of independent variable
yi = Value of dependent variable
x = Mean value of independent variable
y = Mean value of dependent variable
n = Number of (x,y) pairs

After getting the estimate for β1 , we can derive the value for β 0 . The formula to
get β̂0 is shown in Formula 7.9.

βˆ0 = y − βˆ1x Formula 7.9

where

βˆ0 = Estimated value of regression coefficient β0

Copyright © Open University Malaysia (OUM)


TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS  159

Let us look at Example 7.1.

Example 7.1:
For the following data, find the value of regression coefficients β̂0 and βˆ1 , and
write down the fitted regression model:

x 3 7 6 6 10 12 12 12 13 13 14 15
y 33 38 24 61 52 45 29 65 82 63 50 79

Answer:
To facilitate the calculation of parameter values β̂0 and βˆ1 , we can form a table
as below:

xi yi x i yi x i2 yi2

3 33 99 9 1,089
7 38 266 49 1,444
6 24 144 36 576
6 61 366 36 3,721
10 52 520 100 2,704
12 45 540 144 2,025
12 29 348 144 4,225
12 65 780 144 6,724
13 82 1,066 169 841
13 63 819 169 3,969
14 50 700 196 2,500
15 79 1,185 225 6,241

 xi = 123  yi = 621  xi yi = 6,833  xi2 = 1, 421  yi2 = 36, 059

Copyright © Open University Malaysia (OUM)


160  TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS

From the table, first we need to calculate x and y , x =


 xi = 123 = 10.25 and
n 12

y=
 yi = 621 = 51.75. Now, we can get the β̂1 regression coefficient using
n 12
this formula:
n
 xi yi − nxy 6833 − 12 (10.25 )( 51.75 )
βˆ1 = i =1
= = 2.92
1421 − 12 (10.25 )
n 2
 xi2 − nx 2

i =1

and for the β̂0 regression coefficient,

βˆ0 = y − βˆ1x = 51.75 − 2.92 (10.25 = 21.82 )

Hence, the simple linear regression model is ŷ = 21.82 + 2.92x.

You can try some online activities at https://www.texasoft.com/winkslr.html. Don’t


forget to try Exercise 7.2.

SELF-CHECK 7.2

State the application of the least squares estimate method.

EXERCISE 7.2

Fit a simple linear regression model for the data below:

x 60 62 64 65 66 67 68 70 72

y 63.6 65.2 66.0 65.5 66.9 67.1 67.4 68.3 70.1

Interpret the regression coefficients obtained in this model.

Copyright © Open University Malaysia (OUM)


TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS  161

7.4 INFERENCES ON REGRESSION


COEFFICIENTS
Inferential statistics is a branch of statistics concerning making conclusions about
population based on information from samples. The calculated regression
coefficients β̂0 and βˆ1 , from sample data are only an estimation of population
parameters.

In other words, regression coefficients values are subject to sampling errors.


Regression coefficient values, whether positive or negative, do not necessarily
mean that the intended population parameters possess the sample values. Hence, a
test is needed to verify whether the regression coefficients obtained are in positive
or negative form, which is not a zero value.

We are going to test the parameter for the population regression slope β1 using the
β̂1 regression coefficient. The hypothesis-testing process for testing population
parameter β1 is similar to that of testing mean and variance. We will begin with a
hypothesis statement. The null hypothesis claims there is no linear relationship,
which means the slope of the regression line is zero. If we accept the null
hypothesis, this means the population regression line is a straight line that shows
the y value does not change with the changes in the x value. In this case, information
on x is not enough to assist in predicting the y value.

On the other hand, if the null hypothesis is rejected, there is enough evidence to say
β1 is not zero, that is either β1 > 0 or β1 < 0. This shows that the regression line has
a tendency to increase or decrease, and this helps in predicting the y value using the
x value.

We can perform either a one-sided ( β1 > 0 or β1 < 0) or a two-sided ( β1 ≠ 0) test to


determine whether there is enough evidence to conclude the existence of a linear
relationship (that is population β1 is not zero). Hence, test the hypothesis:

H 0 : β1 = 0
H1 : 1. β1 > 0
2. β1 < 0

3. β1 ≠ 0

Copyright © Open University Malaysia (OUM)


162  TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS

βˆ1 − βˆ βˆ
Test statistics: T = =
s ( βˆ1 ) s ( βˆ1 )

Test result: T follows t distribution with v = n – 2 degrees of freedom and α


significance level.

Reject H 0 when:
1. T > tá,v
2. T < –tá,v
3. |T| > tá/2,v

s ( βˆ1 ) is the standard deviation for βˆ1. The formula to get the standard deviation
for β̂1 is:

 yi2 − βˆ0  yi − βˆ1  xi yi


s ( βˆ1 ) = n−2
 xi2 − nx 2
Apart from hypothesis testing, we can also construct a confidence interval for β1.
The confidence interval will provide a confidence range that contains the value of
the population parameter at a certain α level. Based on T test statistics (two-sided)
that follow tn − 2 distribution, we can construct a (1 – α) 100% confidence interval
as below:

βˆ1 − tα /2,n−2 s(βˆ1 ) ≤ β1 ≤ βˆ1 + tα /2,n−2 s(βˆ1 )

Copyright © Open University Malaysia (OUM)


TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS  163

Let us look at Example 7.2.

Example 7.2:
Based on the data in Example 7.1, prove that at 0.05 significance level, there is
enough evidence to say that there is a linear relationship between x and y, that is
( β1 ≠ 0). Construct a 95% confidence interval for β1.

Answer:
The hypothesis statement:

H 0 : β1 = 0

H1 : β1 ≠ 0

βˆ1 2.92
Test statistics: T = = = 2.317
s ( βˆ1 ) 1.26

Test result: T follows a t distribution with v = 12 – 2 =10 degrees of freedom


at 0.05 significance level.

Reject H 0 when:

|T| > t0.025,10 = 2.228

Prior to obtaining the test statistics value, we need to calculate the value of s ( βˆ1 ).

36, 059 − 21.82 ( 621) − 2.92 ( 6,833)


s ( βˆ1 ) = 10
1, 421 − 12 (10.25 )
2

= 1.26

Copyright © Open University Malaysia (OUM)


164  TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS

Since the test statistics (T = 2.317) > 2.228 ( t0.025,10 ), we reject the H 0 . Hence,
we can conclude that β1 is not zero, that there is enough evidence of the existence
of a linear relationship between x and y.

95% confidence interval (hence α = 0.05) for β1 is:

( ) ( )
βˆ1 − t0.025,10 s βˆ1 ≤ β1 ≤ βˆ1 + t0.025,10 s βˆ1
2.92 − 2.228 (1.26 ) ≤ β1 ≤ 2.92 − 2.228 (1.26 )
0.113 ≤ β1 ≤ 5.727

This confidence interval shows that the y value will increase between 0.113 and
5.727 for each increment in x. The wide range for β1 is due to the small sample
size.

A test can also be performed on y-intercept β0 using regression coefficient βˆ0 .


However, as discussed in Subtopic 7.2, in most cases, the y-intercept does not
carry any meaning, hence a test on its value can be ignored.

EXERCISE 7.3

Answer the following questions based on the data in Exercise 7.2:

(a) Test the significance of the β1 parameter at 0.05 level;

(b) Construct a 99% confidence interval for β1. Interpret this


confidence interval.

Copyright © Open University Malaysia (OUM)


TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS  165

7.5 MODEL ADEQUACY CHECK


A confidence interval that constructs based on available data must be able to
represent the population involved. The fitted regression model should satisfy all
assumptions in the underlying model. The inferential model is not valid if these
assumptions are not satisfied. There are three methods to check model adequacy:

(a) Coefficient of determination, R 2 ;

(b) Residual plot; and


(c) Transformation.

7.5.1 Coefficient of Determination, R 2


What is coefficient of determination?

Coefficient of determination, is a measurement of the proportion of


variation in the dependent variable that can be explained by the fitted
regression model.

To further understand the coefficient of determination, let us look at Figure 7.4.

Figure 7.4: Coefficient of determination

Copyright © Open University Malaysia (OUM)


166  TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS

This is similar to say that we are quantifying the contribution of predicting the value
of y. Let us refer back to Figure 7.4, for each x value. For example, for x0 , we can
separate the y0 deviation from mean y into two parts; one part is for explained
variation and the other part for unexplained variation. Total variation is the total
 ( yi − y ) .
2
sum of squares of deviations from the mean of the y points, that is
This can be derived from the variation term in y, that is:
yi − y = ( yi − yˆ ) + ( yˆ − y )
 ( yi − y )2 = ( yi − yˆ )2 +  ( yˆ − y )2
Unexplained variation is the sum of squares of deviations of observed y from ŷ
 ( yi − y )
2
estimate, that is and explained variation is the sum of squares of

 ( yˆ − y ) .
2
deviations of fitted values from mean, that is

Hence, if we want to express the proportion of explained variation, the simplified


formula for coefficient of determination R 2 value is as shown in Formula 7.10.

2 βˆ0  yi + βˆ1  xi yi − ny 2
R = Formula 7.10
 yi2 − ny 2
The coefficient of determination is always positive, that is 0 ≤ R 2 ≤ 1, and usually
expressed in percentages, that is, by multiplying with 100%. For example, if the
value of R 2 is 0.57, we say that 57% of the variation in y can be explained by the
fitted regression. The remaining 43% cannot be explained. The higher the value of
R 2 (approaching to 1), the better the data fit for the simple linear regression model,
that is, the data concerned could explain the population very well.

Copyright © Open University Malaysia (OUM)


TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS  167

Let us refer to Example 7.3 to gain more understanding about coefficient of


determination.

Example 7.3:
Based on the data in Example 9.1, calculate the coefficient of determination and
interpret its meaning if y = sales and x = number of radio advertisements.

Answer:
The coefficient of determination is:
2
2 21.82 ( 621) + 2.92 ( 6,833) − 12 ( 51.75 )
R = 2
36, 059 − 12 ( 51.75 )
= 0.3481

This means the fitted regression model can explain only 34.81% of variation in
sales and 65.19% of variation in sales can be explained by other factors.

ACTIVITY 7.2
What might happen if the formulated hypothesis is not correct? Discuss
the answer for this question in the myINSPIRE forum.

EXERCISE 7.4

Based on data in Exercise 7.2, calculate the coefficient of determination


R 2 and interpret the value obtained.

Copyright © Open University Malaysia (OUM)


168  TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS

7.5.2 Residual Plot


The validity of many of the inferences associated with a regression analysis
depends on the error term, ∈, satisfying certain assumptions. Hence, it is highly
recommended that some sort of analysis be conducted to assess these assumptions.
No regression analysis can be considered complete without such examination. This
can be done through a graphical technique called residual plot. From the plot, we
will be able to check whether:
(a) The fitted model is linear;

(b) Variance for error ∈ i is constant or proportional to xi ; and

(c) The residuals are distributed as normal.

The following shows some graphs that present deviations from assumptions made.
Let us look at Figure 7.5.

Figure 7.5: Model is non-linear, instead of a curvature

Figure 7.5 is a plot of ∈ i versus the fitted values yˆi or xi to determine whether the
linearity assumption is fulfilled. The graph shows that the data plotted formed a
curve and hence, we can conclude that the fitted model is non-linear.

Copyright © Open University Malaysia (OUM)


TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS  169

Meanwhile, Figure 7.6 (plot of ∈ i versus the fitted values yˆi or xi ) shows deviation
of the model from the assumption that the random errors have constant variance.

Figure 7.6: Model with non-constant error variance, instead proportional to ŷ or x

The plot of data shows a bell-shape pattern. This means random errors instead of
having a non-constant variance, the errors are actually proportional to ŷ values. The
random errors have constant variance if the graph shows a random pattern or no trend.

Let us move on to Figure 7.7.

Figure 7.7: Histogram of residuals

Copyright © Open University Malaysia (OUM)


170  TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS

Figure 7.7 is a histogram on errors to determine whether random errors or residuals


are normally distributed. If these are normally distributed, the histogram will form
a bell-shaped curve. In conclusion, the histogram in Figure 7.7 shows the
assumption on normality of random errors is not met, as the histogram’s shape is
not normal.

ACTIVITY 7.3
What should we do to the model if there is a violation of assumptions?
Discuss the answer for this question in the myINSPIRE forum.

EXERCISE 7.5

Explain the meaning of each of these plots:

7.5.3 Some Transformations


Transformation is important if the regression model is in a non-linear shape. The
linearity of any model can be verified by drawing a two-way scatter plot. A linear
regression model will display a linear function, which is in a straight-line form. A
common transformation function is logarithm or inverse, either on x or y. Table 7.3
shows you a few transformation examples to change some non-linear functions to
their linear form.

Copyright © Open University Malaysia (OUM)


TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS  171

Table 7.3: Some Transformations

Functional Form that Linear Regression Model


Transformation
Relates y to x Form
Exponent: y = β0 eβ 1x y ∗ = ln y y ∗ = ln β 0 + β1 x
Power: y = β 0 xβ 1 y ∗ = log y ; x ∗ = log x y ∗ = log β 0 + β1 x ∗

Inverse x ∗ = 1 − x; y = β 0 + β1 x ∗

Hyperbolic y ∗ = 1 − y; x∗ = 1 − x y ∗ = β 0 x ∗ + β1

A two-way scatter plot is very useful to ascertain whether a model has a linear
or non-linear form. Hence, it is good to know the shape of exponential, power,
inverse and hyperbolic functions (refer to Figure 7.8). Look at both Table 7.3 and
Figure 7.8 on suitable transformation needs.

(a) Exponential function

(b) Power function

Copyright © Open University Malaysia (OUM)


172  TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS

(c) Inverse function

(d) Hyperbolic function

Figure 7.8: Functional forms

EXERCISE 7.6

Draw a two-way plot on the following regression models, then perform


transformation on the models and obtain the linear regression models.
1
 
 x
(a) y = 2.67 − 0.68

(b) y = 2e 3.1 x

(c) y = 1.5 x 0.85

x
(d) y=
0.4 + 2 x

Copyright © Open University Malaysia (OUM)


TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS  173

7.6 PREDICTION AND ESTIMATION USING


REGRESSION MODEL
One of the reasons to build a linear regression is to predict variable values at future
x values. For example, refer to the property development manager’s problem in
estimating the selling price (in RM) for each house built (see Subtopic 7.2). Using
regression model:

yˆ = 25, 000 + 90 x; xb ≤ x ≤ xa Formula 7.11

where y = selling price and x = house size (in square foot). The x values are between
x a and xb . If we would like to predict the selling price of a house where the built-
up area is 2,000 square feet, where the value 2,000 > xa , we can use the regression
model with x value = 2,000. Based on the regression formula, the manager can
predict that the selling price for each house with 2,000 square feet is RM205,000.

However, this selling price is a forward estimation and it does not explain the
position of that value with respect to actual selling price. In other words, is the
estimation value close to the actual value or very different? This relates to the
reliability aspect of a certain prediction. To get information on the position of
estimation values versus actual values, we need to use intervals. There are two
types of intervals used, prediction interval for any dependent variable y, and
estimation interval for estimated value of y.

ACTIVITY 7.4
List any other situations that required prediction or estimation. Share your
answer for discussion in the myINSPIRE forum.

Copyright © Open University Malaysia (OUM)


174  TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS

7.6.1 Prediction Interval for an Individual Value of y


Prediction interval is used to predict a certain value of dependent variable y given
a specific value of independent variable x when this x value is outside the range of
x values, that is x > xa or x < xb . The term “prediction interval” is used rather
than confidence interval because a population parameter is not being estimated in
this case; instead, the response or performance of a single individual in the
population is being predicted. The formula to obtain a (1 – α)100% prediction
interval is:

( )
2
1 xg − x
yˆ ± tα /2 s∈ 1+ + Formula 7.12
n  ( xi − x )2

where
ŷ = Future estimated value of dependent variable calculated from
( yˆ = βˆ0 + βˆ1xg )

tα /2 = Critical value of t distribution with n – 2 degrees of freedom at


αsignificance level
s∈ = Standard deviation for estimator

xg = Specific value of independent variable

x = Mean value of independent variable


n = Sample size

Standard error of the estimate, s∈ , is a measure of reliability of any estimation


formula. It represents an estimate of the standard deviation around the regression
lines. It is often referred to as the standard error of the regression, that is, the
degree of deviation of observed values from estimated values based on the
regression line. The formula for s∈ is:

n
 ( yi − yˆi )
2

i −1
s∈ = Formula 7.13
n−2

Copyright © Open University Malaysia (OUM)


TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS  175

Let us look at Example 7.4.

Example 7.4:
Refer to the data in Example 7.1. Calculate the 95% prediction interval for
x = 20 and explain its meaning if y = Sales, and x = Number of advertisement in
the radio.

Answer:
Refer to Example 7.1, the simple linear regression model is:
yˆ = 21.82 + 2.92 x

When xg = 20, ŷ = 21.82 + 2.92(20) = 80.22.

To get the standard error of the estimate, we need y values. These can be
generated by using the regression model ŷ = 21.82 + 2.92x. The data is as in the
table:

x 3 7 6 6 10 12
y 33 38 24 61 52 45
ŷ 30.58 42.26 39.34 39.34 51.02 56.86

x 12 12 13 13 14 15
y 29 65 82 63 50 79
ŷ 56.86 56.86 59.78 59.78 62.70 65.62

n
 ( yi − yˆi )
2

i =1 2,556.946
Hence, s∈ = = 15.99
n−2 10

Copyright © Open University Malaysia (OUM)


176  TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS

Since α = 0.05, tα /2 = t0.025 = 2.228. Thus, the 95% prediction interval for
x g = 20 is

( )
2
1 xg − x
yˆ ± tα /2 s∈ 1+ +
n  ( xi − x )2

1 ( 20 − 10.25 )
2
80.22 ± ( 2.228 )(15.99 ) 1+
12 160.25
80.22 ± 46.13

The lower and upper limits of the prediction interval are 34.09 and 126.35
respectively. This shows the minimum predicted sales are 34 units and the
maximum is 126 units when 20 advertisements were broadcast on the radio.

EXERCISE 7.7

Refer to the data in Exercise 7.2. Calculate the 99% prediction interval for
x = 86 and provide an explanation for it.

7.6.2 Confidence Interval for a Mean Value of y


The points on the least squares line corresponding to each x value in the population
regression model y = β0 + β1 x + ∈ , y will be distributed as normal with mean

E ( y ) = β0 + β1x

Hence, to estimate a mean value of y, given any x g value, we can use the following
interval:

( )
2
1 xg − x
yˆ ± tα /2 s∈ + Formula 7.14
n  ( xi − x )2

Copyright © Open University Malaysia (OUM)


TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS  177

This interval applies when any specific value of x lies between the interval for
independent variable x values, i.e. xb ≤ x ≤ xa . Let us look at our last example.

Example 7.5:
Refer to data in Example 7.1. Calculate the 95% confidence interval for the mean
value of y when x g = 11 and explain its meaning if y = Sales, and x = Number
of radio advertisement.

Answer:
Values for yˆ , tα /2 and s∈ can be obtained from Example 7.4. Hence, 95%
confidence interval for the mean value of y when x g = 11 is:

( )
2
1 xg − x
yˆ ± tα /2 s∈ +
n  ( xi − x )2

1 (11 − 10.25 )
2
53.94 ± ( 2.228 )(15.99 ) +
12 160.25
53.94 ± 10.50

Notes:
The lower and upper confidence limits for mean value of y are 43.44 and
64.44 respectively. This shows the minimum mean sales is 43 units while the
maximum is 64 units when 11 radio advertisements were broadcast.

You can read more about simple linear regression at:


http://pinkmonkey.com/studyguides/subjects/stats/chap8/s0808n01.asp.

EXERCISE 7.8

Refer to Exercise 7.2. Calculate the 99% confidence interval for mean y
when x = 69 and provide an explanation for it.

Copyright © Open University Malaysia (OUM)


178  TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS

• Regression analysis concepts deal with finding the best relationship between a
dependent variable, Y, and independent variable, X, quantifying the strength of
that relationship, and the use of methods that allow for prediction of the
response values (Y) given values of the regressor x.

• It is used to determine the mathematical relationship between these variables


through a linear formula termed as regression model.

• Simple linear regression is a technique used to analyse the relationship between


two variables. Regression analysis assumes that the relationship is in linear
form.

• Hypothesis test is performed on the slope of the regression line to determine


whether there is enough evidence to support the existence of a linear
relationship. The validity of relationship between the two variables can be
determined using coefficient of determination.

• The least squares method is used to get parameter estimates for the slope of
regression line and intercept on y-axis.

• Inferential statistics is a branch of statistics concerned with making conclusions


about a population based on information from a sample. The calculated
regression coefficients β̂0 and βˆ1 , from sample data are only estimations of
the population parameters.

• Model adequacy check that check violations of assumptions can be performed


by using residual plot and histogram.

• If the simple linear regression model obtained is adequate for the data, the model
can be used to estimate the dependent variable value for any specific
independent variable value. This model can also be used to predict the mean
value of a dependent variable.

• There are three methods to check model adequacy:

– Coefficient of determination, R 2 ;

– Residual plot; and


– Transformation.
Copyright © Open University Malaysia (OUM)
TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS  179

Coefficient of determination – A measure that gives the proportion (or


percentage) of the total variation in a
dependent variable that is explained by a
given independent variable.

Dependent variable – The variable to be predicted or explained.

Estimated or predicted value of y – The value of the dependent variable that is


calculated for a given value of x using the
estimated regression model.

Independent variable – The variable included in a model to explain


the variation in the dependent variable.

Least squares method – The method used to fit a regression line


through a scatter diagram such that the error
sum of squares is minimum.

Prediction interval – The confidence interval for a particular


value of y for a given value of x.

Simple linear regression – A regression model with one dependent


variable and one independent variable that
assumes a straight line relationship.

Dielman, T. E. (2004). Applied regression analysis: A second course in business


and economic statistics (4th ed.). Belmont, CA: Thomson Brooks/Cole.

Freund, J. E. (2003). Mathematical statistics (7th ed.). Upper Saddle River, NJ:
Prentice-Hall, Inc.

Mann, P. S. (2005). Introductory statistics using technology (5th ed.). Upper Saddle
River, NJ: John Wiley & Sons, Inc.

Copyright © Open University Malaysia (OUM)


180  TOPIC 7 SIMPLE LINEAR REGRESSION ANALYSIS

Mendenhall, W., Beaver, R. J., & Beaver, B. M. (2013). Introduction to probability


and statistics (14th ed.). Belmont, CA: Thomson Brooks/Cole.

Walpole, R. E. (2006). Probability and statistics for engineers and scientist


(8th ed.). Upper Saddle River, NJ: Prentice-Hall, Inc.

William, M., & Terry, S. (2003). A second course in statistics: Regression analysis.
(6th ed.). Upper Saddle River, NJ: Prentice-Hall, Inc.

Copyright © Open University Malaysia (OUM)


Topic  Multiple
Regression
8
LEARNING OUTCOMES
By the end of this topic, you should be able to:
1. Describe the multiple regression concept;
2. Explain the multiple regression model and assumptions made;
3. Demonstrate how the multiple regression model is constructed by
using the least square method;
4. Use various methods to evaluate the suitability of data on the
regression model; and
5. Utilise the regression equation for prediction and estimation of
parameter values.

 INTRODUCTION
Most practical applications of regression analysis utilise models that are more
complex than the simple linear regression discussed in Topic 7, where only two
variables, the dependent variable (Y) and independent variable (X), are considered.
In simple linear regression, it is important to fully understand the following items:

(a) Linear regression formula:

X Formula 8.1

(b) Linear regression model:

Y = β0 + β1 X Formula 8.2a

Copyright © Open University Malaysia (OUM)


182  TOPIC 8 MULTIPLE REGRESSION

Ŷ = βˆ0 + βˆ1 X + ∈ Formula 8.2b

(c) It can be understood from the model in Formula 8.2b that Yˆ is a random
variable that follows a certain population distribution. Here, ∈ is assumed to
be independent of each other for any Y value with a zero mean. From the
previous formulas, for a given X value, the expectation is:

E (Y X ) = β 0 + β1 X Formula 8.3

Therefore, Yˆ in Formula 8.2b is actually the conditional expectation line


E (Y X ) . The value depends very much on various combinations of β0 and
β1 values that characterise the line. In this case, β0 and β1 are population
parameters that need to be estimated.

(d) In regression analysis, the first thing to do is to estimate the Yˆ line using the
model in Formula 8.2a, that is, to get estimations for β0 and β1 using
methods such as ordinary least squares which uses n pairs of observation
values (y,x).

(e) β0 and β1 are known as coefficients for Yˆ in Formula 8.2a that need to be
estimated through Formula 8.2b using methods such as ordinary least squares
which uses n pairs of observation values (y,x). How far Yˆ is able to explain
variation in Y values is usually associated with how accurate the estimation of
both parameters is. This is usually measured with the R 2 coefficient where
the closer is its value to 1, the better is Yˆ in explaining variation in Y, and
vice-versa.

In another situation, a manager may want to find out the effect/relationship between
advertising cost and total space allocated in an advertising board (as two
independent variables, X 1 and X 2 respectively) on the amount of monthly product
sales (as the dependent variable, Y). Thus, Formulas 8.1, 8.2a and 8.2b would be:

Y ′ = β 0 + β1 X 1 + β 2 X 2 Formula 8.4

Y = β 0 + β1 X 1 + β 2 X 2 + ∈ Formula 8.5a

Y = Y ′+ ∈ Formula 8.5b

Copyright © Open University Malaysia (OUM)


TOPIC 8 MULTIPLE REGRESSION  183

Formula 8.4 or its equivalent involving two or more independent variables is called
a multiple regression formula. Thus, the model in Formula 8.5a or 8.5b is termed
a multiple regression model. In the multiple regression method, there are usually
n observations for ( y, x 1 , x2 ). These observations are used to estimate β0 , β1 , β 2
using a method such as ordinary least squares. Similar to the linear regression case,
the goodness of fit of Y ′ in explaining variation in Y values depends on the
precision of the β0 , β1 , β 2 estimation. The R 2 coefficient of determination is also
used to measure this. However, the formula used is different in this case. This matter
will be further discussed in the subsequent subtopic. Let us continue with the lesson.

8.1 MULTIPLE REGRESSION MODEL AND


ASSUMPTIONS
In general, a multiple regression model with k independent variables can be written
as shown below:
Y = β 0 + β1 X1 + β 2 X 2 + ... + β k X k + ∈ + ... Formula 8.6a

Y = Y ′+ ∈ + ... Formula 8.6b

where
Y ′ = β 0 + β1 X 1 + β 2 X 2 + ... + β k X k

However, in this module, we will only focus on the multiple regression model
with two independent variables. For cases involving more than two independent
variables, the calculation is usually done with the help of a statistical package such
as Statistical Package for Social Sciences (SPSS); you can refer to any related books
to read more about this.

ACTIVITY 8.1
Search on the Internet for SPSS and find keywords that describe it. Share
your findings in the myINSPIRE forum.

Copyright © Open University Malaysia (OUM)


184  TOPIC 8 MULTIPLE REGRESSION

8.1.1 Assumptions for Multiple Regression Model


The assumptions are similar to those for the simple regression model. Let us look
at Table 8.1.

Table 8.1: Assumptions for Multiple Regression Model

No. Assumption Explanation


1. Normality assumption For any specific value of independent variable,
the Y random variable values are distributed as
normal, with mean E (Y X ) = y′, and variance =
σ2
.

2. Constant variance For each value of independent variable, the
assumption random variable Y has constant variance.
3. Linearity assumption There exists a linear relationship between the
dependent and independent variables.
4. Non-multicollinearity The independent variables are not correlated with
assumption each other.
5. Independent assumption The values of the independent variable Y are
independent of each other.
6. Error/residual assumption Residuals or errors are random and independent
of each other, and assumed to be distributed as a
normal random variable with zero mean and
2
variance σ .

Copyright © Open University Malaysia (OUM)


TOPIC 8 MULTIPLE REGRESSION  185

8.1.2 Multiple Regression Model with Two


Independent Variables
Let us look at the following elaboration on this matter:

(a) Model Statement


The regression model for two independent variables is as the following:
Y = β 0 + β1 X 1 + β 2 X 2 + ∈

Y = Y ′+ ∈

where
Y ′ = β 0 + β1 X 1 + β 2 X 2

For the ith observation, i = 1,2, ..., n, the above model value (a number, written
in a small letter) is:
yi = β 0 + β1 x1i + β 2 x2i + ∈i Formula 8.7a

yi = yi′ + ∈i Formula 8.7b

where
yi′ = β 0 + β1 x1i + β 2 x2i Formula 8.8

In the model in Formula 8.8a, population parameters β0 , β1 , β 2 are unknown.


Each estimator is written as βˆ , βˆ , βˆ , and thus, the model formula is
0 1 2
written as:

yi′ = βˆ0 + βˆ1 x1i + βˆ2 x2i

Copyright © Open University Malaysia (OUM)


186  TOPIC 8 MULTIPLE REGRESSION

Hence, using Formulas 8.7b and 8.8, errors between observations and their
estimations′ are given as = –. The error value can take a negative sign.

(b) Estimation of Model Parameters and Their Meaning


The model parameter can be estimated using the ordinary least square method
by minimising the error sum of squares and solving for the parameters, that
is:
n n n 2
( )
2
∈i2  ( yi − yˆi′ ) =  yi − βˆ0 − βˆ1xi − βˆ2 x2i Formula 8.9
1 1 1

Using the outcome of Formula 8.9, separating and equating the formula to
zero, we obtained the following three formulas:
n  n  ˆ  n 
 yi − nβ0 + β1   x1i  + β2   x2i 
ˆ ˆ Formula 8.10
1  1   1 
n
 n  ˆ  n 2 ˆ  n 
 yi x1i = β0   x1i  + β1   x1i  + β2   x1i x2i 
ˆ Formula 8.11
1  1   1   1 

ˆ  x  + βˆ  x x  + βˆ  x2 
n n n n
 i 2i 0  2i 1  2i 1i 2  2i
y x = β Formula 8.12
1  1   1   1 

Solving these formulas for model parameters, we obtained the following


estimations:

(  d1d ) (  d22 ) − (  d2d )(  d1d2 )


βˆ1 = Formula 8.13
(  d12 )(  d22 ) − (  d1d2 )
(  d2 d ) (  d12 ) − (  d1d )(  d1d2 )
βˆ2 = Formula 8.14
(  d12 )(  d22 ) − (  d1d2 )
βˆ0 = y − βˆ1 x1 = βˆ2 x2 Formula 8.15

Each of them is the mean or average values for observations y, x1 and x2 ;


d = y – y , d1 = x1 – x1 , d 2 = x2 – x2 .

Copyright © Open University Malaysia (OUM)


TOPIC 8 MULTIPLE REGRESSION  187

Let us look at Example 8.1.

Example 8.1:
Given a set of n = 10 observations ( y , x1 x2 ), Table 8.2 is usually constructed for
manual calculation of parameter estimation (when n is moderately large where
the calculation works such as this can still be carried out).

Table 8.2: Calculation Steps (Using Calculator)

y x1 x2 d d1 d2 dd dd 1 dd 2 d12 d12 d 1d 2

30 3.2 2 –0.2 0.73 –1 0.04 –0.086 0.2 0.1849 1 –0.43


36 3.4 4 5.8 0.63 1 33.64 3.654 5.8 0.3969 1 –0.63
28 2.8 3 –2.2 0.03 0 4.84 –0.066 0 0.0009 0 0
29 2.4 4 –1.2 –0.37 1 1.44 0.444 –1.2 0.1369 1 –0.37
27 2.5 2 –3.2 –0.27 –1 10.24 0.864 3.2 0.0729 1 0.27
28 2.2 3 –2.2 –0.57 0 4.84 1.254 0 0.3249 0 0
32 2.7 3 1.8 –0.07 0 3.24 –0.126 0 0.0049 0 0
27 2.6 2 –3.2 –0.17 –1 10.24 0.544 3.2 0.0289 1 0.17
34 3 4 3.8 0.23 1 14.44 0.874 3.8 0.0529 1 0.23
31 2.9 3 0.8 0.13 0 0.64 0.104 0 0.0169 6 0.5
302 27.7 30 12.2 0 0 83.6 7.46 15 1.221 6 0.5

y = 30.2, x1 = 2.77, and x2 = 3

For large n, the calculation can be done using a statistical package such as Excel,
Minitab or SPSS with computer assistance. Please take note that different
package may generate different answers due to rounding error.

From Formulas 8.13, 8.14 and 8.15, we obtain the following estimates:

βˆ1 =
( 7.46 )( 6 ) − (15 ) 0.5 = 5.265687 ≈ 5.266,
(1.221)( 6 ) − ( 0.5)2

βˆ2 =
(15 )(1.221) − ( 7.46 ) 0.5 = 2.061193 ≈ 2.0612,
(1.221)( 6 ) − ( 0.5 )2
βˆ0 = 30.2 − 5.266 ( 2.77 ) − 2.0612 ( 3) = 9.430469 ≈ 9.430.

Copyright © Open University Malaysia (OUM)


188  TOPIC 8 MULTIPLE REGRESSION

Model estimation:
yˆ ′ = 9.430 + 5.266 x1 + 2.0612 x2 Formula 8.16

(c) Estimated Value of y and Its Residual


Model (Formula 8.16) can be used to obtain estimation for each y values.
For example, when i = 3, y3 = 28; yˆ3′ = 9.430 + 5.266 ( 2.8 ) + 2.0612 ( 3) =
30.3584 ≈ 30.36, and its residual,

∈3 = y3 − yˆ3′ = 28.0 − 30.36 = −2.36 Formula 8.17

The negative residual value indicated that an over-estimation of ŷ3′ since the
value of yˆ3′ > y3 .

On the other hand, for i = 7, y7 = 32; yˆ7′ = 9.430 + 5.266 ( 2.7 ) + 2.061( 3) =
29.832 ≈ 29.83, and its residual,

∈7 = y7 − yˆ 7′ = 32.0 − 29.83 + 2.17 Formula 8.18

The positive residual value indicates that the value ŷ7′ is under-estimated as
the value of yˆ7′ < y7 .

What is the predicted value of y? From this model, if x1 = 3.0, and x2 = 2,


then yˆ ′ ≈ 29.35 is the predicted value for the observation/actual value of y.

(d) Meaning of Parameter Estimation


The contribution of independent variables on variation in y values can be
explained one by one.

For example, when x2 is fixed or its value is given, by estimation, y will


increase by (+5.266) for each unit increase in x1 .

Copyright © Open University Malaysia (OUM)


TOPIC 8 MULTIPLE REGRESSION  189

Testing the Significance of Model Parameters


As mentioned at the beginning of this topic, βˆ0 , βˆ1 , βˆ2 are estimations of
population parameters β0 , β1 , β 2 respectively. The significance of β̂0 is of less
importance; hence, it can be ignored.

It is important to test for significance of βˆ1 , βˆ2 to determine whether x1 and/or x2


respectively contribute significantly to the variation in y values.

The population parameter estimates, βˆ1 , βˆ2 , follow a sampling distribution with
mean and variance as shown below:

Mean β̂1 = β1 and Variance βˆ1 = Var βˆ1 = s2 βˆ1 ,( ) ( )


where

 ∈i2    d 22 
2 ˆ( )
s = β1 =  
  Formula 8.19
 n − k − 1  (  d12 )( )
 d22 − (  d1d2 )
2

and

( )
Mean βˆ2 = β 2 , and Variance βˆ2 = Var βˆ2 = s2 βˆ2 , ( )
where

 ∈i2    d12 
( )
s = βˆ2 = 
2

  Formula 8.20
 n − k − 1  (  d12 )( )
 d22 − (  d1d2 )
2

and k = the number of parameters in the model excluding the constant.

Copyright © Open University Malaysia (OUM)


190  TOPIC 8 MULTIPLE REGRESSION

The hypothesis statements are:


H 0 : β1 = 0; and H 0 : β 2 = 0;

H1 : β1 ≠ 0; H1 : β1 ≠ 0;

Hypothesis test:

βˆi − βi βˆi
T= =
( )
s βˆi ( )
s βˆi
i = 1.2.

Test result: T follows a t distribution with v = n − k − 1 degrees of


freedom and α significance level. Reject H 0 if: |T| > tá/2,v

This is a two-sided test. It is common to use the t distribution as the population


parameter is unknown and the sample size, n, is small. Meanwhile, s βˆ is the ( ) i

standard deviation for βˆi sampling distribution, i = 1, 2. Both standard deviations


are calculated prior to making inferences.

Confidence Interval for Model Parameters


Apart from hypothesis testing, we can also construct a confidence interval for β i .
This confidence interval will provide information on the range of values that
contains the population parameter value with a certain α confidence level. Based
on test statistics T (two-sided test) which follows a tn − k −1 distribution, we can
construct a confidence interval (1 – α)100% as follows:

( ) ( )
βˆi – tá/2,n–k–1 s βˆi ≤ βi ≤ β̂ i + tá/2,n–k–1 s βˆi Formula 8.21

Copyright © Open University Malaysia (OUM)


TOPIC 8 MULTIPLE REGRESSION  191

Let us look at Example 8.2.

Example 8.2:
Testing Significance of Model Parameters (Formula 8.19)

This model has k = 2 parameter estimators and n = 10. From the data in
Example 8.1, the following values are obtained:

y y′ ∈ ∈2 d2

30 30.40305 –0.40305 0.162451 0.04


36 35.57858 0.421425 0.177599 33.64
28 30.35797 –2.35797 5.560025 4.84
29 30.31289 –1.31289 1.723677 1.44
27 26.71707 0.282928 0.080048 10.24
28 27.19856 0.801441 0.642308 4.84
32 29.8314 2.168598 4.702818 3.24
27 27.24364 –0.24364 0.059361 10.24
34 33.4723 0.527699 0.278467 14.44
31 30.88454 0.115461 0.013331 0.64
13.40008 83.6

∈12 = 13.40008 = 1.914297 ≈ 1.9143,


10 − 3 7

[ 6]
( ) ( )
 Var βˆ1 = s 2 βˆ1 = [1.914297 ]
(1.221)( 6 ) − ( 0.5 )2
= 1.6232,

( )
 Standard deviation, s βˆ1 ≠ 1.274

Copyright © Open University Malaysia (OUM)


192  TOPIC 8 MULTIPLE REGRESSION

and

[1.221]
( ) ( )
 Var βˆ2 = s 2 βˆ2 = [1.914297 ]
(1.221)( 6 ) − ( 0.5)2
= 0.330322

( )
 Standard deviation, s βˆ2 ≠ 0.5747

(a) Test for β1 :


βˆ1
The test statistics value, t1 = = ( 5.265687 ) / 1.274 ≈ 4.1332 >
( )
s βˆ1
tα /2 ( 7 ) = 2.3646, → H 0 is rejected at 5% level, hence, x1 contributes to
variation in y values.

(b) Test for β 2 :

βˆ2
The test statistics value, t2 = = ( 2.061193) / 0.5747 ≈ 3.5866 >
( )
s βˆ2
tα /2 ( 7 ) = 2.3646, → H 0 is rejected at 5% level, hence, it is significant.
There is enough evidence at 5% significance level that x2 contributes to
the variation in y values.

Simple Method to Calculate Total Residuals


In the table in Example 8.2, total residuals obtained from individual residual
between observation y and individual estimation y′ can be calculated through the
model in Formula 8.16. However, the total residuals can be obtained without having
to calculate the estimated observation values Y ′, using the following formula:

∈ 2 =  d 2 − βˆ1  dd1 − βˆ2  dd2 Formula 8.22

As an illustration, for Example 8.1, the answer for total residuals is

∈ 2 = 83.6 − ( 5.265687 )( 7.46 ) − ( 2.061193)(15) = 13.40

Copyright © Open University Malaysia (OUM)


TOPIC 8 MULTIPLE REGRESSION  193

Multiple Coefficient of Determination, R 2


First, get the y′ value using the model in Formula 8.16 as in Table 8.2. The R 2
coefficient that also measures the goodness-of-fit of the estimated model in
Formula 8.16 provides the proportion of total variation in y, which can be explained
by the multiple regression model in Formula 8.16. This value can be estimated using
the following formula:

 ( y′ − y ) ∈ 2
2
R2 = = 1− Formula 8.23a
( y − y)
2
 y2
Without calculating y′, the coefficient is given by the following formula:

R2 =
( βˆ ) (  dd ) + ( βˆ ) (  dd )
1 1 2 2
Formula 8.23b
d 2

R 2 for Example 2.1:

Based on the information above, from Formula 8.23a,

R 2
= 1−
∈2
= 1 − (13.40 ) / ( 83.6 ) = 83.9713 ≈ 83.97
 y2
This means the estimated model (Formula 8.16) can only explain 83.97% of
variation in y values; and the rest cannot be explained by the model and is usually
contained in the error ∈.

From Formula 8.23b,

R2 =
( 5.265687 )( 7.46 ) + ( 2.061193)(15 ) = 0.839712 ≈ 0.8397
83.6

R 2 ( R 2 -adjusted)

Copyright © Open University Malaysia (OUM)


194  TOPIC 8 MULTIPLE REGRESSION

The R 2 -adjusted value is given by the formula below:

) ( n( − k −)1)
n −1
(
R2 = 1 − 1 − R2 Formula 8.23c

The quantity of R 2 is introduced to take into consideration the reduction in degrees


of freedom (df) with the addition of independent variables. The addition usually
will increase the total squared of regression values, SSR where:

SSR =  yˆ i
2

A few results can be derived from this:

When k ≤ 1, R 2 ≤ R 2;

When n is large, for any value of k, R 2 ≈ R 2 ;

When n is small (relative to n), R 2 << R2 , hence, R 2 value can be negative


although R 2 value is in the interval 0 ≤ R 2 ≤ 1.

R 2 for Example 8.1:

R 2 = 1 − (1 − 0.839712 )
(10 − 1) = 0.793915
(10 − 2 − 1)
Testing Significance of Overall Regressin Model
The F test can be used to test the significance of the overall regression model. It is
tested based on the ratio of explained variance in the model on the remaining
unexplained variance. The F distribution is used, with k and n − k − 1 degrees of
freedom where k is the number of parameters estimated excluding the constant β 0 .
(A few books consider β0 as a parameter, hence, the F degrees of freedom becomes
k − 1 and n − k ). The test statistics is given by:

Fk ,n−k −1 =
 yˆ ′i2 / ( k ) =
R2 / ( k )
Formula 8.24
∈i2 /9 ( n − k − 1) (1 − R2 ) / ( n − k − 1)

Copyright © Open University Malaysia (OUM)


TOPIC 8 MULTIPLE REGRESSION  195

The test hypothesis is:


H 0 : There is no linear association between dependent
variable, y and independent variable, x Formula 8.25a

H1 : There is a linear association

or

H 0 : β1 = β 2 = 0; Formula 8.25b

H1 : at least one β1 is not zero.

Test result: If the F-probability is < 0.05, reject H 0 at 5% significance level. This
means it is significant that the regression parameters β0 , β1 , β 2 , especially the last
two, is not all zero. Subsequently, it is significant that the coefficient of
determination R 2 is not zero.

SELF-CHECK 8.1

What are the assumptions for the multiple regression model?

EXERCISE 8.1

Referring to data in Example 8.1, and estimated model (Equation 8.16),


calculate:
(a) An estimation and residual values of yi , i = 4, 9 and interpret the
value of the residuals.
(b) The predicted observed value of y, if x1 = 4.0 and x2 = 5.0.

Copyright © Open University Malaysia (OUM)


196  TOPIC 8 MULTIPLE REGRESSION

8.1.3 Calculation Using Microsoft Excel Package


The following are the steps of calculation using Microsoft Excel:
1. Open Excel spreadsheet.
2. Enter data (or import data from data source) as in Table 8.3.
(You can enter data in any column).

Table 8.3: Example of Microsoft Excel Application


A B C D E F G H…
y x1 x2

30 3.2 2
36 3.4 4
28 2.8 3
29 2.4 4
27 2.5 2
28 2.2 3
32 2.7 3
27 2.6 2
34 3 4
31 2.9 3

3. Click on “Tools”.
4. Click on “Data analysis”.
5. Double click on “Regressions”.
6. Enter y range as $A$2:$A$11
7. Enter x range as $B$2:$C$11
8. Choose: Label, confidence level, residuals, residual plot, normal probability
plots.
9. Click on “OK”.

Copyright © Open University Malaysia (OUM)


TOPIC 8 MULTIPLE REGRESSION  197

Table 8.4 shows you an example of an Excel spreadsheet output.

Table 8.4: Example of Output


SUMMARY OUTPUT
Regression Statistics
Multiple R 0.918389714
R Square 0.843439667
Adjusted R Square 0.79125289
Standard Error 1.476566151
Observations 9
ANOVA
df SS MS F SignificanceF
Regression 2 70.47406997 35.237035 16.1619419 0.003837472
Residual 6 13.08148559 2.1802476
Total 8 83.55555556
Coefficients Standard Error t Stat P-value
Lower 95% Upper 95%
Intercept 9.037694013 4.035365839 2.23962198 0.06638156 -
0.83649046 18.9118785
3.2 5.609756098 1.630594534 3.44031332 0.01379565 1.619835016 9.59967718
2 1.900776053 0.743177823 2.5576329 0.04304568 0.082285433 3.7192666

RESIDUAL OUTPUT PROBABILITY OUTPUT

Predicted Standard
Observation Residuals Percentile 30
30 Residuals
1 35.71396896 0.286031042 0.22368127 5.555555556 27
- -
2 30.44733925 2.447339246 1.91386207 16.66666667 27
- -
3 30.10421286 -1.10421286 0.86351376 27.77777778 28
4 26.86363636 0.136363636 0.10663875 38.88888889 28
5 27.08148559 0.918514412 0.71829432 50 29
6 29.88636364 2.113636364 1.65290058 61.11111111 31
- -
7 27.42461197 0.424611973 0.33205398 72.22222222 32
8 33.47006652 0.529933481 0.41441724 83.33333333 34
- -
9 31.00831486 0.008314856 0.00650236 94.44444444 36

Copyright © Open University Malaysia (OUM)


198  TOPIC 8 MULTIPLE REGRESSION

Take note that there are differences in values obtained manually and those obtained
using an Excel package. This is due to rounding error in the Excel package.

Let us do an interpretation of output of Table 8.4.

1. Multiple R
This quantity is often referred to as multiple correlation between y and all
independent variables without any conditions imposed on any independent
variable. The value is the source of multiple R 2 .

2. R Square
Measures the goodness of fit of the y ′ model on observed y. A high value
means that the regression model can explain better about the variation in Y as
much as ( R 2 = 100)%.

On the other hand, a small value indicates a poor fit of the regression model.

3. ANOVA (Analysis of Variance)


Analysis of variation in Y can be explained by the regression model (measured
by regression sum of squares) and unexplained variation (measured by
residuals sum of squares), both in the “SS” column. The “MS” (mean square)
column is the SS value divided with respective degrees of freedom (df).

Subsequently, the F value is the ratio of MS values. The F probability


(significance F) is used to test the hypothesis (Formula 8.6a) or
(Formula 8.6b). If the probability value is less than 0.05, the following results
are obtained:

(a) Reject at 5% significance level.

(b) This means there exists a linear relationship between Y and X1 and X 2
simultaneously.

(c) Hence, it means, neither are significantly zero.

(d) When the R 2 value is not significantly zero and this proves that there
exists a linear relationship between Y and X1 and X 2 .

Copyright © Open University Malaysia (OUM)


TOPIC 8 MULTIPLE REGRESSION  199

4. t Test
This test is used to evaluate whether the individual regression coefficient
( β1 , β 2 ) is significantly zero at α level, that is, by comparing the p probability
value with the α value. For example, assume that α = 0.05; and if p < α,
reject H 0 : β1 = 0 at 5% level. This means that β1 ≠ 0, and x1 contributes
significantly to the variation in Y. In the given example, we found that β1 and
β2 are both not significantly zero at the 5% level.

5. Residual Output
One way to know the adequacy of a model is by looking at the parameters
involved and checking whether the assumptions in model construction are
fulfilled. This can be done through the residuals shape on predicted values. If
the assumptions are met, usually the predicted residuals will not have any
particular pattern that can be seen from the residuals plot.

This means that residuals are random around the horizontal line, as shown in
Figure 8.1.

Figure 8.1: Residuals are random around the horizontal line

The normality assumption is satisfied if the normal plot follows a straight line.
Referring to Figure 8.2, not all points fall on the straight line; hence, the
regression model can satisfy only about 94% of the normality assumption.

Figure 8.2: Not all points fall on the straight line

Copyright © Open University Malaysia (OUM)


200  TOPIC 8 MULTIPLE REGRESSION

ACTIVITY 8.2
Based on your understanding of what you have learned, try to think of two
or three independent variables for the following dependent variables.
(a) Profit made by a company;
(b) Students’ final examination grade; and
(c) Selling price of a house.

Share your answer for discussion in the myINSPIRE forum.

EXERCISE 8.2

1. (a) Perform a manual analysis and use Formulas 8.13, 8.14 and
8.15 to obtain the parameter estimates for β0 , β1 and β2 for
the multiple regression model for the following data:
Y : 10, 24, 40, 20, 15

X 1 : 2, 3, 7, 3, 4

X 2 : 5, 6, 6, 5, 3

(b) Use your model to obtain the estimated values of y, and


estimate the total residuals.
(c) Perform a significant test on the parameters.

(d) Obtain R 2 coefficient, and interpret its value.


(e) Perform the F test and make the conclusion.

Copyright © Open University Malaysia (OUM)


TOPIC 8 MULTIPLE REGRESSION  201

2. Use Microsoft Excel to analyse multiple regression on the following


set of data:
(a) Y : 10, 24, 40, 20, 15

X 1 : 2, 3, 7, 3, 4; X 2 : 5, 6, 6, 5, 3

(b) Y : 10, 25, 30, 20, 15

X 1 : 2, 4, 4, 3, 4; X 2 : 2, 6, 8, 6, 3

3. Referring to Question 2, explain the results of the analysis (as in


Example 8.1).

• Multiple linear regression analyses the relationship between a dependent


variable and two or more independent variables.

• The regression analysis assumes that the relationship is in a linear form.

• The least squares method is used to obtain the estimates of the regression model
parameters and y-intercept. Next, hypothesis testing is carried out on the
regression coefficients to determine whether there exists enough evidence to
state the existence of a linear relationship.
2
• The goodness of fit between two variables can be obtained using the R
coefficient of determination.

• The deviation of a model from the assumptions made can be identified using a
residuals plot that should not display any distinct pattern (that is random) if the
model assumptions are met.

• If the multiple linear regression model obtained is suitable and fits the data, this
model can be used to obtain the estimated values of a dependent variable for
any given independent variable values. This model can later be used for making
predictions for any independent variable value as well as estimating the values
of dependent variables.

Copyright © Open University Malaysia (OUM)


202  TOPIC 8 MULTIPLE REGRESSION

Multiple linear regression – A regression model with one dependent and two or
more independent variables that assumes a straight-
line relationship.

Dielman, T. E. (2004). Applied regression analysis: A second course in business


and economic statistics (4th ed.). Belmont, CA: Thomson Brooks/Cole.

Freund, J. E. (2003). Mathematical statistics (7th ed.). Upper Saddle River, NJ:
Prentice-Hall, Inc.

Mann, P. S. (2005). Introductory statistics using technology (5th ed.). Upper Saddle
River, NJ: John Wiley & Sons, Inc.

Mendenhall, W., Beaver, R. J., & Beaver, B. M. (2013). Introduction to probability


and statistics (14th ed.). Belmont, CA: Thomson Brooks/Cole.

Walpole, R. E. (2006). Probability and statistics for engineers and scientist


(8th ed.). Upper Saddle River, NJ: Prentice-Hall, Inc.

William, M., & Terry, S. (2003). A second course in statistics: Regression analysis.
(6th ed.). Upper Saddle River, NJ: Prentice-Hall, Inc.

Copyright © Open University Malaysia (OUM)


Topic  Hypothesis
Testing (Single
9 Population)
LEARNING OUTCOMES
By the end of this topic, you should be able to:
1. Construct an appropriate null and alternative hypothesis for non-
parametric single population test;
2. Test the location of a population and the location of a large population
using sign test; and
3. Examine the location of a population and the location of a large
population using Wilcoxon signed-rank test.

 INTRODUCTION
In testing a single population using parametric methods, the t-test and z-test (for
large sample size) are used to determine whether population mean, μ, is equivalent
to or different from a certain mean value, μ0 . Non-parametric methods for testing
a single population also check whether there exists significant difference in terms
of location or position of a population with a given value of a measure of location.

Copyright © Open University Malaysia (OUM)


204  TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)

As discussed earlier, non-parametric methods do not assume samples are taken


from a normal distribution, and can be used to analyse data not approaching normal
distribution.

Hence, the mean is replaced by the median as the pertinent location parameter under
test. This is because the median value is not influenced by outlier values or skewed
distribution shape. Median is a measure of the middle data or equal separation of
two data in a population.

To test a population based on the median, we will test the hypothesis whether
the median of a population under study, say, denoted by τ (read as “tau”), is
significantly different from a specific median, say, τ0 (read as “tau not”).

There are two types of non-parametric statistical tests that will be discussed in this
topic to test the position or location of a population using median value. These tests
are sign test and signed-rank test. Let us find out more about them in the following
subtopics.

ACTIVITY 9.1

You have learnt mean, median and mode in SBST1203 Introduction


Statistics. Can you recall the difference among them? Discuss answer in
the myINSPIRE forum.

9.1 MULTIPLE REGRESSION MODEL AND


ASSUMPTIONS
In constructing a hypothesis to check for a single population, there are three possible
alternative hypotheses, H1. In general, an alternative hypothesis is a statement or
claim that we wish to support or prove through sample collected and test performed.

On the other hand, null hypothesis refers to a statement that we wish to reject (note
that null comes from the English word “nullify” which means reject or invalidate).

Copyright © Open University Malaysia (OUM)


TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)  205

For example, in a study to test consumers’ preferences on a certain product, the test
will decide whether more than half of the consumers sampled chose this product or,
equivalently, fewer than half chose the other products. If x measures consumer
preference for the product, then the probability of the consumers preferring
the product to be larger or smaller than the median value must be equal to 1 2 (see
Figure 9.1).

Figure 9.1: Area under the graph from median value, τ

If the median is denoted by τ 0 , this can be written as Pr ( x < τ 0 ) =


Pr ( x < τ 0 ) = 1
2 = θ . Hence, we will test whether H 0 : θ ≤ 0.5 (consumers do not
have any preference for the product; that is, the number of consumers preferring the
product exceeding the median value is equal to the number of consumers preferring
the product less than the median value) versus H1 : θ > 0.5 (consumers prefer this
product). We can state the hypothesis of interest in terms of the median, that is,
H 0 :τ ≤ τ 0 against H1:τ > τ 0 .

For the previous example, the expression term in constructing the alternative
hypothesis statement H1 : θ > 0.5 or H1:τ > τ 0 is “larger than”.

In summary, the expressions in the previous example can lead us to decide the
set of null and alternative hypotheses for a single-population test, as stated in
Table 9.1.

Copyright © Open University Malaysia (OUM)


206  TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)

Table 9.1: Expression Terms with Related Null and Alternative Hypotheses

Examples of Expression Terms Alternative Hypothesis Null Hypothesis


• “More than” H1 : θ > 0.5 H 0 : θ ≤ 0.5
• “Exceeds” or or
( H1 : τ > τ 0 ) ( H 0 :τ ≤ τ 0 )
• “Increase”

• “Less than” H1 : θ < 0.5 H 0 : θ ≥ 0.5


• “Decrease” or or
( H1 : τ < τ 0 ) ( H 0 :τ ≥ τ 0 )

• “Differs from” H1 : θ ≠ 0.5 H 0 : θ = 0.5


• “Not equal to” or or
( H1 : τ ≠ τ 0 ) ( H 0 :τ = τ 0 )

Often, the null hypothesis statement is simplified to H 0 : θ = 0.5 or H 0 : τ = τ 0 in all


cases, which is, the population parameter does not differ or is equal to 1 2 .

SELF-CHECK 9.1

What alternative hypothesis and null hypothesis? Define them by using


your own words.

ACTIVITY 9.2

State the expression terms and define the appropriate null and alternative
hypothess for the following cases:

Alternative Null
Statement with Expressions
Hypothesis Hypothesis
(a) A supervisor recorded 9 observations of
battery lifetime before new recharge
required. Determine if this battery
operates with a median of 1.8 hours
before the next charging.
(b) The following data was obtained from a
non-normal population. Determine if
median was distributed less than 5.2cm.

Share your answer for discussion in the myINSPIRE forum.

Copyright © Open University Malaysia (OUM)


TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)  207

9.2 SIGN TEST


The sign test is often used as a non-parametric alternative to the one-sample t-test,
where we test the null hypothesis measure of central tendency, median against a
suitable alternative. For the sign test, the assumption is the population sample that
must be continuous and symmetrical. We assume the population is continuous, so
there is zero probability of getting a value equal to m0 . We ignore the assumption
of symmetrical distribution if the median replaces the mean in this test.

Median is the observed value that is located in the middle of data when all
observations are ranked in sequence regardless of an increasing or decreasing order.
If the sample size is even, the median would be the mean value of the two
observations at the centre. Similar to the mean value, median is also a measure of
location for a distribution. Hence, the sign test is sometimes known as test of
distribution location.

Suppose that, x1 , ..., xn , is a random sample from a population with unknown


median, τ. Let us say we aim to determine whether the population median is larger
than 100. Hence, τ 0 = 100. Since the expression used in this example is, “larger
than 100”, then the hypothesis to be tested is: Η 0 : τ = 100 against a one-sided
alternative hypothesis, Η 1 : τ > 100.

In the sign test, we replace each sample value exceeding median value, τ 0 with a
plus sign and each value less than τ 0 with a minus sign, that is:

If x1 > τ 0 , then x1 → “+”, if x1 < τ 0 , then x1 → “–“

The sample value which is equal to τ 0 value will be replaced with the “0” sign.
This situation occurs if we deal with rounded data even though the population is
continuous. Observations replaced with “0” sign will not be used in subsequent
analysis. When this occurs, the sample size for analysis will decrease as many as
the number of “0” (zero) signs. Table 9.2 summarises this information.

Copyright © Open University Malaysia (OUM)


208  TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)

Table 9.2: Summary of Sign Test

Sample Value Sign


xi > τ0 xi → “+”
xi < τ0 xi → “–“
xi = τ0 xi → “0”

In the sign test, the test statistics, S, is the random variable x representing the number
of “+” signs in the random sample. If the null hypothesis τ = τ 0 is true, the
probability that a sample value results in either a “+” or a “–” sign is equal to 1 2 .

Therefore, we are actually testing H 0 that the number of “+” sign, S, is a value of
a random variable having the binomial distribution with the parameter θ = 1 2 , that
is:

θ = Pr ( xi − τ 0 > 0 ) = Pr ( xi − τ 0 ) = 1
2

For the previous example, we shall reject the null hypothesis Η 0 : τ = 100 or
H 0 : θ > 0.5 only if the proportion of “+” sign is sufficiently greater than 1 2 , that
is, when S is large.

Let us learn the procedure for test of location for a single population:

(a) State the null and alternative hypotheses to test a population location
parameter:

One-sided test: H 0 : θ = 1
2 versus H1 : θ > 1 2
[or H 0 : θ = 1
2 against H1 : θ < 1 2]
Two-sided test: H 0 : θ = 1
2 versus H1 : θ ≠ 1
2

or
One-sided test: H 0 :τ = τ 0 versus H1:τ > τ 0
[or H 0 :τ = τ 0 against H1:τ < τ 0 ]
Two-sided test: H 0 :τ = τ 0 versus H1:τ ≠ τ 0 .

Copyright © Open University Malaysia (OUM)


TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)  209

(b) Calculate the test statistics:

One-sided test: S = Number of xi > τ 0 [or S = The number of xi < τ 0 ]


Two-sided test: S = Maximum (S1, S2 ) where S1 = The number of xi > τ 0
S2 = Number of xi < τ0 and S 2 = n – S1

(c) Determine the significance level:


One-sided test: p-value = Pr ( X ≥ S )
Two-sided test: p-value = 2 Pr ( X ≥ S )
X ~ Binomial with n sample size and Pr(“success”) = θ = 0.5.

You can refer to a binomial cumulative distribution table at


https://mat.iitm.ac.in/home/vetri/public_html/statistics/binomial.pdf
to obtain the p-value.

(d) Find the rejection region (RR):


One-sided and two-sided tests: Reject H 0 at α level if p-value < α.

Let us look at two examples which show you the calculation.

Example 9.1:
Suppose that we would like to test if the median of a population is less than 51.
From the following observations, calculate the test statistics and significance
level.
36 43 52 51 51 48 57 50

Answer:
To decide whether t is smaller than 51, test
Η 0 : τ = 51 versus Η 1 : τ = 51

Comparison between observations and τ 0 value resulted in the following signs:

36 43 52 51 51 48 57 50
– – + 0 0 – + –

Therefore, S = Number of “–” sign = 4 and n = 6, or, in summary, S ~ Bin (6,0.5).


From Table 9.2, p-value = Pr ( S ≥ 4) = 1 – Pr ( S ≤ 3) = 1 – 0.6562 = 0.3438.

Copyright © Open University Malaysia (OUM)


210  TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)

Example 9.2:
It is suspected that the percentage of active bacteria obtained from a sewerage
specimen at an area has a median of 40. The active bacteria percentages in a
random sample of 9 specimens are given below:
41 33 43 52 37 44 49 53 40

Is there enough evidence based on the data provided to claim that the median for
active bacteria percentage exceeded 40? Carry out a sign test by using α = 0.05.

Answer:
To determine if the median of percentage of active bacteria,τ0 exceeded 40, test:
H 0 :τ = 40 versus H1:τ > 40 at α = 0.05.

Assigning values exceeding 40 with “+” sign and values less than 40 with “–”
sign,
41 33 43 52 37 44 49 53 40
+ – + + – + + + 0

Using the sign test, the test statistics, S = Number of observed “+” signs = 6.
Hence, S is distributed as binomial with n = 9 – 1 = 8 and θ = 0.5. If the x variable
is distributed as binomial with n = 8 and θ = 0.5, then:

p-value = Pr ( x ≥ S ) = Pr ( x ≥ 6) = 1 – Pr ( x ≤ 5)
= 1 – 0.8555 = 0.1445

Since α = 0.05 < p-value = 0.1455, therefore do not reject the H 0 . There is not
enough evidence to say that the median for active bacteria percentage exceeds 40
at 5% significance level.

SELF-CHECK 9.2

What is sign test? What is another name for sign test?

Copyright © Open University Malaysia (OUM)


TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)  211

ACTIVITY 9.3

The following data are test marks data of 10 returning students: 65 85


43 38 90 73 65 59 88 74. Test has been performed to determine the
performance of these students in a test exceed the population median value
of 65.
(a) Define the “+” and “–” signs in this example.
(b) How many “+” and “–” signs are there in this study?

Discuss the correct answer in the myINSPIRE forum.

9.2.1 Sign Test for Large n


Recall that normal distribution can be used as an approximation to binomial
distribution when sample size, n, is large. Since θ = 1 2 , and binomial distribution
is symmetrical, hence, normal approximation can be used for sample size n as small
as 10. For a more precise analysis, normal approximation is used when sample size
n ≥ 15.

The procedure for single population test of location for a large sample is as follows:

(a) State the null and alternative hypotheses for testing a population location
(refer to hypothesis for small n).

(b) Calculate the test statistics:

S − Mean( S ) S − 0.5S
Z= =
var( S ) 0.5 n

(c) Determine the rejection region (RR):

One-sided test: Z ≥ zα
Two-sided test: Z ≥ zα /2
zα and zα /2 values can be obtained from Appendix 3.1 (see Topic 3), standard
deviation.

Copyright © Open University Malaysia (OUM)


212  TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)

Let us look at Example 9.3.

Example 9.3:
The following data are the amount of sulphur oxide (in tons) emitted by an
industrial plant in 40 days. Perform a sign test to determine whether τ < 21.5 at
0.01 significance level.
17 15 20 29 19 18 22 25 27 9 24 20 17 6 24
14 15 23 24 26 19 23 28 19 16 22 24 17 20 14
13 19 10 23 18 31 13 20 17 24

Answer:

Step 1: Test to determine whether τ < 21.5,

H 0 :τ = 21.5

H1:τ < 21.5

Step 2: For a one-sided test, reject H 0 if test statistics z > z0.01 = 2.33 where

S −θ
z=
nθ (1 − nθ )

at θ = 1 2 and S = number of observed “–” sign (sample values that


are less than 21.5)

Since n = 40, and S = 24, then mean ( S ) = nθ = 40. ( 1 2 ) = 20 while

Var ( S ) = nθ = 1 − n = 40 ( 0.5)( 0.5 ) = 3.16


∴ z = ( 24 − 20 ) / 3.16 = 1.26

Step 3: Since z = 1.26 < 2.33, we do not reject H 0 . There is not enough
evidence to prove that sulphur oxide content is less than 21.5 at 0.01
significance level.

Copyright © Open University Malaysia (OUM)


TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)  213

EXERCISE 9.1

1. The following data are measures of elasticity strength of a type of


fabric produced by a textile company:
163 165 160 189 161 171 158 151 169 162
163 139 172 165 148 166 172 163 187 173

Given that t0 = 160, use the sign test to test the null hypothesis
t = t0 against alternative hypothesis t > t0 at 0.05 significance level.

2. Use the sign test to test H 0 : t = t0 versus H1 : t1 < t0 , where


S1 = Number of observations > t0 and S2 = Number of
observations < t0 and show that Pr ( S13 ≥ c) = Pr (S2 ≤ n − c) for
0 ≤ c ≤ n.

9.3 WILCOXON SIGNED-RANK TEST


In the sign test procedure, note that the sign test utilised only the plus and minus
signs of the differences between the observations and τ 0 value but it does not take
into consideration the magnitudes of differences. A test procedure for a single
population, called Wilcoxon signed-rank test, considers the magnitudes of these
differences where ranks are assigned to observations based on these magnitudes.

Under the null hypothesis that there is no difference between x values and τ 0 , we
would expect that on average, half the differences would be negative and the other
half positive.

In other words, there will be n/2 negative differences and vice-versa. Next, we
would rank these positive and negative differences in an absolute value, and assign
ranks according to sequence. It is expected that the total rank corresponding to the
positive differences should be equal or nearly equal to the total ranks which
correspond to the negative differences. The obvious difference in total rank
assigned to positive and negative differences is an indication of differences between
x values and τ 0 .

Copyright © Open University Malaysia (OUM)


214  TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)

What are the procedures in applying the Wilcoxon signed-rank test? Let us follow
the following procedure:

(a) Calculate the differences between observations and the τ 0 value.

(b) Obtain the absolute difference.

(c) Assign rank to the absolute difference (rank 1 for smallest absolute difference;
rank n for the largest).

(d) When the absolute value of two or more differences is the same, assign to
each the average of the ranks that would have been assigned if the differences
were distinguishable.

(e) Calculate the total rank T − (negative differences) and T + (positive


differences).

(f) Differences with 0 value will be discarded, hence, reduction in sample size by
that amount.

The smaller the total rank value, the bigger the possibility that there exists
differences between sample values and τ 0 . Hence, we can reject H 0 when the test
statistics, that is the total rank, say T, is less than or equal to a critical value T0 .

The single population test procedure that considers magnitude and difference sign
is as the following:

(a) State the null and alternative hypotheses statement for a single
population test.

(b) Calculate the test statistics:

One-sided test: T − = Total rank of difference “–”

[or T + = Total rank of difference “+”]

Two-sided test: T = Minimum (T + , T − )

Copyright © Open University Malaysia (OUM)


TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)  215

(c) Find the rejection region (RR):

One-sided test: Reject H 0 if T − ≤ T0 [or reject H 0 if T + ≤ T0 ]

Two-sided test: Reject H 0 if T ≤ T0

To obtain the critical value T0 , you can refer to

https://faculty.washington.edu/heagerty/Books/Biostatistics/TABLES/t-
Tables/.

Let us look at Example 9.4.

Example 9.4:
Based on Example 9.2, test to determine whether the median of percentages of
active bacteria exceeds 40 at α = 5%. Use Wilcoxon signed-rank to make a
decision.

Answer:
H 0 :τ = 40 versus H1:τ > 40, α = 0.05

Following the Wilcoxon signed-rank test procedure, we obtain this result:

% Active Bacteria, yi yi – 40 Difference Rank

41 +1 1 (+) 1
33 –7 7 (–) 5
43 +3 3 (+) 2.5
52 +12 12 (+) 7
37 –3 3 (–) 2.5
44 +4 4 (+) 4
49 +9 9 (+) 6
53 +13 13 (+) 8
40 0 0 –

Copyright © Open University Malaysia (OUM)


216  TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)

From the previous table, the total differences with “+” sign and total differences
with “–” sign are T + = 28.5 and T − = 7.5 respectively. Since there is only one
observation with a value equal to the median value, n = 9 – 1 = 8.

For a one-sided test, the test statistics is given as T − = 7.5. From the table of
critical value for the Wilcoxon signed-rank test (see Appendix 9.1), with n = 8,
the critical value is T0.05 = 4. Since, T − = 7.5 is not ≤ T0.05 = 4, we do not reject
H0. There is not enough evidence to prove that the median percentage of active
bacteria is more than 40. A similar conclusion is obtained through a sign test.

9.3.1 Wilcoxon Signed-rank Test for Large n


For a large sample size, let us say n ≥ 15, and from the central limit theorem, the
distribution of test statistics T (either T + or T − ) will approach normal distribution.
Hence, T is a random variable with mean and variance,

n ( n + 1) n ( n + 1)( 2n + 1)
μ = J (T ) = σ 2 = Var (T ) =
4 24

T − μT
The signed-rank test statistics for n ≥ 15 is Z = distributed as standard
σT
T − − μT
normal. For a one-sided test, the test statistics is Z = (right side) or
σT
T + − μT
Z= (left side).
σT

Copyright © Open University Malaysia (OUM)


TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)  217

Let us look at the procedure for one location test with large n using the Wilcoxon
signed-rank test:

(a) State the null and alternative hypotheses statement for a single population test.

(b) Calculate the test statistics:

Using the same definition for T, T + and T − as previously, the test statistics
4
is Z = , with T = T − (one-sided right test),
n ( n + 1)( 2n + 1)
24

T = T + (1 sided – Left test) and T = mean ( T + , T − ) for two-sided test.

3. Determine the rejection region (RR):


One-sided test: Z ≥ za [or Z ≤ − z a ]

Two-sided test: Z ≥ za /2

za and za /2 values can be obtained from standard normal distribution table.

Let us look at our final example.

Example 9.5:
It is claimed that a type of detergent is the choice of many consumers. To test
this claim, the detergent’s producer has recorded its sales for a month at a
hypermarket as shown below:

85 100 121 73 150 119


99 129 94 123 124 127
120 115 78 119 100 96
116 141 152 85 101 109
138 142 97 128 130 83

Test whether the median sales of this detergent differs from 120 units at 5% level
of significance.

Copyright © Open University Malaysia (OUM)


218  TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)

Answer:
H 0 :τ = 120 against H1:τ ≠ 120 at α = 0.05. All observations are subtracted from
the median value, τ 0 = 120. The magnitude and difference signs are recorded and
next, ranks are assigned to each difference. The results are as follows:

yi yi − t 0 Rank yi yi − t 0 Rank
85 –35 (–) 25.5 73 –47 (–) 29
99 –21 (–) 17.5 123 +3 (+) 4
12 0 0 119 –1 (–) 2
116 –4 (–) 5.5 85 –35 (–) 25.5
138 +8 (+) 13 128 +8 (+) 9
100 –20 (–) 15.5 150 +30 (+) 23
129 +9 (+) 10 124 +4 (+) 5.5
115 –5 (–) 7 100 –20 (–) 15.5
141 +21 (+) 17.5 101 –19 (–) 14
142 +22 (+) 19 130 +10 (+) 11
121 +1 (+) 2 119 –1 (–) 2
94 –26 (–) 22 127 +7 (+) 8
78 –42 (–) 28 96 –24 (–) 21
152 +32 (+) 24 109 –11 (–) 12
97 –23 (–) 20 83 –37 (–) 27

An observation has been discarded since its difference = “0”, hence, n = 29. Total
differences is T + = 146 while T − = 289. Since n is large, normal approximation
is used. The test statistics calculated is:
4 4
Z= = = −1.546
n ( n + 1)( 2n + 1) 29 ( 30 )( 59 )
24 24

Since Z < Z 0.025 = 1.96, reject H 0 . In conclusion, the median of detergent’s


purchases differs significantly from 120 at 5% level of significance.

Copyright © Open University Malaysia (OUM)


TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)  219

SELF-CHECK 9.3

What are the differences between sign test and Wilcoxon signed-rank test?

EXERCISE 9.2

1. For Wilcoxon signed-rank test, show that the sum of positive and
negative differences, T + + T − = n ( n + 1) / 2 with n is the number of
non-zero differences assigned rank.

2. The following are 15 measures of hydrocarbon gas content:

97.5 95.2 97.3 96.0 96.8 100.3 97.4 95.3


93.2 99.1 96.1 97.6 98.2 98.5 94.9

Use the signed-rank test at = 0.05 to test whether the median gas
content is 98.5.

3. A sewerage pipe at a housing area is subjected to have a mean


strength less than 2,500kg. An evaluation contractor randomly
selected pipes and the measurements on those pipes are:
2,610 2,750 2,420 2,510 2,540 2,490 2,680

Use the sign test at α = 0.10 to determine whether these pipes follow
the specification require. Compare the result with the Wilcoxon
signed-rank test.

4. A polynomial problem of 0 – 1 quick-solution algorithm Boolean


concepts has been discovered. 25 random problems and the time
taken (in CPU seconds) were recorded:

Carry out both the sign and signed-rank tests to determine whether
more than half of the random polynomial 0 – 1 problems require less
than or equal to 1 CPU second. Use α = 0.01.

Copyright © Open University Malaysia (OUM)


220  TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)

• A single population test involves comparison of a position or population


location under study by using median measurement with a certain population
median value. Two methods of non-parametric statistics can be used to perform
a test on a single population location, which are sign test and signed-rank test.

• Alternative hypothesis is a statement or claim that we wish to support or prove


by collecting a sample and performing a test.

• Null hypothesis refers to a statement that we wish to reject.

• Sign test is an easier approach with simpler calculation, while signed-rank test
is more precise as it takes into account the magnitude of differences between
sample values and the specific value of interest in the test, apart from
information on sign or direction of difference.

• A test procedure for a single population, Wilcoxon signed-rank test, takes into
consideration the magnitudes of these differences where ranks are assigned to
observations based on these magnitudes.

Sign test – The sign test is designed to test a hypothesis about the location of a
population distribution. It is often used to test a hypothesis about a
population median and involves the use of matched pairs, for example,
before and after data, in which case it tests for a median difference of
zero.

Copyright © Open University Malaysia (OUM)


TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)  221

Freund, J. E. (2003). Mathematical statistics (7th ed.). Upper Saddle River, NJ:
Prentice-Hall, Inc.
Mann, P. S. (2005). Introductory statistics using technology (5th ed.). Upper Saddle
River, NJ: John Wiley & Sons, Inc.
Mendenhall, W., Beaver, R. J., & Beaver, B. M. (2013). Introduction to probability
and statistics (14th ed.). Belmont, CA: Thomson Brooks/Cole.
Walpole, R. E. (2006). Probability and statistics for engineers and scientist
(8th ed.). Upper Saddle River, NJ: Prentice-Hall, Inc.

Copyright © Open University Malaysia (OUM)


222  TOPIC 9 HYPOTHESIS TESTING (SINGLE POPULATION)

9.1: Critical Values of the Wilcoxon Signed Ranks Test

Source: http://users.stat.ufl.edu/~winner/tables/wilcox_signrank.pdf

Copyright © Open University Malaysia (OUM)


Topic  Hypothesis
Testing (Two
10 Populations)
LEARNING OUTCOMES
By the end of this topic, you should be able to:
1. Determine dependent and independent populations;
2. Construct hypothesis statement for two populations;
3. Compare two dependent populations by using the Wilcoxon signed-
rank method; and
4. Evaluate two independent populations by using the Mann-Whitney
total rank method.

 INTRODUCTION
A researcher often conducts observations to compare two populations under study,
such as whether both populations come from the same distribution. For example, in
a parametric test, two random samples, X 1 , ..., X n1 and Y1 , ..., Yn 2 , are obtained
from two normal populations with a mean of μ x and μ y respectively and constant
variance. The researcher may be interested to test H 0 : μ x = μ y versus H1 : μ x < μ y .
If the null hypothesis holds, the researcher can conclude that both distributions are
distributed as normal with similar mean and variance; in other words, both samples
were taken from the same population.

On the other hand, if the alternative hypothesis is true, then μ x < μ y , that is, the
location parameter of X (selected as the mean) has a smaller value than the location
parameter of Y.

Copyright © Open University Malaysia (OUM)


224  TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)

Hence, the X population distribution is located on the left side of the Y distribution.
The dispersion of X and Y distributions is still the same as both variances are
assumed constant.

In a non-parametric test, we will be comparing two populations using the second


distribution, and not using any parameter in particular. In general, comparison is
made to determine whether both population distributions are different, or in
particular and more accurately, whether the distribution of population 1 is located
on the left or right side of distribution of population 2. Note that a non-parametric
test does not require assumption of population normality. Let us learn more about
how to do hypothesis testing on two populations in this last topic. Happy reading!

10.1 DEPENDENT AND INDEPENDENT


POPULATIONS
If comparing two populations, it is important to check whether both populations are
independent. Two populations that aim to compare are said to be independent
when samples taken from one population is not dependent on or influenced by the
samples chosen from the other population.

For example, if we are comparing male and female students’ marks in a basic
statistics course, we are sure that the selection of the first sample from the male
students’ population will not be influenced or influence the second sample or any
sample from the female students’ population and vice-versa.

Hence, both populations and samples can be categorised as two independent


samples. Another example is population 1 which consists of families in town A is
considered as independent of families staying in town B that form population 2.

In comparing two independent populations, since the selection of samples from


population 1 does not influence the selection of samples from population 2, the
sample size n1 from population 1 and n2 from population 2 may be equal or
different.

On the other hand, if we can associate or match two populations where the selection
of samples from the second population depends on the selection of samples from
the first population, both are said to be dependent.

An example of two dependent populations is a study on the effectiveness of vehicle


safety tools where the measure of injuries faced by a driver when putting on safety
tools (sample 1) is compared with the measure of injuries on the driver when he/she

Copyright © Open University Malaysia (OUM)


TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)  225

is not putting on any safety tool (sample 2). In this case, both samples are related
and experimented on the same subject, that is, the same driver is used to obtain
measures of injuries when putting on the safety tools and when not putting on the
tools.

In testing two dependent populations, the sample size n1 and n2 must be equal,
that is n1 = n2 = n due to relationship or similarity in data source/measurement
obtained, as in the case of similar subjects and the comparison made is based on
paired comparison.

SELF-CHECK 10.1

What is the difference between dependent and independent populations?

ACTIVITY 10.1
Determine whether the following data represents two dependent
populations:
(a) An average accident that occurred during work at a factory before
and after the implementation of a safety program.
(b) The nicotine content in cigarette brand X and Y. Give other examples
for both types of populations.
Discuss the answer in the myINSPIRE forum.

10.2 HYPOTHESIS STATEMENT FOR TESTING


OF TWO POPULATIONS
In two-population hypothesis testing using non-parametric statistics, comparison
is made between the populations with reference to the location of population
distributions in general, that is, we will compare population 1 distribution, denoted
by D1 with X 1 , X 2 , ..., X n1 and population 2 distribution, let say D2 , with
Y1 , Y2 , ..., Yn 2 .

Copyright © Open University Malaysia (OUM)


226  TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)

In general, the null hypothesis H0 : D1 = D2 means there is no difference in both


population distributions, that is, they are equal. In other words, on average, there
are no significant differences in X 1 , X 2 , ..., X n1 values versus Y1 , Y2 , ..., Yn 2
values. There are three possible alternatives for the hypothesis statements:

(a) H1 : D1 < D2 means population 1 distribution (which contains


X 1 , X 2 , ..., X n1 ) is located on the left side of population 2 (which contains
Y1 , Y2 , ..., Yn 2 ). This also means on average, X 1 , X 2 , ..., X n1 values are
smaller than Y1 , Y2 , ..., Yn 2 values.

(b) H1 : D1 > D2 means population 1 distribution is located on the right side of


population 2.

(c) H1 : D1 ≠ D2 means the location of population 1 distribution is not the same


as the location of population 2.

The construction of an alternative hypothesis depends on the claim in the study or


question that needs to be answered. Let us look at three examples that demonstrate
this concept.

Example 10.1:
A company manager claims that night-shift workers tend to apply for more sick
leave compared to day-shift workers. Construct a hypothesis to test whether the
number of sick leaves for night-shift workers is higher than for day-shift workers.

Answer:
Define D1 as the distribution of sick leaves applied for by night-shift workers
and D2 as the distribution of sick leaves applied for by day-shift workers. From
the expression “higher”, we can conclude that H1 : D1 > D2 while H 0 : D1 = D2 .

Copyright © Open University Malaysia (OUM)


TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)  227

Example 10.2:
It is claimed that students who were not provided sample examination problems
in advance will obtain lower marks compared to those who received them. To
test this claim, 20 students were selected so that each matched pair has almost the
same overall quality point average in other examinations. Construct a hypothesis
to test this claim.

Answer:
Define D1 as the distribution of marks for students who did not have the sample
problems and D2 as the distribution of marks for students who were provided
sample problems. From the expression “lower”, we can test whether
X 1 , X 2 , ..., X n1 values are smaller than Y1 , Y2 , ..., Yn 2 values or D1 is located on
the left side of D2 .

Hence, the null and alternative hypotheses can be described as H 0 : D1 = D2


versus H1 : D1 < D2 .

Example 10.3:
Twelve students identified as obese were put on a special diet believed to be able
to reduce body weight. Their weight before and after the diet was monitored for
a month. Construct a hypothesis to test whether this diet is effective.

Answer:
Define D1 as the students’ weight distribution before starting the diet and D2 as
the distribution of weight after the diet. If the diet is effective, the observation
values in D1 must be larger than the observation values in D2 . In other words,
D1 must be located on the right side of D2 . Hence, the alternative hypothesis is
H 0 : D1 > D2 .

The weight distribution before and after the diet can also be viewed as the
same distribution as the weight difference between the weight before and the
weight after, that is Di = X i − Yi . The alternative hypothesis can be described
as H1 : Di = X i − Yi > 0 and H 0 : Di = 0. We will discuss this further in
Subtopic 10.3.

Copyright © Open University Malaysia (OUM)


228  TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)

Some examples of expressions that provide clues in constructing suitable null and
alternative hypotheses for two independent populations are given in Table 10.1.

Table 10.1: Summary of Expression Terms with the Null and Alternative Hypotheses

Expression Terms Alternative Hypothesis Null Hypothesis


• “Larger than” H1 : D1 > D2 H 0 : D1 ≤ D2
• “Increase”
• “Bigger”
• “More”

• “Less than” H1 : D1 < D2 H 0 : D1 ≥ D2


• “Decrease”
• “Reduce”

• “Different than” H1 : D1 ≠ D2 H 0 : D1 = D2
• “Not equal to”

10.3 COMPARING TWO DEPENDENT


POPULATIONS
Suppose there are n pairs of observations in the form ( X i − Yi ) with Xi as the
evaluation or observation in a specific situation (e.g. before treatment) and Yi is the
evaluation or observation in another situation (e.g. after treatment). To test the
hypothesis that both distributions are equal versus the alternative hypothesis that
both distributions are different in terms of their location, a non-parametric statistical
test can be used.

There are two methods for comparing two dependent populations, sign test and
Wilcoxon signed-rank test. Both methods were discussed in Topic 9 for single
population testing. Now, let us look at how to use them for two populations.

Copyright © Open University Malaysia (OUM)


TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)  229

10.3.1 Sign Test for Two Dependent Populations


The sign test, which has been used to test the location or position of a single
population, is now further extended to comparison testing of two locations or
populations’ position.

In general, we will compare whether population 1 distribution is different


from population 2 distribution as discussed in Subtopic 10.2. Suppose that
Di = X i − τ 0 (τ 0 is the median under H 0 ). Hence,

1
θ = Pr ( X i >τ 0 ) = Pr ( X i >τ 0 > 0 ) =
2
1
= Pr ( Di > 0 ) = = Pr ( Di < 0 )
2

for two dependents or paired populations, Di = X i − Yi − τ 0 . Under H 0 ,


1
θ = Pr ( Di > 0 ) = = Pr ( Di < 0 ) . If X i and Yi , i = 1, ..., n (for two
2
paired samples, n = n1 = n2 ) come from the same population, hence
1
Pr ( Di > 0 ) = Pr ( Di < 0 ) . By replacing X i − τ 0 with X i − Yi − τ 0 , we can use the
2
results of the sign test for a single population to test two dependent or paired
populations.

Therefore, H 0 can be written as:

H 0 : Pr ( Di > 0 ) = Pr ( Di < 0 ) = θ = 1 − 2 or H 0 : τ1 − τ 2 = 0

Suppose that S represents the sum of differences between X i and Yi marked as “+”,
1
S follows a binomial distribution with θ = . Thus, the null hypothesis statement
2
1
for comparing two paired populations is H 0 : θ = .
2

Copyright © Open University Malaysia (OUM)


230  TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)

How do we perform a sign test for two dependent populations? Let us follow these
steps:

(a) Obtain differences between the first sample and its pair, the second sample.

(b) Assign the “+” or “–” sign according to the result of the differences. The
paired sample with zero difference is discarded.

(c) Count the sum of “+” signs for one-sided (right) test and the sum of “–” sign
for one-sided (left) test.

Next, the rejection region (RR) can be determined by using binomial probability
distribution.

Take note that the testing procedure for two dependent or paired populations is
similar to the testing procedure for a single population.

Now, let us study Examples 10.4, 10.5 and 10.6.

Example 10.4:
A manager aims to study whether a raise in employees’ salary will reduce the
number of defective products. Data on defective products before and after salary
increment are recorded. Construct appropriate null and alternative hypotheses
and state the test statistics.

Answer:
To determine whether a salary increment results in lower defective products, test
1
H 0 : θ = (the distribution of defective products is the same before and after
2
1
salary increment) or H 0 : τ after = τ before , versus H1 : θ < (there are fewer
2
defective products after salary increment than before the increment) or
H 0 : τ after < τ before . From the alternative hypothesis, the test is a one-sided (left)
test. Hence, test statistics = S2 = the number of differences between X and Y with
“–” sign.
t

Copyright © Open University Malaysia (OUM)


TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)  231

Example 10.5:
A fast-food restaurant’s marketing department plans to identify whether a new
ingredient results in tastier fried chicken compared to the original ingredients.
Ten culinary experts are chosen at random to evaluate fried chicken cooked with
and without the new ingredient and are asked to rate the taste at a scale of 1 to 10
(1 represents least delicious and 10 very delicious). The results are as follows:

Culinary Expert Original Ingredients New Ingredient


A 3 9
B 5 5
C 3 6
D 1 3
E 5 10
F 8 4
G 2 2
H 8 5
I 4 6
J 6 7

Answer:
There are two dependent samples since the evaluation of the fried chicken cooked
with original and new ingredients were made by the same subjects (culinary
experts). The hypothesis to test whether the two types of ingredients are different,
1
H 0 : There is no change in the fried chicken’s taste or θ = versus
2
1
H1 : The new ingredient resulted in tastier fried chicken or θ > .
2

Next, using the sign test,


n = Total number of observations (excluding those with zero difference)
n = Total number of “+” sign and “–” sign = 6 + 2 = 8
S = Total number of “+” sign = 6

Copyright © Open University Malaysia (OUM)


232  TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)

Di = New
Culinary Original New
Difference Ingredient –
Expert Ingredients Ingredient
Original
A 3 9 6 +
B 5 5 0 0
C 3 6 3 +
D 1 3 2 +
E 5 10 5 +
F 8 4 –4 –
G 2 2 0 0
H 8 5 –3 –
I 4 6 2 +
J 6 7 1 +

From the table above, we can see that 6 out of 10 culinary experts found that the
chicken tasted better with the new ingredient, with 2 saying that the original
ingredient tastes better while 2 other experts could not detect any difference.

In a one-sided right test, if H 0 is true, a large number of “+” sign or small number
or “–” sign will result in H 0 rejection.

( )
From the binomial table with n = 8 and θ = 0.5, Pr S 3 6 = 1.1445. Since p-value
= 0.1445 is greater than the significance level value, α = 0.05, we do not reject
the H 0 . In conclusion, the fried chicken cooked with the new ingredient does not
have a significant difference from the fried chicken cooked without it at 0.05
significance level.

If the sample size is large, normal distribution can be used as an approximation


to the binomial distribution. The normal approximation rules are nθ 3 ≥ 5 and
n (1 − θ ) ≥ 5. Even with θ = 0.5, normal approximation can still be used for n as
3

small as 10, but for a more precise result, normal approximation is used for
n3 ≥ 15.

Copyright © Open University Malaysia (OUM)


TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)  233

Example 10.6:
A total of 35 customers are randomly chosen and asked whether fried chicken
cooked with the new ingredient tastes differently from the fried chicken cooked
without it. The summary of the results are as follows:
“+” difference = 19
“–” difference = 13
“0” difference (no difference in evaluation) = 3

Carry out a test at 5% level of significance to determine whether the customers


prefer the new ingredient.

Answer:
To determine whether the new ingredient is preferable, test H 0 : θ = 0.5 versus
H1 : θ > 0.5.

S = The number of “+” sign = 19


Sample size, n = 32

S − 0.5n 2 S − n 2 (19 ) − 32
Test statistics = = = = 1.061
0.5 n n 32

From the standard normal table, the critical value z0.05 = 1.645 for one-sided test.
Since 1.061 < 1.645, do not reject the null hypothesis.

10.3.2 Wilcoxon Signed-rank Test for Two Dependent


Populations
Another method to compare a two-paired sample is the Wilcoxon Signed-rank test
which uses information not only from the sign but also on the magnitudes of the
differences. The test procedure has been discussed in test of location for single
population using Wilcoxon signed-rank test in Topic 9.

Remember that the signed-rank test is based on T + , that is, the sum of the ranks
assigned to the positive differences, or T − , that is, the sum of the ranks assigned to
(
the negative differences, or T, where T = minimum T + , T − . )

Copyright © Open University Malaysia (OUM)


234  TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)

Under null hypothesis, there is no difference between single population distribution


and two-population distribution; it is expected that half of the differences will be
“+” sign and another half “–” sign. The sum of T + and T − is always n
( n + 1) and
2
they are both values of random variables that take on values on the interval from 0
to n
( n + 1) inclusive, and the distributions are symmetrical about n ( n + 1) .
2 4

The steps in the Wilcoxon signed-rank test for two dependent populations are as
follows:

(a) Calculate the difference for each sample pair.

(b) Obtain absolute values of the differences.

(c) Assign rank to the absolute values of the differences (1 for smallest
absolute difference; n for the largest).

(d) Differences with the equal value will be assigned the mean rank for ranks
that they jointly occupy.

(e) Count the sum of ranks T − (negative differences) and T + (positive


differences).

(f) Zero differences are discarded; hence, the sample size will be reduced by the
number of differences with 0 values.

The test procedure for a paired two-population with sign-ranked method is similar
to the test procedure for a single population. Let us look at Example 10.7.

Copyright © Open University Malaysia (OUM)


TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)  235

Example 10.7:
In evaluating paper quality, paper smoothness is very important to ensure
customers’ acceptance. Suppose that 10 judges were each given two samples of
paper produced by a factory. The evaluations of the judges were assigned rank 1
to 10, with rank 10 representing the highest quality of smoothness. From the
evaluation results below, test for differences in quality for both paper products at
0.05 significance level.

Judge 1 2 3 4 5 6 7 8 9 10
Product A 6 8 4 9 4 7 6 5 6 8
Product B 4 5 5 8 1 9 2 3 7 2

Answer:
The hypothesis tests for differences in both paper product’s quality,

H 0 : The distributions of evaluation for both products 1 and 2 are the same or
H 0 : τ1 = τ 2 versus H1 : The distributions of evaluation for both products 1 and 2
are different or H1 : τ1 ≠ τ 2 .

Applying the signed-rank method, the test procedure generated the following
results:

Differences Differences Rank


Judge A B
(A – B) (A – B) Differences
1 6 4 +2 2 (+)5
2 8 5 +3 3 (+)7.5
3 4 5 –1 1 (–)2
4 9 8 +1 1 (+)2
5 4 1 +3 3 (+)7.5
6 7 9 –2 2 (–)5
7 6 2 +4 4 (+)9
8 5 3 +2 2 (+)5
9 6 7 –1 1 (–)2
10 8 2 +6 6 (+)10

Copyright © Open University Malaysia (OUM)


236  TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)

From the table, the sum of the rank differences “+” = T + = 46, while the sum of
the rank differences “–” = T − = 9. Since the test is two-sided, the test statistics is
given by:

( )
T = Minimum T + , T − . = T − = 9.

With n = 10 and α = 0.05, the critical value is T0 = 8. H 0 will be rejected if T ≤


T0 . Since T = 9 not ≤ T0 , H 0 is not rejected. In conclusion, there is not enough
evidence to say that there are shifts between the two distributions of evaluation
for paper quality at α = 5%.

If the sample size is large, let us say n3 ≥ 15, the distribution of test statistics T
(either T + or T − ) will approach normal distribution. To perform the signed-rank
test for large n, T is a random variable with mean and variance,

n ( n + 1) n ( n + 1)( 2n + 1)
μ = E (T ) = σ 2 = Var (T ) =
4 24

T −μ
Hence, the signed-rank test statistics for n3 ≥ 15 is Z = which is a standard
σ
T− −μ
normal. For a single-sided test, the test statistics is Z= or
σ
T+ −μ
Z= .
σ

Copyright © Open University Malaysia (OUM)


TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)  237

Let us look at another example.

Example 10.8:
A company producing energy drinks claimed that the drinks are effective in reducing
body weight. The following are the weights of 16 random samples before and after
four weeks of taking the drinks.

Weight Before 147.0 183.5 232.1 161.6 197.5 206.3 177.0 215.4
Weight After 137.9 176.2 219.0 163.8 193.5 201.4 180.6 203.2
Weight Before 147.7 208.1 166.8 131.9 150.3 197.2 159.8 171.6
Weight After 149.0 195.4 158.5 134.4 149.3 189.1 159.1 173.2

Use the signed-rank test to test at 0.05 level of significance whether the company’s
claim is true.

Answer:
The energy drinks are said to be effective if the weight distribution before > weight
distribution after, that is, the number of “+” sign is less than the number of “–” sign.
To determine whether the energy drinks are effective in reducing body weight, test:

1 1
H0 :θ = versus H1 : θ <
2 2

The Wilcoxon signed-rank procedure for testing two dependent populations gave
the following results:

The test statistics T– = 5 + 7 + 3 + 6 + 4 = 25, with mean and variance,


n ( n + 1) 16 (17 ) n ( n + 1)( 2n + 1) (16 )(17 )( 33)
μ= = = 68 σ2 = = = 374
4 4 24 24

For a one-sided (right) test, the null hypothesis will reject if the test statistics,

T− −μ 25 − 68
Z= = = −2.22 < The critical value z0.05 = −1.645.
σ 374

Since z = −2.22 < z0.05 = −1.645, we reject the null hypothesis. We conclude that the
energy drinks are effective in reducing body weight at 5% level of significance.

Copyright © Open University Malaysia (OUM)


238  TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)

EXERCISE 10.1

1. Suppose that the differences in paired data are 15 “+” signs, 5 “–”
signs and 9 “0”, use the sign test for right-end test,
(a) What are the values for n and S?
(b) At 0.05 level of significance, will H 0 be rejected?

2. To determine effectiveness of a new traffic-control system, the


number of accidents occurred at 12 dangerous intersections during
four weeks before and four weeks after the installation of the new
system were observed, and the following data were obtained:

Before 3 3 1 5 3 6 2 0 4 3 4 1
After 1 2 3 2 0 4 3 2 1 2 3 0

Use the sign test to test that the new traffic-control system is more
effective than the old system at 0.05 level of significance.

10.4 COMPARING TWO INDEPENDENT


POPULATIONS
The Wilcoxon rank-sum test is a better alternative to the two-sample t test in the
case of testing the equality of two populations that are non-normal and the samples
chosen are independent (i.e. there is no pairing of observations).

Suppose there are n1 and n2 independent samples from population 1 and population
2 respectively. The procedures for the rank-sum test suggest that we combine n1 +
n2 = n observations and assign rank according to the observed magnitude. Rank 1
will be assigned to observation with the smallest value and rank n to the observation
with the highest value.

Copyright © Open University Malaysia (OUM)


TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)  239

In the case of ties (identical observations), we would replace the observations by


the mean of the ranks that the observations would be entitled to if they were
distinguishable. If both samples actually come from the same distribution, the sum
of the ranks corresponding to the first sample, W1 , and the sum of the ranks
corresponding to the second sample, W2 , will be proportional to respective sample
sizes. If n1 and n2 are equal, hence W1 + W2 should be almost identical. If one of
the rank-sums is sufficiently large, while the other one is very small, this shows
there is a possibility of significant difference in both sample distributions.

Mann and Whitney have suggested a test statistics which also uses the sum of the
ranks for both samples and it can be shown to be equivalent to the Wilcoxon test.
This test, known as the Mann-Whitney U test, has been used extensively since the
availability of table for U critical values.

If comparing two populations using the Mann-Whitney test, the following statistics
will be used as the test statistics:

n1 ( n1 + 1)
U 0 = n1n2 + − W1 or
2
n ( n + 1)
U 2 = n1n2 + 2 2 − W2 or
2
U = The minimum of U1 and U 2

where U1 + U 2 = n1n2 , while W1 and W2 are the sum of the ranks of the values of
the first and second samples respectively.

From the formulas for U1 and U 2 , U1 will be small when W1 is large. This can
only happen if the population 1 distribution is shifted to the right of the population
2 distribution. Hence, the test statistics U1 will be used when the alternative
hypothesis is D1 > D2 .

Copyright © Open University Malaysia (OUM)


240  TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)

The following are the steps of the Mann-Whitney rank-sum test:

(a) Arrange all n = n1 + n2 data from both populations, where n1 is the sample
size for population 1 and n2 for population 2.

(b) Arrange in ascending order regardless of the population.

(c) Assign rank to the arranged data. Assign rank 1 for data with the smallest
value and n for the largest data.

(d) In the case of ties (identical observations), we replace the observations with
the mean of the ranks that the observations would have if they were
distinguishable (tie-rank).

(e) Sum up the ranks for each sample.

If the samples chosen were from two identical populations, it was expected that the
sum of the ranks of both samples would not differ too much. If there is an
appreciable difference between the means of the two populations, most of the lower
ranks are likely to go to the values of one sample, while most of the higher ranks
are likely to go to the values of the other sample.

Let D1 and D2 be population 1 and population 2 distributions respectively. The


procedures for the Mann-Whitney 2 independent populations comparison test are:

(a) State the null and alternative hypotheses for two independent populations
test.
One-sided test: H 0 : D1 and D2 are equal versus H1 : D1 has shifted to the
right of D2 [or H 0 : D1 and D2 are equal versus H1 : D1 has shifted to the left
of D2 ].

Two-sided test: H 0 : D1 and D2 are equal versus H 1 : D1 has shifted either


to the left or right of D2 .

Copyright © Open University Malaysia (OUM)


TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)  241

(b) Calculate the test statistics:


n1 ( n1 + 1)
One-sided test: U1 = n1n2 + − W1
2

n2 ( n2 + 1)
[or U 2 = n1n2 + −W ]
2

Two-sided test: U = Minimum (U1 + U 2 )

(c) Find the rejection region (RR):


One-sided test: U1 ≤ Uα /2 [or U 2 ≤ U α /2 ]

Two-sided test: U ≤ U α

U α /2 and Uα values are given in http://www.real-statistics.com/statistics-


tables/mann-whitney-table/.

Let us look at the final example of this topic.

Example 10.9:
To find out whether a new serum will arrest the seriousness of leukaemia, nine
laboratory rats with an advanced stage of the disease are selected. The survival
times (in years), from the time the experiment commenced, are as follows:

Treatment 2.1 5.3 1.4 4.6 0.9

No Treatment 1.9 0.5 2.8 3.1

Determine whether the serum is effective at 0.05 level of significance.

Answer:
Let D1 be the distribution of survival times of rats receiving treatment and D2
as the distribution of survival times for rats not receiving treatment. To determine
the effectiveness of serum treatment, test:
H 0 : D1 = D2 against H1 : D1 > D2

or D1 and D2 are equal or D1 has shifted to the right of D2

Copyright © Open University Malaysia (OUM)


242  TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)

Data showed n1 = 5 and n2 = 4. The observations were arranged in ascending


order and assigned rank 1 until 9 as follows:

Original Data 0.5 0.9 1.4 1.9 2.1 2.8 3.1 4.6 5.3

Rank 1 2 3 4 5 6 7 8 9

Observations who received treatment from sample 1 are underlined. Hence,


 ( 9 )(10 ) 
w1 = 2 + 3 + 5 + 8 + 9 = 27 and w2 =   = 18. If calculation was executed
 2 
by taking the sum of the ranks, a similar answer was obtained,
w2 = 1 + 4 + 6 + 7 = 18.

For a one-sided (right) test, the test statistics is:


n1 ( n1 + 1)
U1 = n1n2 + − w1 = 8.
2

From the Mann-Whitney U Test critical values (see http://www.real-


statistics.com/statistics-tables/mann-whitney-table/), the critical value U with
n1 = 5, n2 = 4 and α = 0.05 for a one-sided test is 2. Since the test statistics value
is not ≤ 2, U1 falls in the acceptance region. In conclusion, do not reject H 0 . The
serum treatment is effective in prolonging the survival times of leukaemia
patients at 0.05 level of significance.

The application of rank-sum test is not limited to non-normal population only. It


can be used to replace the t test when Type II error is large. Recall that Type II error
is the probability of accepting H 0 when H 0 is actually false.

When n13 ≥ 15 and n23 ≥ 15, the sampling distribution of U will approach a normal
distribution with mean and variance,

n1 ( n1 + n2 + 1) n1 ( n1 + 1) n1n2
μU = − =
2 2 2
n n ( n + n + 1)
σ U2 = 1 2 1 2
12

Copyright © Open University Malaysia (OUM)


TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)  243

U − μU
Next, the Z = . statistics which approaches standard normal can be used
σU
to make a decision about the test. Let us do Exercise 10.2 to strengthen your
understanding of this final topic.

EXERCISE 10.2

1. State the test results for the following data:


(a) n1 = 3 n2 = 5 w1 = 8
H 0 : D1 and D2 are equal H1: D1 is on the right of D2

(b) n1 = 6 n2 = 4 w2 = 17
H 0 : D1 and D2 are equal H1: D1 and D2 are unequal

2. In a study on the methods of teaching mathematics for


schoolchildren, the weak students were randomly divided into two
groups. Group 1 comprising seven students was taught problem
solving using the conventional method. Group 2 comprising
10 students was taught problem solving using real problems and
video programmes. At the end of the sessions, all the students were
given a test and the scores are as below:

Group 1 15 21 15 23 17 14 16

Group 2 18 22 24 25 19 24 17 19 23 16

Test at 0.01 level of significance that Group 2 obtained a higher


score in the test. Compare both methods of teaching.

Copyright © Open University Malaysia (OUM)


244  TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)

3. The following data is the number of accidents which occurred at


12 manufacturing factories in a one-week duration before and after
a workplace safety campaign was conducted.

Factory Before After Factory Before After


1 3 2 7 5 3
2 4 1 8 3 3
3 6 3 9 2 0
4 3 5 10 4 3
5 4 4 11 4 1
6 5 2 12 5 2

(a) Does the data support the claim that the campaign is
successful? Test the effectiveness of the campaign at 0.05
significance level.

(b) Repeat the test by using the signed-rank test.

4. In a study, a group was given two bottles of alcoholic drinks and


then was asked to solve a problem. Another group (control group)
was given non-alcoholic drinks and asked to solve the same
problem. The time taken (in minutes) by each individual to solve the
problem was recorded as below.

Control Group Experimental Group


63 70 64 78 74 62 43
57 50 56 77 80 72 57
44 42 41 75 55 66 44

At α = 0.05, can you prove that alcohol intake resulted in longer time
to solve the problem?

Copyright © Open University Malaysia (OUM)


TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)  245

• Before starting the non-parametric analysis to compare two populations, we


need to determine whether both populations are dependent.

• Two populations for comparison are said to be independent when samples taken
from one population is not dependent on or influenced by the samples chosen
from the other population.

• If we can associate or match two populations where the selection of samples


from the second population depends on the selection of samples from the first
population, both are said to be dependent.

• In two-population hypothesis testing using non-parametric statistics, the


populations are compared with reference to the location of population
distributions in general. We will compare population 1 distribution, denoted by
D1 with X1 , X 2 , ..., X n1 , and population 2 distribution, let us say D2 , with
Y1 , Y2 , ..., Yn 2 .

• If comparing two dependent or paired populations, their differences could be


considered as a single population. So, they will be analysed using tests for a
single population such as the sign test and Wilcoxon signed-rank test.

• To compare two independent populations, the Wilcoxon rank test and the
Mann-Whitney test can be used.

Wilcoxon Mann- The Wilcoxon Mann-Whitney test is one of the most


Whitney Test powerful non-parametric tests for comparing two
populations. It was used to test the null hypothesis of two
populations which have identical distribution functions
against the alternative hypothesis of two distribution
functions which differ only with respect to location
(median), if at all.

Wilcoxon Signed The Wilcoxon signed ranks test is designed to test a


Ranks Test hypothesis about the location (median) of a population
distribution. It is another method to compare two paired
samples which uses information not only from the sign but
also on the magnitudes of the differences.
Copyright © Open University Malaysia (OUM)
246  TOPIC 10 HYPOTHESIS TESTING (TWO POPULATIONS)

Freund, J. E. (2003). Mathematical statistics (7th ed.). Upper Saddle River, NJ:
Prentice-Hall, Inc.

Mann, P. S. (2005). Introductory statistics using technology (5th ed.). Upper Saddle
River, NJ: John Wiley & Sons, Inc.

Mendenhall, W., Beaver, R. J., & Beaver, B. M. (2013). Introduction to probability


and statistics (14th ed.). Belmont, CA: Thomson Brooks/Cole.

Walpole, R. E. (2006). Probability and statistics for engineers and scientist


(8th ed.). Upper Saddle River, NJ: Prentice-Hall, Inc.

Copyright © Open University Malaysia (OUM)


ANSWERS  247

Answers
TOPIC 1: COMPARISON OF TWO POPULATION
MEANS

Exercise 1.1
Discuss the solutions in class.

Exercise 1.2
Step 1: The population parameters to be compared and tested are population
means μ A and μB .

Step 2: Both population distributions are assumed normal with both variances
unknown but having the same values.

Step 3: Hypothesis formulation.

The comparison to be made is categorised as “non-directive change”


since the researcher needs only to know whether there exists a mean
difference. Thus, the statement:

“Difference exists” ⇔ Expression: μ A ≠ μ B ,

We write:

H1 : μ A ≠ μB ; and

The complementary, H 0 : μ A = μ B ,

Here, the test is a two-sided test. Adjustment to the hypothesis:

H 0 : μB − μ A = 0 vs. H1 : μB − μ A ≠ 0

Copyright © Open University Malaysia (OUM)


248  ANSWERS

Step 4: Even though the RR is not given, the level of significance α is given as
0.05. Thus, we can calculate the probability p-value or construct the RR
for the case with the following situation:

(a) Population variance σ 12 and σ 22 unknown and σ 12 = σ 22

(b) Both are small samples ( n1 < 30, n2 < 30)

(c) Both random samples 1 and 2 are independent, so test statistics B


follows t distribution with

ν = 24 + 22 – 244 degrees of freedom, and when H 0 is true, the


variance σ B2 will be estimated using the pooled variance:

S B2 =
( n A − 1) S A2 + ( nB − 1) S B2 ( 23) 82 + ( 21) 92
= = 72.11 .
nA + nB − 2 44

RR for the two-sided test is:

RR = {t : t ≤ – 2.0154 } ∪ {t : t ≥ 2.0154}

Step 5: As explained in Step 4, test statistics:

B = X B − X A is a t score where:

XB − XA
T= (1.6)
1 1
SB +
nB nA

follows t distribution with v = 44 degrees of freedom.

Copyright © Open University Malaysia (OUM)


ANSWERS  249

Step 6: The test decision when H 0 is true. Based on the given sample, the value
for score B is given by (1.6) as:

XB − XA 78 − 80
TB = = = −0.7979
1 1
( 72.11)  + 
1 1
SB +
n2 n1  22 24 

Test decision: Since the value TB = 2.0154 > −0.7979 > −2.0154 , then
H 0 is not rejected (accepted).

Step 7: Test conclusion: Sample information does not give enough evidence to
indicate the difference in mean score of groups A and B. The difference
obtained in the sample score is merely by chance.

TOPIC 3: HYPOTHESIS TESTING ON


POPULATION VARIANCE

EXERCISE 3.1
The value 0.831 of figure (a) shows column α = 0.975 with row, v = 5 having
2
significance value χ0.975 (5) = 0.831.

Figure (b) shows that the value 23.68 given in Appendix 3.1 at column α = 0.05
and row, v = 14 which means “point 0.05 at χ 2 (14) distribution is 23.68”,
2
i.e. χ0.05 (14) = 23.68.

Exercise 3.2
Step 1: Determine the Test Parameter
The population parameter to be tested is population variance that is σ 2 .

Step 2: Gather All Information Given


Our results will depend on the sample variance value that is 18.4. We
have a normal population with mean, μ (not given in the test), and
assumed variance to be tested, σ 02 = 42.

Copyright © Open University Malaysia (OUM)


250  ANSWERS

Step 3: Construct Hypothesis Statement


Population variance = 42. One-side (left) test to be performed is:

H0 : σ 2 ≥ 42

H1 : σ 2 < 42

Exercise 3.3
1. For α = 5% = 0.05, 1% = 0.01 and 0.1% = 0.001 refer to the first, third and
fourth rows in the F distribution table for every pair of v1 and v2 . Thus,

(a) F0.05 (3,16) = 3.24 (b) F0.05 (12,25) = 2.16

(c) F0.01 (4,15) = 4.89 (d) F0.01 (7,4) = 49.66

2. Values on the right of the equation represent values in the distribution table.
Thus, determine their values based on suitability/accuracy value in the table
by referring to the intersection of the column and row according to the degrees
of freedom. Hence, we obtained:

(a) Fα (6,14) = 3.50

Since the value 3.50 (at v1 = 6 and v2 = 14) is on the second row,
α = 0.025.

(b) Fα (10,32) = 2.93

Since the value 2.93 (at v1 = 10 and v2 = 32) is on the second row,
α = 0.01.

(c) Fα (24,38) = 1.81

Since the value 1.81 (at v1 = 24 and v2 = 38) is on the second row,
α = 0.05.

Copyright © Open University Malaysia (OUM)


ANSWERS  251

(d) Fα (2,24) = 5.61

Since the value 5.61 (at v1 = 2 and v2 = 24) is on the second row,
α = 0.01.

Exercise 3.4
From the table, we obtain f 0.01,14,11 = 4.30 and f 0.01,11,14 = 3.87 (since α = 0.02).
Hence:

( 3.07 ) 2 (1) < σ 12 < ( 3.07 ) 2 3.87


( )
( 0.8 )2 ( 4.30 ) σ 22 ( 0.8)2

σ 12
that is 3.425 < < 56.991
σ 22

σ 12
This means the assumption that ratio = 1 is not true because the estimation of
σ 22
ratio interval does not contain the value 1.

Exercise 3.5
1. The appropriate hypothesis testing using α = 0.02 to determine whether both
populations have equal variance.

Step 1: Determine the Test Parameter


Population parameters are the first and second population variance,
σ 12 and σ 22 respectively.

Copyright © Open University Malaysia (OUM)


252  ANSWERS

Step 2: Gather All Information Given

Population 1 Population 2
(a) Shape: Normal (a) Shape: Normal
(b) Mean: μ1 (unknown) (b) Mean: μ2 (unknown)
(c) Standard deviation: σ1 (c) Standard deviation: σ 2
(unknown) (unknown)

Step 3: Construct Hypothesis Statement


Choose the appropriate H 1 based on the expressions as in the table
below:

Terms of Expression H1 H0

1. σ 22 is larger than σ12 σ 22 > σ12 σ 22 ≤ σ12

2. σ 22 is smaller than σ12 σ 22 < σ12 σ 22 ≥ σ12

3. σ 22 is different from σ12 σ 22 ≠ σ12 σ 22 = σ12

Is the population variance σ 12 equal to σ 22 (i.e. σ12 / σ 22 = 1) or


σ12 > σ 22 (i.e. σ12 / σ 22 ≠ 1) (refer Table 3.4)

σ12
H 0 : σ12 = σ 22 ⇔ H 0 : =1
σ 22

σ12
H1 : σ12 ≠ σ 22 ⇔ H1 : ≠1
σ 22

Step 4: Determine the Significance Level and Rejection Region (RR)


Perform a two-sided test at α = 0.02 significance level. RR is
either on the right side of the F distribution or on the left side
of the F distribution. From the table in http://www.z-table.com/
f-distribution-table.html, we obtained F0.01,15,24 = 2.89 and
1
F0.99,15,24 = = 0.034. Hence, we will reject H 0 when the
3.29
statistics, F > 2.89 or F < 0.034.
Copyright © Open University Malaysia (OUM)
ANSWERS  253

Step 5: Calculate the Test Statistics

s12 10.6
The test statistics, F = = = 1.45
s22 7.3

Step 6: Test Result


Since the F value fell in the acceptance region, that is 0.034 < 1.45
< 2.89, accept the null hypothesis.

Step 7: Test Conclusion


Hence, there exists a strong evidence to say that σ12 = σ 22 , that is
both population variances are equal.

2. Using properties c(i) and c(ii) of the chi-square distribution

(a) X 1 + X 2 is distributed as χ 2 (1+5) = (6). Hence, E[Y] = 6 and Var[Y] =


2(6) = 12.

(b) X1+X3 is distributed as χ 2 (1+10) = (11). Hence, E[Y] = 11 and Var[Y]


= 2(11) = 22.

3.
2
Use properties c(i) and c(ii). Since X 1 is distributed as N μ1, σ1 , ( )
X1 − μ1 X 2 − μ2
z1 = and z2 = are each distributed as standard normal,
σ1 σ2
N(0,1).

Subsequently from c(i) property,


2 2
Z12 =
( X1 − μ1 ) 2 2
~ χ (1), Z 2 =
( X 2 − μ2 )
~ χ 2 (1) and Z12 + Z 22 ~ χ 2 (2).
2 2
σ1 σ2

Hence, proven that:

 ( X − μ )2 ( X − μ )2 
(
E =  1 2 1 + 2 2 2  = E Z12 + Z 22 = E χ 2 (2) = 2
 σ1 σ2 
) ( )

Copyright © Open University Malaysia (OUM)


254  ANSWERS

4. Using the Appendix 3.1, we obtained:

(a) Value when

(i) χα2 = 19.02 (v = 9)

Observe column α = 0.025 with row v = 9 in the table gives the


value of 19.02. Thus, χα2 = 19.02 (v = 9) is true at α = 0.025.

(ii) χα2 = 24.43 (v = 40)

Observe column α = 0.975 with row 40 in the table gives the value
of 24.43. Thus, χα2 = 24.43 (v = 40) is true at α = 0.975.

(b) Determine the x value if:


2
(i) χ0.005 = x (v = 29)

Let α value = 0.005 with v = 29 degrees of freedom. Find the value


in the Appendix 3.1 that is the intersection between column
α = 0.5 and v = 29. This gives 52.336. Hence, x = 52.336.
2
(ii) χ0.99 = x (v = 4)

Let α value = 0.99 with v = 4 degrees of freedom. Find the value


in the Appendix 3.1 that is the intersection between column
α = 0.5 and v = 4. This gives 0.297. Hence, x = 0.297.

5. Use the following steps to solve this question:

Step 1: Determine the Test Parameter


The test parameter is the population variance.

Step 2: Gather All Information Given


Our results depend on the value from the sample variance that is
12.1. We have a normal population with mean, μ (not given in the
test) and assumed variance to be tested, σ 02 =11.

Copyright © Open University Malaysia (OUM)


ANSWERS  255

Step 3: Construct the Hypothesis Statement


A one-sided (right) test will be performed, that is, (with population
variance = 11):

H 0 : σ 2 = 11

H 1 : σ 2 > 11

Step 4: Determine the Significance Level and Rejection Region (RR)


A one-sided test is performed at 5% level, the chi-square distribution
with n – 1 = 9 – 1 = 8 degrees of freedom. From Appendix 3.1, the
critical value is χ 2 = χ5%
2
(8) = 15.507. We will reject the null
hypothesis if:

χ 2 > χ95%
2
(8)

Step 5: Calculate the Test Statistics


(n − 1)
Test statistics, χ 2 = = 8.8
σ2

Step 6: Test Result


Since χ 2 falls in the acceptance region that is 8.8 < 15.507, accept
H0 .

Step 7: Test Conclusion


Hence, we have strong evidence to say that population variance,
σ 2 = 11.
6. From the data, we obtained:
n
 xi 9.1 + 14.3 + ... + 10.4
i =1
(a) Sample mean, x = = = 10.73
n 15

Sample variance,
n
 ( xi − x )
2

2
s = i =1
=
( 2
9.1 + 10.73) + ... (10.4 − 10.73)
2
= 3.39
n −1 14

Copyright © Open University Malaysia (OUM)


256  ANSWERS

Step 1: Determine the Test Parameter


Population test parameter is population variance that is σ 2 .

Step 2: Gather All Information Given


Our results depend on the value from the sample variance that is
3.39. We have a normal population with mean, μ (not given in the
test) and assumed variance to be tested, σ 2 = 1.9.

Step 3: Construct Hypothesis Statement


Perform a two-sided test, that is:

H 0 : σ 2 = 1.9

H 1 : σ 2 ≠ 1.9

Step 4: Determine the Significance Level and Rejection Region (RR)


A two-sided test is performed at 5% level; the chi-square distribution
has n – 1 = 15 – 1 = 14 degrees of freedom. From Appendix 3.1,
we obtained the critical value χ 2 = χ 2.5% 2
(14) = 26.119 and
2
χ97.5 (14) = 5.629. We will reject the null hypothesis when:

χ 2 < χ97.5%
2
(14) or χ 2 < χ2.5%
2
(14)

Step 5: Calculate the Test Statistics

2 (n − 1)S 2 14 ( 3.39)
Test statistics, χ = 2
= = 24.98
σ 1.9

Step 6: Test Result


Since the test statistics value, χ 2 is in acceptance region that is
5.629 < 24.98 < 26.119, H 0 is accepted.

Step 7: Test Conclusion


Thus, we have strong evidence to say that the sample is distributed
as normal with population variance, σ 2 =1.9.

Copyright © Open University Malaysia (OUM)


ANSWERS  257

(b) Steps 1 and 2 are as in (a).

Step 3: Construct Hypothesis Statement


Conduct a one-sided test, that is:

H 0 : σ 2 = 1.9

H 1 : σ 2 > 1.9

Step 4: Determine the Significance Level and Rejection Region (RR)


A one-sided test is performed at 5% level; chi-square distribution
has n – 1 = 15 – 1 = 14 degrees of freedom. From Appendix 3.1, we
obtained the critical value χ 2 = χ5%
2
(14) = 23.685. We will reject
null hypothesis when:

χ 2 = χ.5%
2
(14)

Step 5: Calculate the Test Statistics

2 (n − 1)S 2 14 ( 3.39)
Test statistics, χ = 2
= = 24.98
σ 1.9

Step 6: Test Result


Since the test statistics value, χ 2 falls in the RR, that is 24.98 >
23.685, reject H 0 .

Step 7: Test Conclusion


Thus, we have strong evidence to say that the sample does not come
from a normal distribution population with population variance,
σ 2 > 1.9 [a different result from (a)].

Copyright © Open University Malaysia (OUM)


258  ANSWERS

7. To determine a smaller product variation between two production channels,


use confidence interval of 2 variance ratios. For 95% confidence interval
σ 12
of , fα /2,21−1,25−1 = f 0.025,20,24 = 2.327 and f 0.025,20,24 = 2.408. Thus, a 95%
σ 22
confidence interval for the ratio is:

1432 1 σ 2 1432
⋅ < 12 < ⋅ 2.408
3761 2.327 σ 2 3761

that is

σ12
0.1636 < 2 < 0.9168
σ2

Since the confidence interval contains values <1, we are confident that 95%
of the channel 1 sequence has smaller variance than the channel 2 sequence,
and therefore should be chosen by the firm.

8. Follow these steps:

Step 1: Determine the Test Parameter


Population parameter is the first and second population variance,
σ 12 and σ 22 respectively.

Step 2: Gather All Given Information

Population 1 Population 2
(a) Shape: Normal (a) Shape: Normal
(b) Mean: μ1 (unknown) (b) Mean: μ2 (unknown)
(c) Standard deviation: σ 1 (c) Standard deviation: σ 2
(unknown) (unknown)

Copyright © Open University Malaysia (OUM)


ANSWERS  259

Step 3: Construct the Hypothesis Statement


The appropriate hypothesis statement for the two-sided test to be
performed is:

σ12
H 0 : σ12 = σ 22 ⇔ H 0 : =1
σ 22

σ12
H 0 : σ12 ≠ σ 22 ⇔ H 0 : ≠1
σ 22

Step 4: Determine the Significance Level and Rejection Region (RR)


A two-sided test is performed at significance level, α = 0.02. RR
is either on the right or left of the F distribution. From the table
in http://www.z-table.com/f-distribution-table.html, we obtained
1 1
F0.01,7,10 = 4.85 and F0.99,15,24 = = = 0.151.
F0.01,10,7 6.62

As such, we will reject H 0 when test statistics value, F > 4.85 or


F < 0.151.

Step 5: Calculate the Test Statistics

s12 12.4
Test statistics, F = 2 = = 0.64
s2 19.3

Step 6: Test Result


Since test statistics value, F, falls in the acceptance region that is
0.151 < 0.64 < 4.85, failed to reject the null hypothesis.

Step 7: Test Conclusion


Thus, we have evidence to conclude that both populations are taken
from a normal population with σ 12 = σ 22 , that is the variances for
both populations are equal.

Copyright © Open University Malaysia (OUM)


260  ANSWERS

9. Calculate the variance values for both samples.


Mean value: x1 = 49.31, variance value : s12 = 177.9

Mean value: x2 = 44.32, variance value: s22 = 62.39

Step 1: Determine Test Parameter


Population parameter is first variance population, σ 12 and second
variance population, σ 22 .

Step 2: Gather All Given Information

Population 1 Population 2
(a) Shape: Normal (a) Shape: Normal
(b) Mean: μ1 (unknown) (b) Mean: μ2 (unknown)
(c) Standard deviation: σ 1 (c) Standard deviation: σ 2
(unknown) (unknown)

Step 3: Construct the Hypothesis Statement


Conduct a one-sided (right) test, that is:

σ 12
H 0 : σ 12 = σ 12 ⇔ H0 2 = 1
σ2

σ 12
H1 : σ 12 > σ 12 ⇔ H1 >1
σ 22

Step 4: Determine the Significance Level and Rejection Region (RR)


A one-sided (right) test is performed at α = 0.01 significance
level. The RR is either on the right or left of the F distribution.
From the table in http://www.z-table.com/f-distribution-table.html,
we obtained F0.01,9,9 = 5.35. Hence, we will reject H 0 when test
statistics value F > 5.35.

Copyright © Open University Malaysia (OUM)


ANSWERS  261

Step 5: Calculate the Test Statistics

s12 177.9
Test statistics, F = = = 2.85
s22 62.39

Step 6: Test Results


Since test statistics value, F, falls in the acceptance region, that is
2.85 < 5.35, we failed to reject the null hypothesis.

Step 7: Test Conclusion


Hence, we have evidence to conclude that both populations are taken
from a normal population with σ 12 = σ 22 , that is, the variances for
both populations are equal.

TOPIC 4: ANALYSIS OF VARIANCE (ANOVA)

Exercise 4.1

Data 1 Data 2

From the two figures, both data sets illustrate changes between and within samples
for the variables. In Data 1, changes between samples are larger than changes within
samples.

Copyright © Open University Malaysia (OUM)


262  ANSWERS

However, Data 2 shows that changes between samples is not much different from
changes within samples.

Thus, significance tests must be performed. A statistical test used to examine the
equality in population mean should be able to differentiate the between and within
samples variations. Thus, we need to calculate the between and within samples
variations.

Exercise 4.2
The following result is obtained:

1 2 3 4
65 75 59 94
87 69 78 89
73 83 67 80
79 81 62 88
81 72 83
69 79 76
90
Total 454 549 425 351
The Number of Students 6 7 6 4
Average 75.67 78.43 70.83 87.75

4 nj

 xij 65 + 75 + ... + 88 1,779


i =1 j =1
x= = = = 77.35
n 23 23

Copyright © Open University Malaysia (OUM)


ANSWERS  263

Sum of squares of deviation,


4 nj

(
=  xi , j − x )
i =1 j =1
2 2 2
= ( 65 − 77.35 ) + ( 75 − 77.35 ) + ... + ( 88 − 77.35 )
= 1,909.2

Sum of squares due to treatments (between student groups)

( )
2
=  nj xj − x

= 6 ( 75.67 − 77.35 ) + 7 ( 78.46 − 77.35 ) + 6 ( 70.83 − 77.35 ) + 4 ( 87.75 − 77.35 )


2 2 2 2

= 712.6

Sum of squares due to errors (within groups)

= (n1 − 1) s12 + (n2 − 1) s 22 + (n3 − 1) s32


= SS T − SS (Tr ) = (n1 − 1) s12 + (n2 − 1) s 22 + (n3 − 1) s32
= 1196.6

Thus, the mean squares treatments and errors are:

MS(Tr ) = SS(Tr ) / k − 1 = 712.6 / 3 = 237.5


MSE = SSE / n − k = 1196.6 /19 = 63.0

Exercise 4.3
In an ANOVA test, the critical area is determined by α, the degrees of freedom for
treatments and degrees of freedom for errors. Steps 2 and 3 (in Subtopic 4.2.1) need
to be understood prior to getting the critical value.

Copyright © Open University Malaysia (OUM)


264  ANSWERS

Exercise 4.4
1. The relevant factors are classes with factor levels or type of class that the
students are in.

Step 1: Determine Null and Alternative Hypothesis

H0 : μ1 = μ2 = μ3 (no difference in means for the 3 factor levels).

H1 : Not all populations has equal mean.

Step 2: Choose the Significance Level


Significance level, α = 0.05.

Step 3: Determine the Rejection Region

(a) The degrees of freedom for treatment, v1 = k – 1 = 3 – 1 = 2.

(b) The degrees of freedom for errors, v2 = N – k = 12 – 3 = 9.

Determine the critical value that is F2,9,0.05 = 4.256 (obtained from


F distribution table, see http://www.z-table.com/f-distribution-
table.html). Reject H 0 if F > 4.256.

Step 4: Calculate Test Statistics


MS (Tr ) SS (Tr ) /(k − 1) 64586.17 / 2
F= = = = 2.683
MS E SS E /( N − k ) 1083335.5 / 9

Step 5: Test Results


Since F = 2.683 < 4.256, fail to reject H 0 .

Step 6: Test Conclusion


We have strong evidence to say that the mean time spent watching
television among students is equal. The teacher’s claim is true.

Copyright © Open University Malaysia (OUM)


ANSWERS  265

2. The population under consideration must be distributed as normal with equal


variance, and every sample chosen is independent and randomly selected.

3. The null hypothesis: No difference in means for all populations; μ1 = μ2 = ....μk,


with k = Number of groups.

Alternative hypothesis: At least one group has a different mean.

4. We obtained:

(a) The critical value for ANOVA test at α = 0.01 when there are six
samples with 34 items in each sample is F5,28,0.01=3.75. This comes from
α = 0.01, the degrees of freedom for numerator = k – 1 = 6 – 1 = 5 and
the degrees of freedom for denominator = N – k = 34 – 6 = 28.

(b) The critical value for ANOVA test at α = 0.05 when there are four
samples with 44 observations is = 2.84. This comes from α = 0.05, the
degrees of freedom for numerator = k – 1 = 4 – 1 = 3 and the degrees of
freedom for denominator = N – k = 44 – 4 = 40.

5. We obtained:

(a) When MS E = 14.6 and MS(Tr ) = 35.7,

MS (Tr ) 35.7
F= = = 2.45
MS E 14.6

(b) When MS E =73.81 and MS(Tr ) = 215.23,

MS (Tr ) 215.23
F= = = 2.92
MS E 73.81

6. The relevant factor is the socio-economic status and the factor level is socio-
economic level.

Step 1: Determine Null and Alternative Hypotheses

H0 : μ1 = μ2 = μ3 (no difference in means for factor levels).


H1 : Not all populations have equal mean.

Copyright © Open University Malaysia (OUM)


266  ANSWERS

Step 2: Choose Significance Level


The chosen significance level is α = 0.01.

Step 3: Determine the Rejection Region (RR)

(a) The degrees of freedom for treatment, v1 = k – 1 = 3 – 1 = 2.

(b) The degrees of freedom for errors, v2 = N – k = 17 – 3 = 14.

Determine the critical value that is F2,14,0.01 = 6.515 (obtained from


the F distribution table, see http://www.z-table.com/f-distribution-
table.html). Reject H 0 when F > 6.515.

Step 4: Calculate Test Statistics


MS (Tr ) SS (Tr ) /(k − 1) 15.529 / 2
F= = = = 0.3418
MS E SS E /( N − k ) 318 / 14

Step 5: Test Results


Since the test statistics value, F = 0.3418 < 6.515, accept H 0 .

Step 6: Test Conclusion


We have strong evidence to say that mean aptitude test among
students is the same regardless of their family’s socio-economic
status. The study’s claim is true.

TOPIC 5: CHI-SQUARED TESTS

Exercise 5.1
Step 1: Construct Appropriate Hypothesis Statement

H 0 : Attendance record is uniform every day ⇔ H 0 : Absenteeism is the


same every day, that is, 10 people daily.

H1 : Otherwise.

Copyright © Open University Malaysia (OUM)


ANSWERS  267

Step 2: Determine the Significance Level and Rejection Region (RR)


Test is performed at 1% level, hence, reject H 0 if test statistics
(O − E ) 2
X = > χ 12% (5) = 15.086 with v = Number of row – 1 = 6 – 1
E
= 5 degrees of freedom.

Step 3: Calculate the Test Statistics


6 (O j − E j ) 2
Test statistics is calculated as X =  that is distributed as χ 2
Ej
j =1

with v = 5 degrees of freedom. The following table contains the required


information.

Observed Expected (O − E ) 2
Day
Frequency, O Frequency, E
O–E  E
Monday 12 10 2 0.4
Tuesday 9 10 –1 0.1
Wednesday 11 10 1 0.1
Thursday 10 10 0 0
Friday 9 10 –1 0.1
Saturday 9 10 –1 0.1
Total 60 60 0.8

(O − E ) 2
Thus, we obtained X =  = 0.8.
E

Step 4: Test Results


Since the test statistics value, X = 0.8 < 15.086, fail to reject H 0 .

Step 5: Test Conclusion


Hence, it is proven that staff absenteeism is uniformly distributed every
week.

Copyright © Open University Malaysia (OUM)


268  ANSWERS

Exercise 5.2
1. Solve the question using the following steps:

Step 1: Construct Appropriate Hypothesis Statement


H0 : Frequencies follow a binomial distribution.

x 3.32
⇔ H 0 : X  b ( 5, p ) where p = = = 0.664
n 5
H1 : Otherwise.

Step 2: Calculate the Test Statistics


Using n = 5 and p = 0.664, we can generate a binomial distribution
following a theory, that is, X (which represents the number of events
n
in an experiment) ~ Bin(5, 0.664) that is Pr ( X = x ) =   p x
 x
n n− x
and Pr ( X = x ) =   p x (1 − p ) and we obtained the following
 x
table (Expectation = Pr(X = x) multiplied with  f ):

X 0 1 2 3 4 5 or 6
Expectation 0.4 4.2 16.7 33.1 32.7 12.9

Since the first two frequencies are less than 5 (X = 0 and 1), both are
combined together at X = 2 resulting in frequency value 21 (that is
0.4 + 4.2 + 16.7). Thus, combining the observed and expected
frequencies for subsequent analysis in the following table:

X ≤2 3 4 5 Total
Observed 21 33 31 15 100
Expected 21.3 33.1 32.7 12.9 100

and

X=
( 21 − 21.3) ( 33 − 33.1) ( 31 − 32.7 ) (15 − 12.9 )
2
+
2
+
2
+
2
= 0.43
21.3 33.1 32.7 12.9

Copyright © Open University Malaysia (OUM)


ANSWERS  269

Step 3: Determine the Significance Level and Rejection Region (RR)


There are two restrictions that are estimation of p and mean. Thus,
there is 4 – 2 = 2 degrees of freedom. Hence, the critical value for
2
this test is x5% (1) = 3.84 (refer to Appendix 3.1). Reject H 0 when
2
test statistics, X > x5% ( 2 ) = 3.84.
Step 4: Test Result
2
Since xtest 2
= 0.43 < x5% ( 2 ) = 5.99, fail to reject H 0 .
Step 5: Test Conclusion
There is no strong evidence to reject the null hypothesis. Hence,
it is obvious that the frequency distribution follows a binomial
distribution.

2. Solve the question using the following steps:

Step 1: Construct Appropriate Hypothesis Statement


H0 : Frequencies follow a Poisson distribution.
 396
⇔ H 0 : X ~ Pr (λ ) where λ = x = = 1.2
330
H1 : Otherwise.

Step 2: Calculate the Test Statistics


Using this mean value, we are able to calculate
e−λ λ x
f ( x ) = Pr( X = x) = where λˆ = x . Alternatively, we may use
x!
μ
the formula f ( r + 1) = f ( r ) to calculate Pr(X = x). Using the
r +1
formula, the mean result and combining several observed
frequencies data, we obtained following table:

X 0 1 2 3 4 or more Total
Observed 102 114 74 28 12 330
Expected 99.39 119.27 71.56 28.63 8.59 330

Copyright © Open University Malaysia (OUM)


270  ANSWERS

Hence, we obtained:

X=
 (O − E )2 = (102 − 99.39)2 + ... + (12 − 8.59)2 = 0.46
E 99.39 8.59

Step 3: Determine the Significance Level and Rejection Region (RR)


Since there are 5 pairs of frequencies with 2 restrictions, we have
5 – 2 = 3 degrees of freedom. Thus, the critical value for the test is
2
x5% ( 3) = 7.81. Reject H 0 when test statistics X > x5%
2
( 3) = 7.81.
Step 4: Test Result
2
Since X = 0.46 < x5% = 7.81, accept H 0 .

Step 5: Test Conclusion


This means we have a strong evidence to accept H 0 and conclude
that Poisson distribution gives the best fit.

3. Solve the question using the following steps:

Step 1: Construct Appropriate Hypothesis Statement


H0 : Frequencies follows a normal distribution.

( )
⇔ H0 : X  N μ , σ 2 yang x = μˆ = 134.356 dan s = σˆ = 6.195

H1 : Otherwise.

Step 2: Calculate The Test Statistics


Calculate x = μ̂ = 79.72 and s = σ̂ = 15.60. To calculate the
observed frequencies under the assumption of normal distribution
using the information on observed values, the following table is
obtained:

Copyright © Open University Malaysia (OUM)


ANSWERS  271

Upper Class x − 79.72 Expected Observed


Z= Pr(Z < z) p
Limit 15.60 Values Values

59.95 –1.26730769 0.102 0.102 6.63 8


69.95 –0.62628205 0.2643 0.1623 10.5495 10
79.95 0.01474359 0.504 0.2397 15.5805 16
89.95 0.655769231 0.745 0.241 15.665 14
99.95 1.296794872 0.9032 0.1582 10.283 10
109.95 1.937820513 0.9738 0.0706 4.589 5
119.95 2.578846154 0.995 0.0212 1.378 2

Thus,

X =
 (O − E )2 = (8 − 6.63)2 + (10 − 10.55)2 + ... + (2 − 138)2 = 0.83
E 6.63 10.55 1.38

Step 3: Determine the Significance Level and Rejection Region (RR)


There are 7 true cells with 3 restrictions that are mean, standard
deviation and total giving v = 7 – 3 = 4 degrees of freedom. Thus,
2
x5% ( 4 ) = 9.488. Reject H 0 when test statistics X < x5%
2
= 9.4888.

Step 4: Test Result


2
Since X = 0.83 < x5% = 9.4888, accept H 0 .

Step 5: Test Conclusion


Thus, we have strong evidence to accept H 0 and the assumption
that observation data follows a normal distribution is true.

Copyright © Open University Malaysia (OUM)


272  ANSWERS

Exercise 5.3
L   Bi 
Using the formula for expected frequencies as Eij = N  j   ,
N  N 

we obtained the following results:

Type of Car
Age
Local-made Import Total
>30 110 *99 110 *101 110
= 54.45 = 55.55
200 200
30 and above 90 * 99 90 *101 90
= 44.55 = 45.45
200 200
Total 99 101 200

Exercise 5.4
Step 1: Construct Appropriate Hypothesis Statement

H 0 : Both variables are independent ⇔ H 0 : There is no relationship


between the interest on type of car and age level.

H1 : Both variables are dependent.

Step 2: Determine the Significance Level and Rejection Region (RR)


Significance level usually used is α = 0.05.

We have r: Number of levels/ factor for age variable (2 counts)


c: Number of levels/ factor for interest on car type (2 counts)

Thus, v = (2 – 1) × (2 – 1) = 1
2
Since v = 1 degrees of freedom, χ 0.05 = 3.841.

Copyright © Open University Malaysia (OUM)


ANSWERS  273

Step 3: Calculate the Test Statistics

(a) The following table gives the expected frequency (and observed
frequency data):

Type of Car
Age
Local Made Import Total
>30 68 42 110
(54.45) (55.55)
30 and above 31 42 90
(44.55) (45.45
Total 99 101 200

(b) Next, calculate the chi square test statistics, that is

X =
 (O − E ) 2 .
E

From the table, we obtained the following result:

X=
( 68 − 54.45 ) ( 42 − 55.55)
2
+
2
+ +
( 59 − 45.45 )
2
= 14.84
54.45 55.55 45.45

Step 4: Test Result


Since X = 14.84 > 3.841, reject H 0 .

Step 5: Test Conclusion


We are able to say there is no strong evidence to accept H 0 , that is,
both variables are dependent. This means, the preference on type of
car depends on one’s age.

Copyright © Open University Malaysia (OUM)


274  ANSWERS

Exercise 5.5
The information can be summarised in the table below:

Type of Favourite Sport


Students
Football Basketball Baseball Tennis
Male 33 38 24 5
Female 38 21 15 26

The variables classified are the tendency/interest on type of sport. Populations are
male and female students. The testing method follows several steps:

Step 1: Determine the Hypothesis Test


H0 : Distribution of sport favoured is similar among male and female
students.
H1 : Otherwise.

Step 2: Determine Significance Level and Rejection Region (RR)


Choose the significance level, α = 0.05 or α = 0.01. Since there are two
rows and four columns, the degrees of freedom obtained is v = (2 – 1)
(4 – 1) = 3. Using this degrees of freedom value, we will get the chi-square
2
value from the distribution table at α = 5% level as x0.05, α . Reject H 0
2
when the test statistics value, X > x0.05,α.

Step 3: Calculate the Test Statistics


(a) Construct the table of expected frequency.
(b) Calculate the test statistics value.

Step 4: Test Result


Test result depends on results in 2 and 3.

Step 5: Test Conclusion


Test conclusion depends on results in 4.

Copyright © Open University Malaysia (OUM)


ANSWERS  275

Exercise 5.6
1. Solve the question using the following steps:

Step 1: Construct the Appropriate Hypothesis Statement

H 0 : There is no difference in colour-blindness level according to


gender.

H1 : Otherwise.

Step 2: Determine Significance Level and Rejection Region (RR)


Since there are two rows and two columns, the degrees of freedom
obtained is v = (2 – 1)(2 – 1) = 1. Using this degrees of freedom
value, we will get chi-square value from the distribution table (at
2
α level = 5%) as x5% (1) = 3.84. Reject H 0 when the test statistics
2
value, X > x5% (1) .
Step 3: Calculate the Test Statistics

(a) The following table gives the expected frequency (and


observed frequency data):

Colour Blindness
Category
Normal Colour Blind Total
2,210 190
Male
Factor II (2,280) (120) 2,400
2,540 60
Female
(2,470) (130) 2,600
Total 4,750 250 5,000

(Numbers in brackets are the expected frequencies)

Copyright © Open University Malaysia (OUM)


276  ANSWERS

(b) Thus,

( 2, 210 − 2, 280 − 0.5)2 ( 60 − 130 − 0.5)2


X cc = + ... + = 82.66
2, 280 130

Step 4: Test Result


2
Since X cc > x5% (1) = 3.84, we have evidence to reject H0.
Step 5: Test Conclusion
There is valid evidence to show there exist differences in colour-
blindness level according to gender.

2. Solve the question using the following steps:

Step 1: Construct the Appropriate Hypothesis Statement

H 0 : The distribution of book loan is uniform ⇔ H 0 : The number


of books borrowed is the same every day, that is, 258 books.

H 0 : Otherwise.

Step 2: Determine the Significance Level and Rejection Region (RR)


Perform test at 1%, level, hence reject H 0 if test statistics

X=
 (O − E ) 2
> χ21% (5) = 15.086 with v = Number of days – 1 =
E
6 – 1 = 5 degrees of freedom.

Step 3: Calculate the Test Statistics


6 (O j − E j )2
Test statistics calculated as X =  which is distributed
j =1 Ej
2
as x . with v = 5 degrees of freedom. The following table contains
the information needed.

Copyright © Open University Malaysia (OUM)


ANSWERS  277

Observed Expected (O − E ) 2
Day O–E X =
Frequency, O Frequency, E E
Monday 204 258 –54 11.3023
Tuesday 292 258 34 4.4806
Wednesday 242 258 –16 0.9923
Thursday 283 258 25 2.4225
Friday 252 258 –6 0.1395
Saturday 275 258 17 1.1202
Total 1548 258 7 20.457

 (O − E )
2
Thus X = = 20.45
E

Step 4: Test Results


Since test statistics value X = 20.457 > 15.086, reject H 0 .

Step 5: Test Conclusion


It can be proved that the number of books borrowed from the library
is not the same every day. Thus, we have enough evidence to say
that the distribution of book loan is not uniform.

3. It is known that,

X: The number of goals obtained in a match by a team.

Thus,

{X = 0} no goal is obtained in a match by a team.

λ: Mean/average goals per team per match

Thus, λ̂ = Total number of goals made/(2 × Number of matches)


3.0 + 5.1 +  + 1.7 + 0.8
=
2 × 20
105
=
40

Copyright © Open University Malaysia (OUM)


278  ANSWERS

Step 1: Construct Appropriate Test Hypothesis

H 0 : Frequencies follow a Poisson distribution ⇔ H 0 : X ~ Pr(λ )


 105
where λ = x = = 2.625
40
H1 : Otherwise

Step 2: Calculate the Test Statistics


Using this mean value, we can calculate f (x) = Pr(X = x)
e−λ λ x
= where λˆ = x . However, we can also use the formula
x!
λ
f ( x + 1) = f ( x ) to calculate Pr(X = x). Using the formula and
x +1
mean result, we will get the following table:

Number of
0 1 2 3 4 5 6 7 8
Goals, X
Number of
Expected 2.883 7.583 9.971 8.741 5.747 3.023 1.325 0.498 0.164
Team

Since the number of expected team scoring X = 0, 1 and X = 5, 6, 7 and 8 goals


are less than 5, we need to combine the total expected teams according to the
number of goals. The results are displayed in the following table:

X <1 2 3 4 5 or More Total


Observed 8 14 9 3 6 40
Expected 10.466 9.97 8.74 5.75 5.01 40

Thus, we get:

 (O − E )2 ( 8 − 10.4666 ) ( 6 − 5.01)
2 2
X= = + + = 3.73
E 10.466 5.01

Copyright © Open University Malaysia (OUM)


ANSWERS  279

Step 3: Determine Significance Level and Rejection Region (RR)


Since there are 5 pairs of frequencies with 2 restrictions, there
are 5 – 2 = 3 degrees of freedom. Thus, the critical value for
2
the test is x5% ( 3) = 7.81. Reject H 0 when the test statistics
2
X > x5% ( 3) = 7.81.
Step 4: Test Result
2
Since X = 3.73 < x5% ( 3) = 7.81, we accept H 0 .
Step 5: Test Conclusion
This means there is strong evidence to accept H 0 and state that the
Poisson distribution is the best fit.

4. Solve the question using the following steps:

Step 1: Construct Appropriate Test Hypothesis

H 0 : Frequencies follow a binomial distribution ⇔ H 0 : X ~ b


(5,0.3)

H1 : Otherwise.

Step 2: Calculate the Test Statistics


Using n = 5 and p = 0.3, binomial distribution can be generated using
the theory that X (which represents the number of events in the
n
experiment) ~ Bin (5, 0.3) that is Pr ( X = x) =   p x (1 − p)n− x and
 x
we obtain the following table (expected = Pr(X = x) multiplied with
 f ):

X 0 1 2 3 Total
Observed 22 37 20 21 100
Expected 16.807 36.015 30.87 16.31 100

Copyright © Open University Malaysia (OUM)


280  ANSWERS

and

X=
( 22 − 16.807 )2 + ( 37 − 36.015 )2 + ( 20 − 30.87 )2 + ( 21 − 16.31)2
16.807 36.015 30.87 16.31
= 6.81

Step 3: Determine Significance Level and Rejection Region (RR)


There is no restriction, thus 4 – 0 = 4 degrees of freedom. Hence, the
2
critical value for this test is x5% ( 4 ) = 9.49. Reject H 0 when test
2
statistics, X > x5% ( 4 ) = 9.49.
Step 4: Test Result
2
Since X = 6.81 < x5% ( 4 ) = 9.49, accept H 0 .
Step 5: Test Conclusion
Thus, there is no strong evidence to reject the null hypothesis. It is
clear that the frequency distribution follows a binomial distribution.

5. Solve the question using the following steps:

Step 1: Construct Appropriate Test Hypothesis

H 0 : Frequencies follow a normal distribution ⇔ H 0 : X ~ N


(13.3,42).

H1 : Otherwise.

To calculate the observed frequency, we use the assumption that the


observations are distributed as normal, hence, the table is obtained:

Copyright © Open University Malaysia (OUM)


ANSWERS  281

Upper Class x − 79.72


Z= Pr(Z < z) p Expected Observed
Limit 15.60
7.9995 –1.47 0.0708 0.0708 15.505 16
9.9995 –0.88 0.189 0.1182 25.886 21
11.9995 –0.29 0.3859 0.1969 43.121 38
13.9995 0.29 0.6141 0.2282 49.976 50
15.9995 0.88 0.8106 0.1965 43.034 48
17.9995 1.47 0.9292 0.1186 25.973 36
– – 1 0.0708 15.505 10

Thus,
2
 (O − E ) (16 − 15.505) 2 (21 − 25.886) 2 (10 − 15.505) 2
X = = + + ... + = 7.945
E 15.505 25.886 15.505

Step 3: Determine the Significance Level and Rejection Region (RR)


2
There are 7 cells with 0 restrictions. Thus, x5% ( 7 ) = 14.067. Reject
2
H 0 when test statistics X < x5% ( 7 ) = 14.067.
Step 4: Statistical Test Result
2
Since X = 7.945 < x5% ( 7 ) = 14.067, accept H 0 .
Step 5: Test Conclusion
Thus, there is strong evidence to accept H 0 and the normal
assumption on observed data is true.

6. Solve the question using the following steps:

Step 1: Determine the Null and Alternative Hypothesis

H 0 : Both variables are independent ⇔ H 0 : The average grade


level does not have any association with year of study.

H 0 : Both variables are dependent.

Copyright © Open University Malaysia (OUM)


282  ANSWERS

Step 2: Determine Significance Level and Rejection Region (RR)


Significance level used is α = 0.05.

From the information given:

r: Number of levels for grade point average factor (there are 3)


c: Number of levels for year of study factor (there are 3)

Thus, v = (3 – 1) × (3 – 1) = 4
2
Since there are v = 1 degrees of freedom, we have x0.05 = 9.488

Step 3: Calculate Test Statistics

(a) Given the expected frequency data (which is also observed


frequency data) as follows:

Table of observed and expected data:

Year of Study
Average Grade Value
Year 1 Year 2 Year 3 Total
14 16 15
< 2.0 45
(15) (15) (15)
10 11 11
2.0–3.0 32
(10.67) (10.67) (10.67)
26 23 24
> 3.0 73
(24.33) (24.33) (24.33)
Total 50 50 50 150

(Numbers in brackets are expected frequencies)

Then, calculate the chi square value, which is X = 


(O − E ) 2
(b)
E

From the table, we obtained the following result:

X=
(14 − 15 ) (16 − 15 )
2
+
2
++
( 24 − 24.33)
2
= 0.39
15 15 24.33

Copyright © Open University Malaysia (OUM)


ANSWERS  283

Step 4: Test Result


Since X= 0.39 < 9.488, accept H 0 .

Step 5: Test Conclusion


We can state there is no strong evidence to reject H0 and conclude
that both variables are independent. This means the average of grade
value results obtained by students does not depend on the year of
study.

7. Solve the problem using the following steps:

Step 1: Determine the Null and Alternative Hypothesis

H 0 : The proportion of three populations is equal for each category.

H1 : Otherwise.

Step 2: Determine the Significance Level and Rejection Region (RR)


Since there are three rows and four columns, the degree of freedom
obtained is v = (3 – 1)(4 – 1) = 4. Using this degree of freedom, we
will get the value of chi square distribution table (at α = 1% level)
as x0.01,4
2
= 13.277. Reject H 0 when the test statistics value,
2
X > x0.01,4 .

Step 3: Calculate Test Statistics

(a) Given the expected frequency data (which is also observed


frequency data) is as follows:

Category
1 2 3 4 Total
1 16 (19.67) 38 (38.33) 5 (10.67) 41 (31.33) 100
Population 2 24 (19.67) 41 (38.33) 12 (10.67) 23 (31.33) 100
3 19 (19.67) 36 (38.33) 15 (10.67) 30 (31.33) 100

Copyright © Open University Malaysia (OUM)


284  ANSWERS

(b) Hence, we can calculate the value of test statistics and obtain:

X=
(16 − 19.67 ) ( 38 − 38.33)
2
+
2
+ +
( 30 − 31.33)
2
= 12.184
19.67 38.33 31.33

Step 4: Test Result


Since X = 12.184 < 13.277, accept H 0 .

Step 5: Test Conclusion


Thus, it can be concluded that the proportion of all three populations
is equal for each category.

8. Solve the problem using the following steps:

Step 1: Determine the Null and Alternative Hypothesis

H 0 : There is no difference between male and female opinions.

H1 : Otherwise.

Step 2: Determine the Significance Level and Rejection Region (RR)


Since there are two rows and two columns, the degree of freedom
obtained is v = (2 – 1)(2 – 1) = 1 Using this degree of freedom, we
will get the value of chi square distribution table (at level α = 1%)
as x1%2
(1) = 6.635. Reject H 0 when the test statistics value,
2
X > x1% (1) .
Step 3: Calculate Test Statistics

(a) Let the expected frequency data (which is also observed


frequency data) as follows:

Opinion on Helmet Usage


Gender
Agree Disagree
Male 32 (21.5) 11 (21.5)
Female 68 (78.5) 89 (78.5)

Copyright © Open University Malaysia (OUM)


ANSWERS  285

(b) Thus,

( 32 − 21.5 − 0.5)2 ( 89 − 78.5 − 0.5)2


X cc = + ... + = 11.85
21.5 78.5

Step 4: Test Result


2
Since X cc > x1% (1) = 6.635, we have evidence to reject H 0 .
Step 5: Test Conclusion
This shows clearly that there exists difference in opinions on the
usage of helmets in campus among male and female students.

TOPIC 6: CORRELATION

Exercise 6.1
(a) 1, +
(b) 2, +
(c) 2, –

Exercise 6.2

xi yi xi yi xi2 yi2

1 2 2 1 4
2 3 6 4 9
4 4 16 16 16
5 7 35 25 49
6 12 72 36 144
8 10 80 64 100
10 7 70 100 49
Total 36 45 281 246 371

Copyright © Open University Malaysia (OUM)


286  ANSWERS

n  xi yi − (  xi )(  yi )
rp =
( n x − (  x ) ) ( n y − (  y ) )
2
i i
2 2
i i
2

7 ( 281) − ( 36 )( 45 )
=
( 7 ( 246) − (36) ) ( 7 (371) − ( 45) )
2 2

= 0.703

The Pearson correlation coefficient value 0.703 shows a strong positive linear
relationship between the frequency of fertiliser usage and crop yields. This means
the more frequent the farmer distributes the fertiliser, the higher the amount of crop
yield produced.

Exercise 6.3
A one-sided hypothesis test (since the Pearson correlation coefficient value is
positive) is as follows:

H0 : ρp = 0

H1 : ρp > 0

n−2
Test statistics : T = rp
1 − rp2
7−2
= 0.703 2
1 − ( 0.703)
= 2.21

Test results : T follows a t distribution with v = 7 – 2 = 5 degrees of freedom


and 0.01 significance level.

Reject H 0 when

T > t0.01,5 = 3.365

Copyright © Open University Malaysia (OUM)


ANSWERS  287

Since the test statistics T < 3.365, we cannot reject the null hypothesis. This means
we do not have enough evidence to say that the Pearson correlation coefficient value
is not zero, that there does not exist any significant relationship between the
frequency of fertiliser distribution with crop yield at 1% significance level.

Exercise 6.4
6 Di2
rs = 1 −
(
n n2 − 1 )
6 ( 74 )
= 1−
(
10 (10 ) − 1
2
)
= 0.5515

The Spearman correlation coefficient value 0.5515 shows there exists a strong
positive linear relationship between athletes’ ranking and their position in a match.

Exercise 6.5
A one-sided hypothesis test (since the Spearman correlation coefficient value is
positive) is as follows:

H0 : ρs = 0

H1 : ρs > 0

n−2
Test statistics : T = rs
1 − rs2
10 − 2
= 0.5515
1 − ( 0.5515 )
2

= 1.87

Copyright © Open University Malaysia (OUM)


288  ANSWERS

Test results : T follows a t distribution with v = 10 – 2 = 8 degrees of


freedom and 0.01 significance level.

Reject H 0 when

T > t0.01,8 = 2.896

Since the test statistics T < 2.896, we cannot reject the null hypothesis. This means
there is not enough evidence to say there exists a significant relationship between
athlete ranking and their position in a match at 1% significance level.

TOPIC 7: SIMPLE LINEAR REGRESSION

Exercise 7.1
x y yˆ = − 12.84 + 36.18 x ∈ = y − yˆ
8.3 227 287.454 –60.454
8.3 312 287.454 24.546
12.1 362 424.938 –62.938
12.1 521 424.938 96.062
17.0 640 602.22 37.78
47.0 539 1,687.62 –1,148.62
17.0 728 602.22 125.78
24.3 945 866.334 78.666
24.3 738 866.334 –128.334
24.3 759 866.334 –107.334
33.6 1,263 1,202.81 60.192

Copyright © Open University Malaysia (OUM)


ANSWERS  289

Exercise 7.2
x y xy x2 y2
60 63.6 3,816.0 3,600 4,044.96
62 65.2 4,042.4 3,844 4,251.04
64 66.0 4,224.0 4,096 4,356.00
65 65.5 4,257.5 4,225 4,290.25
66 66.9 4,415.4 4,356 4,475.61
67 67.1 4,495.7 4,489 4,502.41
68 67.4 4,583.2 4,624 4,542.76
70 68.3 4,781.0 4,900 4,664.89
72 70.1 5,047.2 5,184 4,914.01
74 70.0 5,180.0 5,476 4,900.00
Total 668.0 670.1 4,4842.4 4,4794 4,4941.90

From the table, we need to calculate the x and y values first, that is:

x=
 xi = 668.0 = 66.8 dan y=
 yi = 670.1 = 67.01
n 10 n 10

Now, we can get the β̂1 regression coefficient using the following formula:
n
 xi yi − nxy 44,842.4 − 10 ( 66.8 )( 67.01)
βˆi = i =1
= = 0.465
44,794 − 10 ( 66.8 )
n 2
 xi2 − nx 2

i =1

and next, we can get the β̂ 0 regression coefficient:

βˆ0 = y − βˆ1 x = 67.01 − 0.465 ( 66.8) = 35.95

Hence, the simple linear regression model is ŷ =35.95 + 0.465x

β̂1 = 0.465 shows that the y value will increase by 0.465 for each one unit increase
in x. βˆ0 = 35.95 refers to the y value when the x value is zero.

Copyright © Open University Malaysia (OUM)


290  ANSWERS

Exercise 7.3
(a) The hypothesis test (one-sided test since β̂1 value is positive):

H0 : β1 = 0

H1 : β1 > 0

βˆ1 0.465
Test statistics : T = = = 14.085
s ( βˆ1 ) 0.033

Test results : T follows a t distribution with v = 10 – 2 = 8 degrees


of freedom and 0.05 significance level.

Reject H 0 when
T > t0.05,8 = 1.86
s( β̂1 ) is the standard deviation for β̂1 sampling distribution. The formula to
get the standard deviation for β̂1 is:

 yi2 − βˆ0  yi −βˆ1  xi yi


( )
s βˆ1 = n−2
 xi2 − nx 2
44,941.9 − 35.95 ( 670.1) − 0.465 ( 44,842.4 )
= 10 − 2
44,794 − 10 ( 66.8 )
2

= 0.033

Since the test statistics T > t0.05,8 = 1.86, we reject the null hypothesis. We
have enough evidence to say that β1 value is not zero but positive.

Copyright © Open University Malaysia (OUM)


ANSWERS  291

(b) The 99% confidence interval for β1 is as follows (with α = 0.01 and t0.005,8 =
3.355):

( ) ( )
βˆ1 − t0.005,8 s βˆ1 ≤ β1 ≤ βˆ1 + t0.005,8 s βˆ1
0.465 − 3.355 ( 0.033) ≤ β1 ≤ 0.465 + 3.355 ( 0.033)
0.354 ≤ β1 ≤ 0.576

Exercise 7.4
The coefficient of determination is:

2 βˆ0  yi + βˆ1  xi yi − ny 2
R =
 yi2 − ny 2
35.95 ( 670.1) + 0.465 ( 44,842.4 ) − 10 ( 67.01)
2
=
44,941.9 − 10 ( 67.01)
2

= 0.961

This means that 96.1% of variation in y can be explained by variation in x and only
3.9% of variation in y is explained by other factors.

Exercise 7.5
(a) There is no particular pattern in this plot. We found that the model has random
error with constant variance. Hence, there is no violation from the linear
model assumptions.

(b) The model is non-linear, but has a curvy shape.

(c) Histogram shows a normal shape. Hence, random error is distributed as


normal. Thus, there is no violation from the linear model assumptions.

Copyright © Open University Malaysia (OUM)


292  ANSWERS

Exercise 7.6

(a)

The plot shows the regression model is in reciprocal function form. Hence,
transformation is x* = 1/x and the linear regression model is y = 2.67 – 0.68x*.

(b)

Plot shows the regression model is in exponential form. Hence, transformation


is y* = ln y and the linear regression model is y* = ln 2 + 3.1x.

(c)

Plot shows the regression model is in power function form. Hence,


transformation is y* = log y and x* = log x and the linear regression model is
y* = log 1.5 + 0.85x*.

Copyright © Open University Malaysia (OUM)


ANSWERS  293

(d)

Plot shows the regression model is in hyperbolic function form. Hence,


transformation is y* = 1/y and x* = 1/x and the linear regression model is
y* = 0.4x* + 2.

Exercise 7.7
Refer to Exercise 7.2, the simple linear regression model.

ŷ = 35.95 + 0.465x

When xg = 86, ŷ = 35.95 + 0.465(86) = 75.94.

To get the standard error for estimator, we need to have the w value. Using
regression model ŷ = 35.95 + 0.465x, the ŷ value for each x value is shown in the
table below:

x 60 62 64 65 66 67
ŷ 63.6 65.2 66.0 65.5 66.9 67.1

w 63.85 64.78 65.71 66.175 66.64 67.105


x 68 70 72 74
ŷ 67.4 68.3 70.1 70.0

w 67.57 68.5 69.43 70.36

Hence,
n
 ( yi − yˆi )
2

i =1 1.494
sε = = = 0.432
n−2 8

Copyright © Open University Malaysia (OUM)


294  ANSWERS

The 99% confidence interval gives α = 0.01 and tα/2 = t0.005 = 3.355. Hence, for
xg = 86, the prediction interval is

( )
2
1 xg − x
yˆ ± tα /2s ε 1+ +
n  ( xi − x )2
2
1 ( 86 − 66.8 )
75.94 ± ( 3.355 )( 0.432 ) 1+ +
10 171.6
75.94 ± 2.61

It is found that the upper and lower limits for the 99% confidence interval is 73.33
and 78.55 respectively. This means the predicted y value is 73.33 unit at the
minimum and is 78.55 unit at the maximum for x = 86.

Exercise 7.8
The ŷ values, tα/2 and s∈ can be obtained from Exercise 7.7. Hence, the interval for
expected value of y for xg = 69 is:

( )
2
1 xg − x
yˆ ± tα /2s ε +
n  ( xi − x )2
2
1 ( 69 − 66.8 )
75.94 ± ( 3.355 )( 0.432 ) +
10 171.6
75.94 ± 0.52

It is found that the upper and lower limits for the confidence interval is 75.42 and
76.46 respectively. This means the predicted y value is 75.42 unit at the minimum
and is 76.46 unit at the maximum for x = 69.

Copyright © Open University Malaysia (OUM)


ANSWERS  295

TOPIC 8: MULTIPLE REGRESSION

Exercise 8.1
(a) i = 4, y4 = 29; yˆ′4 = 9.430 + 5.266(2.4) + 2.0612(4) = 30.3132 ≈ 30.31, and
error, ∈4 = y4 − yˆ′4 = 29.0 – 30.31 = –1.31, “over-estimate”

i = 9, y9 = 34; yˆ′9 = 9.430 + 5.266(3) + 2.0612(4) = 33.4728 ≈ 33.47, and


error, ∈9 = y4 − yˆ′9 = 34.0 – 33.47 = +0.53, “under-estimate”

(b) ŷ = 9.430 + 5.266(4) + 2.0612(5) = 40.8.

Exercise 8.2
1.

Copyright © Open University Malaysia (OUM)


296  ANSWERS

2. Data (a)
Y X1 X2
10 2 5
24 3 6
40 7 6
20 3 5
15 4 3

SUMMARY OUTPUT

Regression Statistics

Multiple R 0.999906
R square 0.999812
Adjusted R square 0.999435
Standard error 0.25713
Observations 4

Copyright © Open University Malaysia (OUM)


ANSWERS  297

ANOVA

Df SS MS F Significance F
Regression 2 350.6839 175.3419 2652.047 0.013729
Residual 1 0.066116 0.066116
Total 3 350.75

Standard Lower Upper Lower Upper


Coefficients t Stat P-value
Error 95% 95% 95.0% 95.0%

Intercept –13.8099 0.579456 –23.8325 0.026697 –21.1726 –6.44723 –21.1726 –6.44723

2 3.958678 0.080975 48.88773 0.01302 2.929794 4.987561 2.929794 4.987561

5 4.347107 0.108387 40.10712 0.01587 2.969915 5.7243 2.969915 5.7243

RESIDUAL OUTPUT PROBABILITY OUTPUT

Observation Predicted 10 Residuals Percentile 10


1 24.14876 –0.14876 12.5 15
2 39.98347 0.016529 37.5 20
3 19.80165 0.198347 62.5 24
4 15.06612 –0.06612 87.5 40

Note: The differences in values for answers in Q1 & 2(a)

2. Data (b)
Y X1 X2
10 2 2
25 4 6
30 4 8
20 3 6
15 4 3

Copyright © Open University Malaysia (OUM)


298  ANSWERS

SUMMARY OUTPUT

Regression Statistics

Multiple R 0.997365
R square 0.994737
Adjusted R square 0.984211
Standard error 0.811107
Observations 4

ANOVA

df SS MS F Significance df
Regression 2 124.3421 62.17105 94.5 0.072548
Residual 1 0.657895 0.657895
Total 3 125

Standard Lower Upper Lower


Coefficients t Stat P-value
Error 95% 95% 95.0% 95.0% 95.0%

Intercept –11.1842 3.87879 –2.88343 0.212523 –60.4689 38.10049 –60.4689 38.10049

2 4.342105 0.939662 4.620924 0.135677 –7.59743 16.28164 –7.59743 16.28164

2 3.026316 0.227901 13.27906 0.047851 0.130554 5.922078 0.130554 5.922078

Copyright © Open University Malaysia (OUM)


ANSWERS  299

RESIDUAL OUTPUT PROBABILITY OUTPUT

Observation Predicted 10 Residuals Percentile 10


1 24.34211 0.657895 12.5 15
2 30.39474 –0.39474 37.5 20
3 20 0 62.5 25
4 15.26316 –0.26316 87.5 30

3. You should be able to answer this question by referring to the module.

TOPIC 9: HYPOTHESIS TESTING (SINGLE


POPULATION)

Exercise 9.1
1. To test whether the population median exceeds 160, test:

H 0 : τ = 160 H1 : τ > 160 α = 0.05

A one-sided (right) test provides the test statistics value, S = Number of


observed “+” sign.

Replacing values greater than 160 with “+” sign and values less than 160 with
“–“ sign, we will get,
+ + + + + – – + + + – + + – + + + + +

Observe that n = 20 – 1= 19 since there is one observation with τ 0 value, that


is 160. S obtained is 15.
S − E ( S ) S − 0.5n 15 − (0.5)(19)
Hence, Z = = = = 2.52
Var( S ) 0.5 n ( )
0.5 19

From the standard normal table,


Pr(X ≥ 15) = Pr(Z ≥ 2.52) = 1 – 0.99413 = 0.00587

Copyright © Open University Malaysia (OUM)


300  ANSWERS

Since p-value = 0.00587 < α = 0.05, the null hypothesis is rejected. In


conclusion, the median strength of fabric is > 160kg.

2. It is known that both S1 and S2 are distributed as binomial with n sample size
and θ = 0.5. For a binomial variable X with n and θ = 0.5, Pr(x ≥ a) =
Pr(x ≤ n – a) since the distribution is symmetrical. Hence, Pr(S1 ≥ c) =
Pr( S2 ≤ n – c).

Exercise 9.2
1. It is known that T + and T − are sum of rank differences with positive and
negative signs respectively. Hence, the sum of rank differences for both ranks
without taking into consideration of “+” or “–” signs is sum of all possible
ranks, that is:

(Rank) 1 + (Rank) 2 + ... + Largest rank = T + + T −


1 + 2 + 3 + ... + n = T + + T − . Thus, (n + 1)/ 2 = T + + T −

2. To determine whether median content is 98.5 or not, test:

H 0 : τ = 98.5 against H1 : τ ≠ 98.5 and α = 0.05.

Using the signed-rank test, we obtained the following table:

yi yi – 98.5 Rank yi yi – 98.5 Rank

97.5 –1.0 (–) 4 93.2 –5.3 (–) 14


95.2 –3.3 (–) 12 99.1 +0.6 (+) 2
97.3 –1.2 (–) 6 96.1 –2.4 (–) 9
96.0 –2.5 (–) 10 97.6 –0.9 (–) 3
96.8 –1.7 (–) 7 98.2 –0.3 (–) 1
100.3 +1.8 (+) 8 98.5 0 0
97.4 –1.1 (–) 5 94.9 –3.6 (–) 13
95.3 –3.2 (–) 11

Copyright © Open University Malaysia (OUM)


ANSWERS  301

The signed-rank test for small sample size is performed since n = 14. From
the calculation above, the total number of negative differences, T + = 10.
When n = 14, the critical value T0.01 = 13. Since T + is not < T0.01 , hence, we
do not reject H 0 that median hydrocarbon content is 98.5.

2. Test to determine whether pipes produced by the supplier’s company satisfy


the specification gives:

H 0 : τ = 2,500 against H1 : τ > 2,500

Using the sign test:


Test statistics, S = Number of observations greater than 2,500 = 5.

Hence, S is distributed as binomial (n = 7, θ = 0.5). From the binomial table,


Pr(S ≥ 5) = 1 – Pr(S ≤ 4) = 1 – 0.7734 = 0.2266

We reject H 0 if α > p-value. Since α = 0.10 is not > 0.2266, H 0 cannot be


rejected. Pipes produced by the supplier’s company do not satisfy the
specification at α = 0.10.

yi yi – 2,500 Rank ( yi – 2,500)


2,610 +110 (+) 5
2,750 +250 (+) 7
2,420 –80 (+) 4
2,510 +10 (+) 1.5
2,540 +40 (+) 3
2,490 –10 (–) 1.5

Copyright © Open University Malaysia (OUM)


302  ANSWERS

4.

Rank Rank
yi yi – 1 yi yi – 1
( yi – 1) ( yi – 1)

0.045 –0.955 (–) 23 1.894 +0.894 (+) 20


0.258 –0.742 (–) 14 0.088 –0.912 (–) 22
0.412 –0.588 (–) 10 0.579 –0.421 (–) 4
0.036 –0.964 (–) 24 0.445 –0.555 (–) 9
1.055 +0.55 (+) 8 0.379 –0.621 (–) 12
1.070 +0.070 (+) 1 0.242 –0.758 (–) 15
0.361 –0.906 (–) 21 1.267 +0.267 (+) 3
0.394 –0.606 (–) 11 0.136 –0.864 (–) 18.5
0.136 –0.864 (–) 18.5 1.639 +0.639 (+) 13
0.506 –0.494 (–) 6 0.567 –0.433 (–) 5
0.209 –0.791 (–) 16 0.336 –0.664 (–) 14
8.788 +7.788 (+) 25 0.912 –0.088 (–) 2
0.182 –0.818 (–) 17

Sum of differences with “–” sign is T − = 262, Hence, the test statistics:

n ( n + 1) 25 ( 26 )
T− 262 −
4 4 262 − 162.5
z= = =
n ( n + 1)( 2n + 1) 25 ( 26 )( 51) 37.1652
24 24
= 2.6772

Since Z = 2.6772 is not < Za = 2.33, we cannot reject H0 . The same decision
can be obtained from the sign test.

Copyright © Open University Malaysia (OUM)


ANSWERS  303

TOPIC 10: HYPOTHESIS TESTING (TWO


POPULATIONS)

Exercise 10.1
1. (a) n = Total positive and negative signs = 15 + 5 = 20 (0 or tie is not
counted). For one-sided (right) test, S = Number of positive signs = 15

(b) p-value = Pr(S ≥ 15) = 1 – Pr(S ≤ 14) = 1 – 0.9793 = 0.0207. At 0.05


level, reject H 0 since 0.0207 > 0.05.

2. To compare the effectiveness of traffic control system, test:

H 0 : The number of accidents before and after installation is the same

H1 : The number of accidents before the installation of traffic control system


is higher compared to after installation of system.
α = 0.05

Sign test:
The test statistics, S = number of “+” sign. By replacing positive differences
with “+” sign and negative differences with “–” sign, you will get: + + + +
+ + – + – + + + with this, n =12, x = 10. Using the binomial distribution
table with θ = ½, Pr(S ≥ 10)
= 1 – Pr(S ≤ 9)
= 1 – 0.9807 = 0.0193

Since p-value = 0.0193 < 0.05 = a, hence reject H0 . In conclusion, the new
traffic control system is more effective in reducing the number of accidents at
dangerous junctions at 0.05 significance level.

Copyright © Open University Malaysia (OUM)


304  ANSWERS

Exercise 10.2
1. (a) w2 = [(8)(9)/2] – 8 = 28 Y2 = 15 + [(3)(4)/2] – 8 = 13
Y1 = 15 + [(5)(6)/2] – 28 = 2

For a one-sided (right) test, test statistics, Y1 = 2. With n1 = 3 and


n2 = 5, Y0.05 = 1. Since test statistics Υ > critical value Y0.05 , do not
reject Η 0 at 5% significance level.

(b) w1 = [(10)(11)/2] – 17 = 38 Y1 = 24 + [(6)(7)/2] – 38 = 7


Y2 = 24 + [(4)(5)/2] – 17 = 17

For a two-sided test, test statistics Υ = minimum (Y1 , Y2 ) = 7. When


n1 = 6 and n2 = 4, Y0.10 = 3. Since test statistics Υ > critical value Y0.10 ,
do not reject Η 0 at 10% significance level. When Y0.02 = 1 and also
Y0.05 = 2 the decision is do not reject Η 0 (as expected since even at 10%
level, Η 0 cannot be rejected).

2. To determine whether both groups of students differ in terms of score, test:

H 0 : Students from both groups obtain similar score.

H1 : Students from video program group and solving real problem obtain
higher score.
α = 0.01

From data, n1 = 7, n2 = 10. Ranks assignment resulted in,

Group 1 2.5 11 2.5 13.5 6.5 1 4.5


Group 2 8 12 15.5 17 9.5 15.5 6.5 9.5 13.5 4.5

Copyright © Open University Malaysia (OUM)


ANSWERS  305

w1 = 2.5 + 11 + 2.5 + 13.5 + 6.5 + 1 + 4.5 = 41.5,

hence, w2 =
(17 )(18) − 41.5 = 111.5
2

Test statistics, Y2 = (7)(10) + (10)(11)/2 – 111.5 = 13.5

From Υ table, the critical vale at α = 0.01 for a one-sided test with n1 = 7 and
n2 = 10 is 11. Since 13.5 is not < 11, we do not reject the null hypothesis. In
conclusion, there is no significance difference in the score for both groups at
0.01 significance level.

3. To test the claim that the campaign is successful, test:

H 0 : Probability distribution of number of accidents before and after campaign


is equal, D1 = D2 versus H1 : Probability distribution of number of accidents
after campaign has shifted to the left of probability distribution of number of
accidents before campaign, D1 > D2 .

(a) Using sign test:

Factory Before Campaign After Campaign Difference Sign


1 3 2 +
2 4 1 +
3 6 3 +
4 3 5 –
5 4 4 0
6 5 2 +
7 5 3 +
8 3 3 0
9 2 0 +
10 4 3 +
11 4 1 +

Copyright © Open University Malaysia (OUM)


306  ANSWERS

12 5 2 +

Test statistics S = Number of “+” sign = 9. S ~ binomial (10, ½). The


p-value is Pr(S ≥ 9) = 1 – Pr(S ≤ 8) = 0.0107. Since 0.01 < 0.05 we
reject H0 . In conclusion, the claim that the campaign is effective in
reducing the number of accidents is true at 5% level.

(b) Using the signed-rank test:

Factory Before After Difference Rank |Difference|


1 3 2 +1 +1.5
2 4 1 +3 +8
3 6 3 +3 +8
4 3 5 –2 –4
5 4 4 0 Discard
6 5 2 +3 +8
7 5 3 +2 +4
8 3 3 0 Discard
9 2 0 +2 +4
10 4 3 +1 +1.5
11 4 1 +3 +8
12 5 2 +3 +8

From the table, we got T + = 51 while T − = 4

For a one-sided (right) test, the test statistics is T − = 4. The critical


value = 14 for n = 12. Since T = 4 ≤ 14, the decision is to reject H0 . The
claim that the campaign is effective in reducing road accidents is true at
0.05 level.

Copyright © Open University Malaysia (OUM)


ANSWERS  307

4. Let D1 be the distribution of time duration for problem-solving taken by the


control group, while D2 is the distribution of time duration taken by the
experimental group.

To determine whether alcohol influences individuals’ thinking ability, test:

Η 0 : Time taken to solve the problem is the same for both groups or D1 = D2
versus H1 : Subjects taking alcohol take longer time to solve the problem or
D1 < D2 .

α = 0.05

By combining all observations, assign ranks according to data sequence in


ascending order. Then, calculate the sum of ranks obtained for respective
groups. The following table is obtained.

Control Group Rank Experiment Group Rank


63 10 78 18
57 8 77 17
44 4 75 16
70 13 74 15
50 5 80 19
42 2 55 6
64 11 62 9
56 7 72 14
41 1 66 12
43 3
Total 61 Total 129

From the table, n1 = 9, when n2 = 10, w1 = 61 when w2 = 129.

Thus, test statistics Y1 with n1 = 9 and n2 = 10, the critical value for α = 0.05
is 24. Since 16 < 24, reject the null hypothesis. Alcohol does have effect on
individuals’ thinking ability at 0.05 level.

Copyright © Open University Malaysia (OUM)


MODULE FEEDBACK
MAKLUM BALAS MODUL

If you have any comment or feedback, you are welcome to:

1. E-mail your comment or feedback to [email protected]

OR

2. Fill in the Print Module online evaluation form available on myINSPIRE.

Thank you.

Centre for Instructional Design and Technology


(Pusat Reka Bentuk Pengajaran dan Teknologi )
Tel No.: 03-78012140
Fax No.: 03-78875911 / 03-78875966

Copyright © Open University Malaysia (OUM)


Copyright © Open University Malaysia (OUM)

You might also like