Intro to Statistical Methods
Intro to Statistical Methods
1.1 Introduction
Basic concepts
Statistics can be called that body of analytical and computational methods by which characteristics
of a population are inferred through observations made in a representative sample from that
population. Since scientists rarely observe entire populations, sampling and statistical inference are
essential. Although, the objective of statistical methods is to make the process of scientific research
as efficient and productive as possible, many scientists and engineers have inadequate training in
experimental design and in the proper selection of statistical analyses for experimentally acquired
data.
Population: It is the collection of all possible observations of a specified characteristic of interest
(possessing certain common property) and being under study.
Most of the time, due to the expense, time, size of population, medical concerns, etc., it is not
possible to use the entire population for a statistical study; therefore, researchers use samples.
Sample: It is a subset of the population, selected using some sampling technique in such a way that
they represent the population.
If the subjects of a sample are properly selected, most of the time they should possess the same or
similar characteristics as the subjects in the population.
Parameter: is a descriptive measure of a population, or summary value calculated from a
population. Examples: Population Range, Population Average, Population proportion, Population
variance, etc.
Statistic: is a descriptive measure of a sample, or summary value calculated from a sample.
Example: Sample Proportion, Sample Average, Sample Range, Sample variance.
Classification of Statistics
The field of statistics can be divided into two major branches namely, descriptive and inferential
statistics.
Descriptive Statistics: is part of statistics deals only with describing some characteristics of the
data collected without going beyond the data. In other words, it deals with only describing the
sample data without going any further: that is without attempting to infer (conclude) anything about
1
Statistical methods lecture note
the population. It deals with collection of data, its presentation in various forms, such as tables,
graphs and diagrams and findings averages and other measures which would describe the data.
Examples:
Classification of students in College of Natural and Computational Science according to
their department.
The number of female students in this class.
Inferential Statistics: is type of statistics is concerned with drawing statistically valid conclusions
about the characteristics of the population (large group) based on information obtained from a
sample (small group). That is, this part of statistics is concerned with the generalizing the results of
a sample (small groups) to the entire population (large group) from which the sample is drawn.
Example: Of 50 randomly selected people in the town of Jinka, 10 people had the last name
Kebede. An example of inferential statistics is the following statement: "about 20% of all
people living in Ethiopia have the last name Kebede."
Having collected and edited the data, the next important step is to present it. That is to present the
data in a comprehensible, condensed and suitable form that helps in order to draw interpretation
from it. Data presentation is a statistical procedure of arranging and putting data in a form of tables,
graphs, charts and diagrams. The need for proper presentation arises because of the fact that
statistical data in their raw form are not easy to understand.
2
Statistical methods lecture note
1.3 Review of measures of central tendencies and variations
3
Statistical methods lecture note
Event: It is a subset of sample space. It is a statement about one or more outcomes of a random
experiment.
Elementary event (simple event): one possible outcome of an experiment
Event (Compound event): One or more possible outcomes of a random experiment
Sample space: the set of all sample points (simple events) for an experiment is called a sample
space; or set of all possible outcomes for an experiment.
Counting techniques: is the method of determining the number of outcomes in the sample space or
in an event. One can use several rules of counting namely: Addition rule, Multiplication rule,
Permutation rule and Combination rule.
4. P( A ) 1 P( A)
'
5. 0 P( A) 1
8. P ( A / B ) P ( A B)
P( B)
4
Statistical methods lecture note
Definition: If a random experiment with N equally likely outcomes is conducted and out of these
NA outcomes are favorable to the event A, then the probability that event A occur denoted P (A) is
defined as:
P
A
N
A
n
A
No
.
of
outcomes
favourabl
for
A
N
n Total
s Number
of
outcomes
Limitation:
If it is not possible to enumerate all the possible outcomes for an experiment.
If the sample points (outcomes) are not mutually independent.
If the total number of outcomes is infinite.
If each and every outcomes is not equally likely.
Example 1:.A fair die is tossed once. What is the probability of getting?
a) Number 4?
b) An odd number?
c) Number greater than 4?
d) Either 1 or 2 or …. or 6
Example 2:.A box of 80 candles consists of 30 defective and 50 non defective candles. If 10 of
these candles are selected at random, what is the probability?
a) All will be defective.
b) 6 will be non-defective
c) All will be non-defective
Subjective Approach
It is always based on some prior body of knowledge. Hence subjective measures of uncertainty are
always conditional on this prior knowledge. The subjective approach accepts unreservedly that
5
Statistical methods lecture note
different people (even experts) may have vastly different beliefs about the uncertainty of the same
event.
Example: Ayele‟s belief about the chances of Ethiopia Buna club winning the FA Cup this year
may be very different from Daniel's. Ayele, using only his knowledge of the current team and past
achievements may rate the chances at 30%. Daniel, on the other hand, may rate the chances as 10%
based on some inside knowledge he has about key players having to be sold in the next two months.
1.4.2 Definition of random variables and probability distribution
Random variable: - is numerical valued function defined on the sample space. It assigns a real
number for each element of the sample space. Generally a random variables are denoted by capital
letters and the value of the random variables are denoted by small letters
Example: Consider an experiment of tossed a fair of coin three times. Let the random variable X be
the number of heads in three tosses, then find X?
Random variables are of two types:
1. Discrete random variable: are variables which can assume only a specific number of values.
They have values that can be counted
Examples:
• Toss a coin n time and count the number of heads.
• Number of children in a family.
• Number of car accidents per week.
• Number of defective items in a given company.
• Number of bacteria per two cubic centimeter of water.
2. Continuous random variable: are variables that can assume all values between any two give
values. Examples:
• Height of students at certain college.
• Mark of a student.
• Life time of light bulbs.
• Length of time required to complete a given training.
Probability distribution:- consists of a value a random variable can assume and the corresponding
probabilities of the values or it is a function that assigns probability for each element of random
variable.
Probability distribution can be discrete or continuous.
6
Statistical methods lecture note
A) Discrete probability distribution: describes the probability of occurrence of each value of a
discrete random variable. With a discrete probability distribution, each possible value of the
discrete random variable can be associated with a non-zero probability. Thus, a discrete probability
distribution is often presented in tabular form.
Examples:
1. Consider the experiment of tossing a coin three times. Let X be the number of heads.
Construct the probability distribution of X.
2. A balanced die is tossed twice; construct a probability distribution
A. If X is the sum the number of spots in the two trials.
B. If X is the absolute difference of the number of spots in the trials.
Properties of discrete probability distribution
n
1) P X x 1
i 1
i
2) P X xi 0 or 0 P X xi 1
3) If X is discrete random variable, then
b 1 b 1
Pa X b P( x ) Pa X b P( x)
X a 1 X a
b b
Pa X b P( x ) Pa X b P( x)
X a 1 X a
b) P X 0
When using the binomial formula to solve problems, we have to identify three things:
• The number of trials (n)
• The probability of a success on any one trial (P) and
• The number of successes desired (X).
Remark: If X is a binomial random variable with parameters n and p then
and
Examples:
1. What is the probability of getting three heads by tossing a fair con four times?
2. Suppose that an examination consists of six true and false questions, and assume that a student has
no knowledge of the subject matter. The probability that the student will guess the correct answer to
the first question is 30%. Likewise, the probability of guessing each of the remaining questions
correctly is also 30%.
A. What is the probability of getting more than three correct answers?
8
Statistical methods lecture note
B. What is the probability of getting at least two correct answers?
C. What is the probability of getting at most three correct answers?
D. What is the probability of getting less than five correct answers?
3. The probability that a patient contracting IB will recover from the distance under medical
treatment is 0.6 out of 15 patients contracting the diseases
A. What is the probability that exactly 10 is record?
B. What is the expected number of patient who will recover?
C. What is the variance of the number of patient who will recover?
Assume that the patients are subjected under the same medical treatment.
2. Poisson Distribution
- A random variable X is said to have a Poisson distribution if its probability distribution is given
by:
x e
P( X x) , x 0,1,2,......
x!
Where the averagenumber.
x = the number of occurrence in a Poisson process
- The Poisson distribution depends only on the average number of occurrences per unit time of
space.
- The Poisson distribution is used as a distribution of rare events
- The process that gives rise to such events is called Poisson process.
- If X is a Poisson random variable with parameters λ then
E(x) = λ, Var(x) = λ
Example 1: If there are 200 typographical errors randomly distributed in a 500-page manuscript,
find the probability that a given page contains exactly 3 errors.
Example 2: A sale firm receives, on the average, 3 calls per hour on its toll-free number. For any
given hour, find the probability that it will receive the following.
a) At most 3 calls
b) At least 3 calls
c) Five or more calls
Common Continuous Probability Distributions
1. Normal Distribution
9
Statistical methods lecture note
A random variable X is said to have a normal distribution if its probability density function is given
by
x
2
f x
1 1
.e 2
where x , , 0
2
f x
1
2
2. It is asymptotic to the axis, i.e., it extends indefinitely in either direction from the mean.
3. It is a continuous distribution i.e. there is no gaps or holes.
4. It is a family of curves, i.e., every unique pair of mean and standard deviation defines a different
normal distribution. Thus, the normal distribution is completely described by two parameters:
mean and standard deviation.
5. Total area under the curve sums to 1, i.e., the area of the distribution on each side of the mean is
0.5 f ( x)d x 1
10
Statistical methods lecture note
• Standard Deviation is one
Areas under the standard normal distribution curve have been tabulated in various ways. The
most common ones are the areas between Z=0 and a positive value of Z.
Given a normal distributed random variable X with Mean μ and standard deviation σ
a X b
Pa X b P
a b
P Z
Examples:
1. Find the area under the standard normal distribution which lies
a) Between Z=0 and z=96.0
b) Z=-1.45 and Z=0
c) The right of Z=-0.55
d) To the left of Z=0.55
e) Between Z=-0.84 and Z=1.45
f) Between Z=0.45 and Z=1.25
2. Find the value of Z if
a) The normal curve area between 0 and z(positive) is 0.4726
b) The area to the left of z is 0.9868
3. A random variable X has a normal distribution with mean 80 and standard deviation 4.8. What
is the probability that it will take a value?
a) Less than 87.2
b) Greater than 76.4
c) Between 81.2 and 86.0
4. A normal distribution has mean 62.4. Find its standard deviation if 20.05% of the area under the
normal curve lies to the right of 72.9.
5. A random variable has a normal distribution with σ=5. Find it‟s mean if the probability that the
random variable will assume a value less than 52.5 is 0.6915.
6. Of a large group of men, 5% are less than 60 inches in height and 40% are between 60 & 65
inches. Assuming a normal distribution, find the mean and standard deviation of heights.
2. Student’s t Distribution
11
Statistical methods lecture note
In statistics as long as sample size is large enough, most data sets can be explained by Standard
Normal Distribution. But when the sample size is small, statisticians rely on the distribution of the t
statistic (also known as the t score), whose value is given by:
̅
Where, x is the sample mean, μ is the population mean, s is the standard deviation of the sample,
and n is the sample size.
The distribution of the t statistic is called the t distribution or the Student t distribution. The
particular form of the t distribution is determined by its Degrees of Freedom (df). The degree of
freedom refers to the number of independent observations in a set of data. When estimating a mean
score or a proportion from a single sample, the number of independent observations is equal to the
sample size minus one. The t distribution can be used with any statistic having a bell-shaped
distribution (i.e., approximately normal).
With infinite degrees of freedom, the t distribution is the same as the standard normal
distribution.
The t distribution is similar to standard normal distribution in the following ways
It is bell-shaped.
It is symmetric about the mean.
The mean, median, and mode are equal to zero and located at the center of the
distribution.
The curve never touches the x axis.
The t distribution differs from standard normal distribution in the following ways.
The variance is greater than one
The t distribution is actually a family of curves based on the concept of degrees of
freedom, which is related to sample size.
As the sample size increases, the t distribution approaches the standard normal
distribution.
12
Statistical methods lecture note
1.5 Review of sampling procedures
Sampling Distribution
Statistic such as ̅ varies from sample to sample, they are random variables. As such, Statistic has
probability distributions associated with them. In order to make probability statements regarding a
sample statistic, we need to know the probability distribution of the sample statistic. That is to say,
we need to know the shape, center and spread of the sample statistic‟s distribution.
The sampling distribution of a statistic is a probability distribution for all possible values of the
statistic computed from a sample of size n.
Remark:
13
Statistical methods lecture note
2
2x
n
2. If sampling is without replacement
2 N n
2x
n N 1
3. In any case the sample mean is unbiased estimator of the population mean.
i.e. x E x (show)
Sampling may be from a normally distributed population or from a non- normally
distributed population.
3. The variance of x is equal to the population variance divided by the sample size i.e.
2
2
x
n
x
x ~ N , Z
n
n
Example: If the uric acid values in normal adult males are approximately normally distributed with
mean 5.7 mgs and standard deviation 1mg find the probability that a sample of size 9 will yield a
mean.
i. greater than 6
ii. between 5 and 6
iii. Less than 5.2
Central Limit Theorem
Suppose a random variable X has population mean μ and standard deviation σ and that a random
sample of size n is taken from this population. Then the sampling distribution of x becomes
2
approximately normal with x and variance 2 x as the sample size n increases (n 30 ).
n
14
Statistical methods lecture note
Simply stated: For any population, regardless of its shape, as the sample size increases, the shape
Example1) Suppose that all students who are at examination in a particular year the mean score
was 450 with SD of 120. If 400 of the students who took the test during that particular year were
selected at random
(b) What is the probability that a randomly selected student has an ACT Math score less than 18?
(c) What is the probability that a random sample of 10 ACT test takers had a mean math score of 18
or less?
15
Statistical methods lecture note
Chapter Two
2. Estimation and Sampling Distribution of Mean, Proportion and Variance
Introduction
Inference, specifically decision making and prediction, is centuries old and plays a very important
role in our lives. Each of us faces daily personal decisions and situations that require predictions
concerning the future. In many practical situations, the relevant facts are abundant, seemingly
inconsistent, and, in many respects, irresistible. As a result, a careful decision or prediction is often
little better than an outright guess. The objective of statistics is to make inferences about a large
population parameter based on information‟s obtained from sample individuals. Populations are
characterized by numerical descriptive measures called parameters. Typical population parameters
are the mean (), a proportion (p), and standard deviation (). Most inferential problems can be
formulated as an inference about one or more parameters of a population.
There are two ways of statistical inference, namely estimation and hypothesis testing. These
methods involves different procedures, and has important roles, they answer two different questions
about the parameter. In estimating a population parameter, we are answering the question, “What is
the value of the population parameter?” In testing a hypothesis, we are seeking an answer to the
question, “Does the population parameter satisfy a specified condition?” For instance, “ ”,
“ ”, and “ ”.
Statistical Estimation is the method of making inference about the population parameter where the
investigator does not have any prior notion about values or characteristics of the population
parameter. It also refers to producing sound and reasonable “substitutes” for unknown parameters
of a population or obtaining random intervals within which the parameters could lie.
1) Point Estimation: is a single numerical value used to estimate the corresponding population
parameters. Giving a point estimate is the same as giving a single value. For example,
the sample mean (x) is a point estimate of the population mean (μ), the sample proportion (p) is
a point estimate of the population proportion (P) and the sample standard deviation (s) is a point
estimate of the population standard deviation (σ).
16
Statistical methods lecture note
2) Interval estimation: A point estimate does not give any indication on how far away the
parameter lies. A more useful method of estimation is to compute an interval which has a high
probability of containing the parameter.
Interval estimation provides an interval within which the parameter of interest is expected to lie. It
is the procedure that results in the interval of values as an estimate for a parameter; the interval
contains the likely values of a parameter. It deals with identifying the upper and lower limits of a
parameter. Unlike the case for point estimation, some degree of uncertainty is attached while
estimating a parameter based on interval estimations. In practical applications, the 90, 95 and 99
percent levels of confidence are used most commonly. The corresponding estimated intervals are
called 90, 95 and 99 percent confidence intervals. By this we mean, for instance, that a 95%
confidence interval is likely to contain the unknown parameter with a probability or confidence that
is 0.95, only 5 out of 100 intervals we construct are likely not to contain the parameter.
Sampling distribution of sample means is a distribution using the means computed from all possible
random samples of a specific size taken from a population. It is a probability distribution of the
sample mean (̅). If the samples are randomly selected with replacement, the sample means, for the
most part, will be somewhat different from the population mean . These differences are caused by
sampling error.
Suppose an investigator selects a sample of 30 adult males and finds the mean of the measure of the
triglyceride levels for the sample subjects to be 187 milligrams/deciliter. Then suppose a second
sample is selected, and the mean of that sample is found to be 192 milligrams/deciliter. Continue
the process for 100 samples. What happens then is that the mean becomes a random variable, and
the sample means 187, 192, 184… 196 constitute a sampling distribution of sample means.
When all possible samples of a specific size are selected with replacement or without replacement
from a population, the distribution of the sample means for a variable has the following properties,
1. The mean of the sample means will be the same as the population mean.
2. If sampling is with replacement, the standard deviation of the sample means will be smaller than
the standard deviation of the population, and it will be equal to the population standard
deviation divided by the square root of the sample size.
17
Statistical methods lecture note
3. If sampling is without replacement, the standard deviation of the sample means will be equal to
the population standard deviation divided by the square root of the sample size and multiply it
by√ .
The following example illustrates these two properties. Suppose a professor gave an 8-point quiz to
a small class of four students. The results of the quiz were 2, 6, 4, and 8. For the sake of discussion,
assume that the four students constitute the population.
√
Now, if all samples of size 2 are taken with replacement and the mean of each sample is given by:
Sample Mean Sample Mean Sample Mean Sample Mean
2, 2 2 4, 2 3 6, 2 4 8, 2 5
2, 4 3 4, 4 4 6, 4 5 8, 4 6
2, 6 4 4, 6 5 6, 6 8 8, 6 7
2, 8 5 4, 8 6 6, 8 7 8, 8 8
And, a frequency distribution of sample means is as follows:
̅ 2 3 4 5 6 7 8
Freq. 1 2 3 4 3 2 1
̅ √
18
Statistical methods lecture note
means, (d) the standard deviation of the sampling distribution of means, i.e., the standard error of
means.(Answer a=6, b=3.29, c=6 d=2.32)
The other property of the sampling distribution of sample means relates to the shape of the
distribution and is explained by the central limit theorem.
σ and that a random sample of size n is goes to infinity. Then the sampling distribution of x
2
becomes approximately normal with x and variance 2 x as the sample size n gets large
n
(n 30 ).
̅
, standard normal distribution by CLT
⁄
√
If the sample size is sufficiently large, the central limit theorem can be used to answer questions
about sample means in the same manner that a normal distribution can be used to answer questions
about individual values.
Example: A factory making soft drink has an automatic process that fills its bottles. The volume of
drink in each bottle is supposed to be 330ml, but the machine fills the bottles with random amount
of drink that has a mean of 330ml and standard deviation of 5ml. suppose we take a sample of 100
bottles of drink. What is the probability that the mean volume of drink in the sample is more than
331ml?
Solution: As we have taken large (n=100) sample we can use CLT. This says that the mean amount
of drink in the bottle of the sample cans approximately normal random variable with mean
(=330ml) and variance 2/n=1/4
If we let Y= be the mean volume of the drink in each bottles it is required to find (P(Y>331)) where
Y~N (330, 1/4)
( )
⁄ ⁄
√ √
( )
⁄
√
19
Statistical methods lecture note
Exercises
1. Suppose that 150 customers enter a supermarket on a given day. Each customer spends a
random amount. All that is known about the distribution this expenditure is that its mean is 7.5
birr and its standard deviation is 3.4birr. What is the probability that a person, on average spend
more than 8birr during the day?
2. The amount of sulfur in daily emission from a factory has a normal distribution with mean of
134 pounds and standard deviation of 22 pounds. For a day selected randomly, find the
probability that the mean amount of sulfate emission will be less than 130 pounds.
sample mean ( ̅) is the sum of xi over n is the point estimator used to compute the estimate of
x i
the population means, μ. That is X is the point estimator of the population mean.
n
Example: Plastic sheets produced by a certain machine are periodically monitored for possible
fluctuation in thickness and 10 samples are taken: 25, 27, 30, 24, 24, 28, 27, 26, 29, 32 measured in
mm, then find or estimate the population mean.
Solution: the best estimator of the population mean () is:
∑
̅
Case 1: If sample size is large or if the population is normal with known variance
Recall the Central Limit Theorem, which applies to the sampling distribution of the mean of a
sample. Consider samples of size n drawn from a population, which mean is μ and standard
deviation is with replacement and ordering is important. The population can have any frequency
distribution. The sampling distribution of ̅ will have a mean ̅ and a standard deviation,
20
Statistical methods lecture note
̅ and approaches a normal distribution as n gets large. This allows us to use the normal
⁄
√
distribution curve for computing confidence intervals.
To obtain the value of Z, we have to attach this to a theory of chance. That is, there is an area of
size such that ( ⁄ ⁄ )
Where, is the probability that the parameter lies outside the interval.
⁄ is the standard normal variable to the right of which ⁄ probability lies. i.e.
( ⁄ ) ⁄
̅
( ⁄ ⁄ )
⁄
√
(̅ ̅
⁄ ⁄ ⁄ ⁄ *
√ √
̅ ̅ is a confidence interval for μ.
⁄ ⁄ ⁄ ⁄
√ √
But usually is not known, in that case we estimate by its point estimator
̅ ⁄ ⁄ ̅ ⁄ ⁄ is a confidence interval for μ.
√ √
Here are the z values corresponding to the most commonly used confidence levels.
⁄ ⁄
Case 2: If sample size is small and the population variance, is not known
̅
has t distribution with degrees of freedom.
⁄
√
X Z / 2 n
X , where is a measureof error.
Z / 2 n
For the interval estimator to be good the error should be small. We can make it small by three ways:
1) By making n large 2) Small variability 3) Taking Z small
21
Statistical methods lecture note
Example
Example 1: The population consists of survival times of cancer patients who have been treated
with a new drug has SD of 43.3 months. If a random sample of 100 drug-treated patients has a
mean survival time of 46.9 months, then
a) What is the point estimate of the population mean?
b) Find a 95% confidence interval for the population mean.
Solution: Given: n = 100, ̅ = 46.9, σ = 43.3, and = 0.05.
a) The point estimates of the population mean is 46.9 months.
b) The (1 - ̅
) 100% = 95% CI for μ is X ⁄ = 46.9 = 46.9 ± 1.96*
√ √
= 46.9 ± 8.5 = (38.4 to 55.4 months). Therefore, with 95% confidence the mean survival
√
Example 3: A medical researcher takes the blood pressure from a random sample of 25 (50-year-
old) women and the mean blood pressure of these sampled women is 140 mm Hg with a standard
deviation of 10 mm Hg.
a) What is the point estimate of the mean blood pressure of all 50-year-old women?
b) Construct the 95% CI for the mean blood pressure of all 50-year-old women.
̅ = 140 and
Solution: Given: n = 25, s = 10, X = 0.05
a) The point estimate of the mean blood pressure of all 50-year-old women is 140 mm Hg.
= (136.578, 143.422). Therefore, with 95% confidence the mean blood pressure
of all 50-year-old women is between 136.578 mm Hg and 143.422 mm Hg.
Exercises:
1. The decay rate (measured as μm/hour) for fine particles produced from oven cooking or toasting
was recorded on six randomly selected days. These six measurements are: 0.95, 0.83, 1.20,
0.89, 1.45 and 1.12.
22
Statistical methods lecture note
a) What is the point estimate for the true average decay rate of fine particles produced from
Oven cooking or toasting?
b) Find the 95% confidence interval for the true average decay rate of fine particles produced
from Oven cooking or toasting. (Answer (a) 1.07, (b) [0.89, 1.26]).
2. Imagine we have a sample of the life spans of wild horses, with 25 data points. We have
calculated the sample mean and the sample variance as 24.23 years and S = 4.25 years. Assume
that the life span follows a normal distribution.
a) What is the point estimate of the mean?
b) Calculate the 95% C.I for the mean. [Answer (a) 24.23, (b) (22.48, 25.98)].
3. A drug company is testing a new drug which is supposed to reduce blood pressure. From the six
people who are used as subjects, it is found that the average drop in blood pressure is 2.28
points, with a standard deviation of .95 points. What is the 95% confidence interval for the
mean change in pressure?
Properties best estimator: the following are some qualities of best estimator. It should be:
1. Unbiasedness: An estimator whose expected value is the value of the parameter being
estimated.
2. Consistent estimator: An estimator which gets closer to the value of the parameter as the
sample size increases.
3. Relatively efficient estimator: The estimator for a parameter with the smallest variance. This
actually compares two or more estimators for one parameter.
̂̂ ̂ ̂
̂ √ √ , Where q = 1-p, and n = sample size
The sampling distribution of ̂ is approximately normal provided that sample size is sufficiently
large. The sample size is considered sufficiently large if: np > 5 and nq >5
̂
That is, if n is large, the distribution of is approximately standard
√ √ ̂ ̂⁄
normally distributed.
Example: Assume that 33% of the adult males in the population are smokers. Find the
probability that in a sample of 800 males, the smokers will be between 35% and 37%.
Solution: We are given: n = 800, p = 0.33 and so q = 1-p =1-0.33 = 0.67 Mean and standard
̂̂
deviation of the sampling distribution of ̂ are ̂ and ̂ √ √
24
Statistical methods lecture note
We will now consider the method for estimating the binomial proportion p of successes, that is, the
proportion of elements in a population that have a certain characteristic. A logical candidate for a
x
point estimate of the population proportion p is the sample proportion p̂ = n , where x is the number
of observations in a sample of size n that have the characteristic of interest. As we have seen in
sampling distribution of proportions, the sample proportion is the best point estimate of the
population proportion and the SD of the sample proportion is V(p̂ ) = p̂ = (pq/n) ½ .
2) Interval estimation of population proportion
Confidence interval for a population proportion: the (1 - ) 100% confidence interval (C.I.) for
̂̂
the population proportion is p̂ ⁄ p̂ = p̂ ⁄ ( ) p̂ ⁄ ( ) , where is the area
under the standard normal curve outside the interval (called risk level). The interval is approximate
since we must substitute the sample proportion for the corresponding population proportion.
Example: An epidemiologist is worried about the ever increasing trend of malaria in a certain
locality and wants to estimate the proportion of persons infected in the peak malaria transmission
period. If he takes a random sample of 150 persons in that locality during the peak transmission
period and finds that 60 of them are positive for malaria, then,
a) What is the point estimate of the population proportion of the whole infected people in that
locality during the peak malaria transmission period?
b) Find (i) 95% (ii) 90% (iii) 99% confidence intervals for the proportion of the whole infected
people in that locality during the peak malaria transmission period.
Solution: A sample proportion p̂ = x/n = 60 / 150 = 0.4
The standard error of proportion depends on the population P. However, the population proportion
(P) is unknown. In such situations, can be used as an approximation to p̂ =
a) The point estimate of the population proportion of the whole infected people in that locality
during the peak malaria transmission period is 0.4.
b) i. A 95% C.I for the population proportion (the proportion of the whole infected people in
that locality) is equal to 0.4 ± 1.96 (0.04) ½ = (0.4 ± 0.078) = (0.322, 0.478).
ii. A 90% C.I for the population proportion (the proportion of the whole infected people in
that locality) is equal to 0.4 ± 1.64 (0.04) = (0.4 ±0 .066) = (0.334, 0.466).
iii. A 99% C.I for the population proportion (the proportion of the whole infected people in
that locality) = 0 .4 ± 2.58 (0.04) = (0.4 ± 0.103) = (0.297, 0.503).
25
Statistical methods lecture note
Exercise: 1: A random sample of 50 oranges taken from a fruit container, 6 of them are found to
be bad.
a) What is the point estimate for all bad oranges in the fruit container?
b) Construct the 95% for all bad oranges in the fruit container. Answer (a) 0.12, (b) (0.03, 0.21).
The estimation of population variance follows the same strategy as the other estimations. By
choosing a sample and assuming that it is from the middle of the population, you can use a known
sampling distribution to find a range of values that you are confident contains the population
variance. Like the population mean and proportion, the population variance will typically be
unknown; it must be estimated by a sample statistic, and there will be uncertainty with regard to its
actual value. Estimation the population variance is the basis of chi-square distribution.
• Suppose we have a population with scores that are normally distributed with mean
and
• If we repeatedly take samples of size and for each “sample” compute
• Define
• What would the sampling distribution of look like?
26
Statistical methods lecture note
• are non-negative Real numbers
• Since 68% of values from fall between , 68% of values from distribution
must be between 0 and 1.
• The chi-square distribution with is very skewed.
27
Statistical methods lecture note
Properties of Family of Distributions
We know ∑ ∑
If
We don‟t know , so we use ̅ as an estimate of µ
̅
∑
Or
̅
∑
So,
28
Statistical methods lecture note
• We can use the chi-square distribution to develop interval estimates and conduct hypothesis
tests about a population variance.
An important assumption for both the construction of confidence intervals and hypothesis testing
for is that the population must be normally distributed.
The sample variance ( ) is a point estimate of the population variance, and as such it is our single
best estimate as to the value of
While is the point estimate of , and a quantity from which we proceed to determine the lower
and upper confidence limits, the confidence interval is not a fixed quantity. This is because,
unlike the t and z distributions, the chi-square distribution is asymmetric. Thus, the description of
the confidence interval for requires separate calculations for its upper and lower limits. i.e.
( )
( )
• After a little algebra. . .
( )
( )
Or ( )
Where, the values are based on a chi-square distribution with degrees of freedom and
where is the confidence coefficient.
• Taking the square root of the upper and lower limits of the variance interval provides the
confidence interval for the population standard deviation is:
29
Statistical methods lecture note
(√ √ )
Example: Buyer‟s Digest rates thermostats manufactured for home temperature control. In a recent
test, 10 thermostats manufactured by Thermo Rite were selected and placed in a test room that was
maintained at a temperature of . The temperature readings of the ten thermostats are shown in
the table below. Construct a 95% confidence interval estimate of the population variance.
Thermostat 1 2 3 4 5 6 7 8 9 10
Temperature 67.4 67.8 68.2 69.3 69.5 67 68.1 68.6 67.9 67.2
Solution:
∑ ̅
At
Interpretation: we can be 95% confident that the population variance of thermostats manufactured
for home temperature control falls within 0.33 and 2.33.
Exercise 1: A total quality management (TQM) supervisor is interested in examining variability in
the amount of product being inserted by a filling machine. From a sample of packages, the
average weight of the contents was 412.72 grams, with a standard deviation of 5.30 grams. If the
filling weights are from a normally distributed population, what is the 98% confidence interval for
the population variance?
30
Statistical methods lecture note
Exercise 2: During annual checkups physician routinely send their patients to medical laboratories
to have various tests performed. One such test determines the cholesterol level in patients‟ blood.
However, not all tests are conducted in the same way. To acquire more information, a man was sent
to 10 laboratories and in each had his cholesterol level measured. The results are listed here.
Estimate with 95% confidence the variance of these measurements.
The objective of this session is to understand the logical framework for estimating the difference
between the means of two distinct populations. The basic concepts of estimation were explained in
the beginning of this chapter. A point estimate for the difference in two population means is simply
the difference in the corresponding sample means. A confidence interval for the difference in two
population means is computed using a formula in the same fashion as was done for a
single population mean. Suppose we wish to compare the means of two distinct populations. For
instance, we might wish to compare the mean corn crop yield for two different varieties of corn, the
mean annual income for two ethnic groups, the mean nitrogen content of two different lakes, or the
mean length of time between administration and eventual relief for two different anti vertigo drugs.
In many situations, we have to use independent random samples, paired random samples or two
population proportions from two populations to compare the parameters.
̅ ̅ ( +
̅ ̅
31
Statistical methods lecture note
Remark
i. If the population one and two are normal then,
̅ ̅
̅ ̅ ( ) , and
√
ii. If and ( ) assuming the two populations are normal (sample sizes
are small (n1<30) and (n2<30))
̅ ̅
̅ ̅ ( )
( ⁄ ⁄ )
̅ ̅
⁄ ⁄
√ ( )
( )
Consider the events
̅ ̅
⁄ ⁄
√ ( )
⁄ √ ( * ̅ ̅ ⁄ √ ( *
̅ ̅ ⁄ √ ( * ̅ ̅ ⁄ √ ( *
32
Statistical methods lecture note
( ̅ ̅ ⁄ √ ( * ̅ ̅ ⁄ √ ( *,
̅ ̅ ⁄ √ ( *
Note:
1. ̅ ̅ can be used as unbiased point estimator of
Since, ̅ ̅ ( )
2. These methods of comparison are applicable for, to discover new method of production,
medication, fertilizers/treatments etc.
Example: To compare the average of urban and rural students, independent random samples of
n1=18 of urban and n2=14 rural applicants to a college were selected. The mean scores were
calculated to be 65 for urban and 58 for rural applicants. Past experience reveals that admission test
scores for both urban and rural students have the same variance, . Then construct 95%
confidence interval for .
Solution: given ̅ ̅
⁄
Assuming that the score of both urban and rural students have normally distributed and the samples
are independent, then a 95% CI for .is:
̅ ̅ ⁄ √ ( *
√( *
Therefore, with 95% confidence, it can be stated that the difference in mean admission test score of
urban and rural applicants are in between -2.11 and 16.11 points and since this this interval contains
zero, we can also conclude that the two true mean score are equal.
Case II: Where and ( ); and the sample sizes are small. Then we
33
Statistical methods lecture note
̅ ̅
The CI can be derived by using the t-distribution similarly as before using the following probability
statement.
( ⁄ ⁄ )
̅ ̅
⁄ ⁄
√( )
( )
Therefore, a confidence interval for where but
( ).
̅ ̅
⁄ ⁄
√( )
⁄ √( * ̅ ̅ ⁄ √( *
̅ ̅ ⁄ √( * ̅ ̅ ⁄ √ ( *
( ̅ ̅ ⁄ √( * ̅ ̅ ⁄ √( *,
̅ ̅ ⁄ √( *
Example: The average monthly income for random sample of 16 male nurses is birr 1380 with
standard deviation of birr 240 and the average monthly income for random sample of 14 female
nurses is birr 1375 with standard deviation of birr 250. Assume that the populations are
approximately normally distributed and the variances are equal. Construct a 90% CI for the
difference between the average monthly income of all male and female nurses.
Solution: Given ̅ ̅
⁄
34
Statistical methods lecture note
Assuming that the populations have the same variance and normally distributed and the samples are
independent, then a 90% CI for .is:
̅ ̅ ⁄ √( * √( *
√( *
Therefore, a 90% CI for the difference between the average monthly income of all male and female
nurses is . We can also conclude that there is no difference in means income
between the two groups (male and female) as the interval contains zero.
Case III: Where but ( )
Where the true variance are not equal but known, the sampling distribution of ̅ ̅ is normal
̅ ̅ ( )
̅ ̅
̅ ̅ ⁄ √( )
Example: Consider the previous and further assume that the two population variances are unequal.
Construct a 90% CI for . The population variances are .
Solution: Given ̅ ̅
⁄
A confidence intervalfor is ̅ ̅ ⁄ √( )
35
Statistical methods lecture note
Case IV: Where but ( ), when they are not readily available, there
will be estimated by respectively. Further, when are small the distribution of
standardized form of ̅ ̅ is:
̅ ̅
Where
( ) becomes: ̅ ̅ ⁄ √( )
The methods which presented in the preceding sections were appropriate for situations in
independent random samples are obtained from the two populations. These methods are not
appropriate for studies or experiments in which each measurement in one sample is matched or
paired with a particular measurement in the other sample. In this section, we will deal with
methods for analyzing “paired” data. In paired comparison, we draw a random sample comprised
of pairs of observations.
Two samples are said to be paired if each data point in the first sample is matched and is related in a
unique data point in the second data point. By taking differences of observations in each pair we
can reduce the problem of comparing two population means to a one population problem.
The use of paired data in the repair estimate study will reduce the variability in the standard error of
the difference in the sample means in comparison to using independent samples.
In short, independent samples
Let
36
Statistical methods lecture note
We can make a one population mean inference on which is equivalent to comparing
The actual analysis of paired data requires us to compute the differences in the n pairs of
measurements, , and obtain, ̅ , the mean and standard deviations in the The
conditions are required for developing a t procedure to constructing confidence intervals for are
1. The sampling distribution of is a normal distribution.
2. The are independent; that is, the pairs of observations are independent.
If the samples are not independent and observations are taken in pairs, paired t-test is applicable.
Consider n-pairs of data points and let
where variance of the population of the
differences, then, in order to find the point and interval estimation of the difference, firstly
determine the difference between the two observations on each pair, making sure
you distinguish between positive and negative differences.
1. Calculate the mean difference, ̅ ∑ .
2. Calculate the standard deviation of the differences, , and use this to calculate the standard
∑ ̅
error of the mean difference, ̅
√
̅
3. Calculate the t-statistic, which is given by .
⁄
√
(̅ ̅
⁄ ⁄ ⁄ ⁄ )
√ √
Example: A dietitian wishes to see if a person‟s cholesterol level will change if the diet is
supplemented by a certain mineral. Six subjects were pretested, and then they took the mineral
supplement for a 6 week period. Assume the variable is approximately normally distributed and the
results are shown in the following table. Construct a 99% confidence interval for the true mean
difference.
Subject 1 2 3 4 5 6
Before 210 235 208 190 172 244
After 190 170 210 188 173 228
Solution
37
Statistical methods lecture note
A 100 (1-α) % confidence interval for the true mean difference is
(̅ ⁄ ⁄ ̅ ⁄ ⁄ ) ( )
√ √ √ √
Let a sample of large size n2, taken independently of the first sample has x2 successes or a
sample proportion of success ̂ from population 2, since n1 and n2 are large the sampling
distribution of both ̂ ̂ will be approximately normal by the central limit theorem. Thus
the sampling distribution of ̂ ̂ will also be approximately normal. Since it is a
combination of normally and independently distributed random variables.
The mean of ̂ ̂ ̂ ̂
̂ ̂ ̂ ̂
̂ ̂ √
i.e the samples from population 1 and samples from population 2 are independent, then
̂ ̂ ( *
Where ̂ ̂
̂ ̂
Thus, for large samples ̂ ̂ ̂ ̂
√
38
Statistical methods lecture note
Point and interval estimation about the difference between two Population Proportions
Suppose we have a random sample of size from a Bernoulli distribution with probability of
success and another random sample of size from a Bernoulli distribution with probability
of success .
In short, let
̂ ̂ ( *
̂ ̂
̂ ̂ ̂ ̂
√
̂ ̂ ̂ ̂
̂ ̂ ⁄ √
Example: A company test-markets a new product in the Grand Rapids, Michigan, and Wichita,
Kansas, metropolitan areas. The company‟s advertising in the Grand Rapids area is based almost
entirely on television commercials. In Wichita, the company spends a roughly equal dollar amount
on a balanced mix of television, radio, newspaper, and magazine advertising. Two months after the
advertising campaign begins, the company conducts surveys to determine consumer awareness of
the product.
Grand Rapids Wichita
Number of interviewed 2 3
Number of aware 1 2
Calculate a 95% confidence interval for the regional difference in the proportion of all consumers
who are aware of the product.
Solution: The sample awareness proportion is higher in Wichita, so let‟s make Wichita region 1.
39
Statistical methods lecture note
̂ ̂
̂ ̂ √
It is often desirable to compare two variances rather than two averages. For instance, two college
instructors are interested in whether or not there is any variation in the way they grade math exams.
It introduces a new probability density function called the F distribution which is used for many
applications including ANOVA and for testing equality across multiple means.
Let be the sample variance of independent observations from a population with variance
and be the sample variance of independent observations from a population with variance .
When we sampling from normally distributed populations, has an F distribution with
distributed populations.
Problem: An inference procedure for is based on the assumption of normally distributed
populations and can work very poorly if this assumption is violated.
Common point of interest is construct confidence interval for
2.4.2 Estimation of the ratio of the population variances
Point estimation: is the estimate of .
Interval Estimation:
40
Statistical methods lecture note
Suppose, be random sample of size from and be random
sample of size from . Moreover, X and Y are independently distributed. Then, a
confidence interval for the ratio of variance is given by:
( )
Proof
Finding the confidence interval for the ratio of the two population variances then
reduces, as always to manipulating the quantity in parentheses. Multiplying through the inequality
The confidence interval for the ratio of the two population variances reduces to:
( ) as was to be proofed.
Example: The feeding habits of two-species of net-casting spiders are studied. The species,
the deinopis and menneus, coexist in eastern Australia. The following summary statistics were
obtained on the size, in millimeters, of the prey of the two species:
Adult Dinopis ̅
Adult Menneus ̅
Then, estimate the 95% confidence interval for the ratio of the two population variances.
Solution:
41
Statistical methods lecture note
In order to estimate the ratio of the two population variances, we need to obtain two F-values from
the F-table, namely: and
Then, the 95% confidence interval for the ratio of the two population variances is:
( ) ( )
So, we are 95% confident that the ratio of the two population variances is between 0.433 and 7.033.
42
Statistical methods lecture note
Chapter Three
3.1 Introduction
Hypothesis testing is a form of statistical inference that uses data from a sample to draw
conclusions about a population parameter or a population probability distribution. It is an act in
statistics whereby an analyst tests an assumption regarding a population parameter. The
methodology employed by the analyst depends on the nature of the data used and the reason for the
analysis. The majority of statistical analyses involve comparison, most obviously between
treatments or procedures or between groups of subjects. The numerical value corresponding to the
comparison of interest is often called the effect. This is also one way of making inference about
population parameter, where the investigator has prior notion about the value of the parameter. The
purpose of hypothesis testing is to determine whether there is enough statistical evidence in favor of
a certain belief, or hypothesis, about a parameter. For instance,
1. Is there statistical evidence, from a random sample of potential customers, to support the
hypothesis that more than 10% of the potential customers will purchase a new product?
2. Is a new drug effective in curing a certain disease? A sample of patients is randomly selected.
Half of them are given the drug while the other half are given a placebo. The conditions of the
patients are then measured and compared.
3.1.1 Important concepts in testing statistical hypothesis
Statistical hypothesis: is an assertion or statement about the population whose plausibility is to be
evaluated on the basis of the sample data.
Test statistic: is a statistics whose value serves to determine whether to reject or accept the
hypothesis to be tested. It is a random variable (Z, t, χ2, F, etc.)
Statistic test: is a test or procedure used to evaluate a statistical hypothesis and its value depends on
sample data.
There are two types of hypothesis
Null hypothesis: It is the hypothesis to be tested or it is the hypothesis of equality or the hypothesis
of no difference and usually denoted by H0. or it can be research question to be tested. It is a
statement claiming that there is no difference between the hypothesized value and the population
value (the effect of interest is zero)
43
Statistical methods lecture note
Alternative hypothesis: It is the hypothesis available when the null hypothesis has to be rejected or
it is the hypothesis of difference and usually denoted by H1 or Ha. It is also a statement that
disagrees with the null hypothesis (the effect of interest is not zero).
Types and size of errors: Testing hypothesis is based on sample data which may involve type I
error and Type II errors.
The following table shows a summary of possible results of any hypothesis test:
Decision
44
Statistical methods lecture note
3.2 Hypothesis testing about a population mean and proportion
3.2.1 Hypothesis testing about a population
Suppose the assumed or hypothesized value of is denoted by 0 , then one can formulate two
sided (1) and one sided (2 and 3) hypothesis as follows:
1. H 0 : 0 vs H1 : 0
2. H 0 : 0 vs H1 : 0
3. H 0 : 0 vs H1 : 0
Cases to Select test Statistics
Case 1: When sampling is from a normal distribution with 2 known
After specifying α we have the following regions (critical and acceptance) on the standard
normal distribution corresponding to the above three hypothesis.
Summary table for decision rule
H1 Reject H0 if Accept H0 if Inconclusive if
0 Z cal Z 2 Z cal Z 2 Z cal Z 2 or Z cal Z 2
Where: Z cal X 0
n
45
Statistical methods lecture note
Where: t X 0
cal
S n
Case 3: When sampling is from a non- normally distributed population or a population whose
functional form is unknown.
If a sample size is large one can perform a test hypothesis about the mean by using:
X 0
Z cal , if 2 is known.
n
X 0
, if 2 is unknown.
S n
The decision rule is the same as case I.
Examples 1: Test the hypotheses that the average height content of containers of certain lubricant
is 10 liters if the contents of a random sample of 10 containers are 10.2, 9.7, 10.1, 10.3, 10.1, 9.8,
9.9, 10.4, 10.3, and 9.8 liters. Use the 0.01 level of significance and assume that the distribution of
contents is normal.
Solution: Let, Population mean. , 0 10
Step 1: Identify the appropriate hypothesis H 0 : 10 vs H1 : 10
Step 2: select the level of significance, 0.01 ( given)
Step 3: Select an appropriate test statistics
t- Statistic is appropriate because population variance is not known and the sample size is also
small.
Step 4: Computations:
X 10.06, S 0.25
X 0 10.06 10
t cal 0.76
S n 0.25 10
Step 5: identify the critical region.
Here we have two critical regions since we have two tailed hypothesis
The critical region is tcal t0.005 (9) 3.2498
(3.2498, 3.2498) is accep tan ce region.
Step 6: Decision
Accept H0, since tcal is in the acceptance region.
46
Statistical methods lecture note
Step 7: Conclusion: At 1% level of significance, we have no evidence to say that the average height
content of containers of the given lubricant is different from 10 litters, based on the given sample
data.
Examples 2: The mean life time of a sample of 16 fluorescent light bulbs produced by a company
is computed to be 1570 hours. The population standard deviation is 120 hours. Suppose the
hypothesized value for the population mean is 1600 hours. Can we conclude that the life time of
light bulbs is decreasing? (Use α=0.05 and assume the normality of the population)
Solution: Let μ=population mean,
Step 1: Identify the appropriate hypothesis
Step 2: select the level of significance,
Step 3: Select an appropriate test statistics
Z- Statistic is appropriate because population variance is known.
Step 4: Computations:
X 0 1570 1600
Z cal 1.0
n 120 16
Step 5: identify the critical region.
The critical region
Step 6: Decision: Accept H0, since Zcal is in the acceptance region.
Step 7: Conclusion
At 5% level of significance, we have no evidence to say that that the life time of light bulbs is
decreasing, based on the given sample data.
Exercise: It is known in a pharmacological experiment that rats fed with a particular diet over a
certain period gain an average of 40 gms in weight. A new diet was tried on a sample of 20 rats
yielding a weight gain of 43 gms with variance 7 gms2. Test the hypothesis that the new diet is an
improvement assuming normality.
a) State the appropriate hypothesis
b) What is the appropriate test statistic? Why?
c) Identify the critical region(s)
d) On the basis of the given information test the hypothesis and make conclusion. Solution
(exercise).
47
Statistical methods lecture note
3.2.2 Hypothesis testing about a population proportion
If we want to test whether a population proportion has a specified proportion value po, then the
hypotheses to be tested are:
Null hypothesis,
Alternative hypothesis, (i) (ii) (iii)
Test Statistic: Recall that the normal distribution can be used to approximate the binomial
distribution when np ≥ 5 and nq ≥ 5. Hence, the Z test can be used to test hypotheses for
proportion. The test statistics for proportion is given by:
̂
Where ̂ sample proportion, p is population proportion and n sample size
√ √ ⁄
Example: A survey was conducted to study the dental health practices, and attitudes of a certain
urban adult population. Of 300 adults interviewed, 123 said that they regularly had a dental
checkup twice a year. Can we conclude that the population proportion P= 0.5?
Solution: Let, , p 0 0.5
48
Statistical methods lecture note
devices and finds that four of them are defective. Can the manufacturer demonstrate process
capability for the customer?
Solution: We may solve this problem using the seven-step hypothesis-testing procedure as follows:
Let , p 0 0.05
This formulation of the problem will allow the manufacturer to make a strong claim about process
capability if the null hypothesis H 0 : p 0.05 is rejected.
• Where is the hypothesized value for the population variance and is sample variance
• Although the test statistic is the same for any test, the null and alternative hypotheses, the
critical value(s), and the decision rule will depend on the type of test being conducted.
1. Two-tail test
Null and alternative hypotheses:
49
Statistical methods lecture note
Critical values: Corresponding to upper-tail area of ,
reject .
2. Right tail test
Null and alternative hypotheses:
Critical values: corresponding to upper-tail area of
Decision rule: Reject if calculated ; otherwise, do not reject .
3. Left tail test
Null and alternative hypotheses:
Critical values: , corresponding to lower-tail area of ,
Decision rule: Reject if calculated ; otherwise, do not reject .
Example 1: A computer manufacturer requires that springs purchased for installation beneath its
keyboard keys have more than grams of variability in the amount of force required for key
depression. From a shipment of several thousand springs, a random sample of 20 springs is tested,
and the standard deviation is 7.78 grams. Assuming a normal distribution for the force required to
compress the springs, use the 0.01 level of significance in examining whether the shipment meets
the manufacturer‟s specifications.
Solution: The test is one-tail, since the computer manufacturer wishes to know whether the
population variance exceeds the amount that is acceptable.
1. Null and alternative hypotheses:
2. Assuming the population is normally distribution with
3. The test statistic is .
For , , and , the calculated value of the test statistic is
4. Critical region:
50
Statistical methods lecture note
5. Decision rule:
Since we reject null hypothesis
6. Conclusion
At the 0.01 level of significance, we reject and conclude that the shipment of springs does not
meet the computer manufacturer‟s specifications.
Example 2: A manufacturer of hard safety hats for construction workers is concerned about the
mean and the variation of the forces its helmets transmits to wearers when subjected to an external
force. The manufacturer has designed the helmets so that the mean force transmitted by the helmets
to the workers is 800 pounds (or less) with a standard deviation to be less than 40 pounds. Tests
were run on a random sample of n = 40 helmets, and the sample mean and sample standard
deviation were found to be 825 pounds and 48.5 pounds, respectively. Do the data provide
sufficient evidence, at α=0.05 level, to conclude that the population standard deviation exceeds 40
pounds?
4. Critical region:
5. Decision rule:
Since , then we reject the null hypothesis.
6. Conclusion: therefore, at 0.05 levels of significance we can conclude that there is sufficient
evidence to conclude the population standard deviation exceeds 40.
Exercise 1: With gasoline prices increasing, drivers are becoming more concerned with their cars‟
gasoline consumption. For the past 5 years, a driver has tracked the gas mileage of his car and
found that the variance from fill-up to fill-up was . Now that his car is 5 years old,
he would like to know whether the variability of gas mileage has changed. He recorded the gas
51
Statistical methods lecture note
mileage from his last eight fill-ups; these are listed here. Conduct a test at a 10% significance level
to infer whether the variability has changed.
Exercise 2: The lapping process which is used to grind certain silicon wafers to the proper
thickness is acceptable only if, the population standard deviation of the thickness of dice cut from
the wafers is at most 0.5 mil. Use the 0.05 level of significance to test the null hypothesis.
against the alternative hypothesis , if the thicknesses of 15 dice cut from such wafers
have a standard deviation of 0.64 mil.
3.4 Testing the difference between two population means and proportion
3.4.1 Test about the difference between two population means
In studies about the comparison of two groups usually a hypothesis testing on is made
whenever we want to compare two population means or two treatments on the same population.
This comparison of means can be accomplished in two ways:
I. Comparison of two independent samples
II. Comparison of two paired samples
I. Comparison of means in two independent samples
In many sampling situation independent random samples are drawn from two populations to make
inference concerning the population parameters. The difference in the corresponding sample
statistic is often used as a test statistic. In situations where we are making inference about the
difference in the population means based on independent random samples we use the
data from the two samples to compare the two populations mean .
Note: Two samples are said to be independent the data point in one sample are unrelated to the data
point in the other sample.
In particular we will estimate or test the hypothesis concerning
Suppose that X1, X2, …Xn be a random sample drawn from normal population one with mean
and variance andLet Y1, Y2, …Yn be another random sample drawn from normal
population two with mean and variance and the two samples are independent.
The sampling distribution of ̅ ̅ is used to make a hypothesis testing on
In addition, the distributions have the following different (possible) hypothesis:
52
Statistical methods lecture note
The test statistics depends on the sampling distribution of ̅ ̅ which in turn depends on whether
or whether these true variances are known or estimated or sample size
large or small.
To test at α-level of significance we consider the following
cases:
Case I: If and ( ), then the test statistics becomes:
̅ ̅
√ ( )
Case II: Where but ( ) and the sample sizes are small, we estimate it
by . The pooled variance
53
Statistical methods lecture note
Step 2: select the level of significance,
Step 3: Select an appropriate test statistics
Since the population has the same variance but it is unknownand the sample size is also small,
we can estimate by and we use t- Statistic is the appropriate.
Step 4: Computations: ̅ ̅
X Y 22,400 21,800
tcal 1.884
1 1 1 1
SP 842.5
n1 n2 14 14
̅ ̅ ( +
The rejection regions for known common variance are applicable: i.e. reject Ho, if
| | ⁄
54
Statistical methods lecture note
Case IV: Where but ( ), implies that the sample sizes are small,
and then the population variance can be estimated by the corresponding sample variances.
However, the test statistic will have an approximate t-distribution with V degree of freedom.
̅ ̅
( *
√
The rejection region becomes the same with unknown variance but with degree of freedom is :
i.e. reject Ho, If
| | ⁄
Example: An experiment has been conducted at a certain university to compare the mean number
of studies hours spend by male students with that of female students. Random samples of 55 male
students produced a mean 20.6 hr/week and standard deviation is 5.3 hr/week. The second random
samples of 75 female students produced a mean 23.5 hr/week and standard deviation is 4.1 hr/week.
Do the samples provides sufficient evidence to conclude that there is different in mean number of
hours of studied per week between male and female students? Use α = 0.05
Solution: ̅ ⁄ ⁄
̅ ⁄
Step 1: Identify the appropriate hypothesis
Step 2: select the level of significance, 0.05 ( given)
Step 3: Select an appropriate test statistics
Since the population have different variance but ( ) and the sample
size is large, we use Z- Statistic is the appropriate.
Step 4: Computations:
X 20.6 Y 23.5
X Y 20.6 23.5
Z cal 3.946
2 2
S S 5.3 2 4.12
1
2
n1 n2 55 75
1. An experiment was interested in dieting and weight losses among men and women. It was
believed that in the first two weeks of a standard dieting program, women would tend to lose
more weight than men. As a check on this notation, a random sample of 15 husband and wife
pairs were put in the same strenuous diet, there weight losses in pounds after two weeks should
the following sample information:
Husbands Wife
̅ ̅
Did the wife lose significantly more than husbands? Use α = 0.05
3. An experiment was conducted to evaluate the effectiveness of a treatment for tapeworm in the
stomachs of sheep. A random sample of 24 worm-infected lambs of approximately the same age
and health was randomly divided into two groups. Twelve of the lambs were injected with the
drug and the remaining twelve were left untreated. After a 6-month period, the lambs were
slaughtered and the worm counts were recorded in Table
Drug-treated Sheep 18 43 28 50 16 32 13 35 38 33 6 7
56
Statistical methods lecture note
Untreated Sheep 40 54 26 63 21 37 39 23 48 58 28 39
A) Test whether the mean number of tapeworms in the stomachs of the treated lambs is less
than the mean for untreated lambs. Use α =0.05 test.
B) Place a 95% confidence interval on to assess the size of the difference in the two
means.
4. Company officials were concerned about the length of time a particular drug product retained its
potency. A random sample of n1= 10 bottles of the product was drawn from the production line
and analyzed for potency. A second sample of n2 = 10 bottles was obtained and stored in a
regulated environment for a period of 1 year. The readings obtained from each sample are given
in Table
Fresh Stored
10.2 10.6 9.8 9.7
10.5 10.7 9.6 9.5
10.3 10.2 10.1 9.6
10.8 10.0 10.2 9.8
9.8 10.6 10.1 9.9
Suppose we let μ1denote the mean potency for all bottles that might be sampled coming off the
production line and let μ2 denote the mean potency for all bottles that may be retained for a
period of 1 year. Estimate by using a 95% confidence interval.
II. Comparison of two paired samples
The methods we presented in the preceding sections were appropriate for situations in which
independent random samples are obtained from two populations. These methods are not appropriate
for studies or experiments in which each measurement in one sample is matched or paired with a
particular measurement in the other sample. In paired comparison, we draw a random sample
comprised of pairs of observations. By taking differences of observations in each pair we can
reduce the problem of comparing two population means to a one population problem.
The use of paired data in the repair estimate study will reduce the variability in the standard error of
the difference in the sample means in comparison to using independent samples.
The actual analysis of paired data requires us to compute the differences in the n pairs of
measurements, , and obtain, ̅ , the mean and standard deviations in the
Also, we must formulate the hypotheses about μ1 and μ2 into hypotheses about the mean of the
57
Statistical methods lecture note
differences, . The conditions required developing a t procedure for testing
hypotheses and constructing confidence intervals for are
1. The sampling distribution of the is a normal distribution.
2. The are independent; that is, the pairs of observations are independent.
Comparison of means in paired samples
If the samples are not independent and observations are taken in pairs, paired t-test is applicable.
Consider n-pairs of data points and let
where variance of the population of the
differences, then to test the null hypothesis that the true mean difference is zero, the procedure is as
follows:
a. Calculate the difference between the two observations on each pair, making
sure you distinguish between positive and negative differences.
b. Calculate the mean difference, ̅ ∑
c. Calculate the standard deviation of the differences, , and use this to calculate the standard
∑ ̅
error of the mean difference, ̅
√
̅
d. Calculate the t-statistic, which is given by . Under the null hypothesis, this statistic
⁄
√
2.
3.
Where and ̅
58
Statistical methods lecture note
The hypothesis is of equal treatment effect is stated as and the
appropriate test statistics will be
̅
⁄
√
The null hypothesis is rejected at α-level of significance
1. | | ⁄
2.
3.
Example 1: Suppose a sample of 20 students were given a diagnostic test before studying a
particular module and then again after completing the module. The following results were obtained:
A) Is there sufficient evidence to conclude that the teaching leads to improvements in students‟
knowledge/skills (i.e. test scores)?
B) Construct a 95% confidence interval for the true mean difference?
Pre-mod Pos-mod Pre-mod Pos-mod
Students score score difference Students score score difference
1 18 22 4 11 14 15 1
2 21 25 4 12 16 15 -1
3 16 17 1 13 16 18 2
4 22 24 2 14 19 26 7
5 19 16 -3 15 18 18 0
6 24 29 5 16 20 24 4
7 17 20 3 17 12 18 6
8 21 23 2 18 22 25 3
9 23 19 -4 19 15 19 4
10 18 20 2 20 17 16 -1
Solution a
Step 1: Identify the appropriate hypothesis
Or
Step 2: select the level of significance, given
Step 3: Select an appropriate test statistics
59
Statistical methods lecture note
Since the population variance is unknown and the sample size is also small, we can estimate by
and we use t- statistic is the appropriate.
Step 4: Computations:
∑
̅
∑ ̅
̅
Therefore, ̅ ⁄
√ √ ⁄
√
Step 5: Identify the critical region, since we have one tailed hypothesis
Step 6: Decision: We Reject H0, since tcal= 3.231 is in the rejection region.
Step 7: Conclusion: Therefore, there is strong evidence that, at α = 0.05 level of significance, on
average, the module does lead to improvements in students‟ knowledge/skills (i.e. on test scores).
Solution b, given from solution a
̅ ̅ ⁄
√ √
⁄
The 95% confidence interval for the true mean difference is therefore:
̅ ̅ , where ⁄ ̅ ⁄
√
This confirms that, although the difference in scores is statistically significant, it is actually
relatively small. We can be 95% sure that the true mean increase lies somewhere between just under
one point and just over 3 points.
Example 2: A physical education director claims by a taking a special vitamin, weight lifter can
increase his strength. Eight athletes are selected and given a test of strength, using the standard
bench press. After two weeks of regular training, supplemented with the vitamin, they are tested
again. Tests the differences of the vitamin regimen at 5% significance level; each value in the data
represents the maximum number of pounds the athlete can bench press. Assume that variable is
approximately normally distributed.
Athlete 1 2 3 4 5 6 7 8
60
Statistical methods lecture note
Before (X1) 210 230 182 205 262 253 219 216
After (X2) 219 236 179 204 270 250 222 216
Di=X1-X2 -9 -6 3 1 -8 3 -3 0
Solution
Step 1:
Step 2: 0.05 ( given)
Step 3: Since the population variance is unknown and the sample size is also small, we can
estimate by and we use t- Statistic is the appropriate.
Step 4: Compute the differences as D = X1- X2and find the mean of the difference as
-9, -6, 3, 1, -8, 3, -3, 0 and ∑ Di= -19
∑ ∑ ̅
Computations: ̅ √
Therefore, ̅ ⁄
√ √
̅
The test statistics becomes
⁄
√
Step 5: Here we have one critical region since we have one tailed hypothesis
Step 6: We do not reject Ho at 5% significance level, since tcal= -1.388is in the acceptance region.
Step 7: Therefore, there is no enough evidence to support the claim that the vitamin increases the
strength of weight lifters.
Exercise 1: Listed below are sample results of self-reported and measured male heights:
Reported: 68 71 63 70 71 60 65 64 54 63 66 72
Measured: 67.9 69.9 64.9 68.3 70.3 60.6 64.5 67 55.6 74.2 65 70.8
a) Is there sufficient evidence to support the claim that there is a difference between self-reported
heights and measured heights of males? Use a 0.05 significance level.
b) Construct a 99% confidence interval for the difference between the means of the self-reported
and measured male heights.
Exercise 2: A dietarian wishes to see if a person‟s cholesterol level will change if the diet is
supplemented by a certain minerals. Six subjects were pre-tested, and then they took the mineral
supplement for a six week period. The results are shown in the table below. Cholesterol level is
61
Statistical methods lecture note
measured in milligrams per deciliter. Can it be concluded that the cholesterol level has been
changed at 10% significance level. Assume the variable is normally distributed.
Subjects 1 2 3 4 5 6
Before (X1) 210 235 208 190 172 244
After (X2) 190 170 210 188 173 228
students who are on probation, divided by the number of students who attend the college.
Testing the claim that there is no significant difference between the proportions of successes for the
two populations is to be used the following tests:
1.
2.
3.
When testing a hypothesis made about two population proportions based on large sample size, the
null hypothesis is . There is no need to estimate the individual parameters p1 and p2, it
enough to estimate their common value with the pooled sample proportion. Weighted estimate of p1
̂ ̂
and p2 is ̂ and the standard deviation ̂ ̂ √ ̂̂
Thus, we have two different estimators for the standard error of ̂ ̂ , which depend upon the
null hypothesis.
Case 1: The test statistic for two proportions with is
62
Statistical methods lecture note
̂ ̂ ̂ ̂
̂̂ ̂̂
√ √ ̂̂( )
The following conditions are necessary to use a z-test to test such a difference between the two
population proportions.
1. Samples are randomly selected.
2. n1p1 ≥ 5, n1q1 ≥ 5, n2p2 ≥ 5, and n2q2 ≥ 5
3. Samples are independent.
The rejection regions are:
1. | | ⁄
2.
3.
Example 1: A consumer packaged goods company wants to test the marketing practice of two new
versions of soap packaging. Version one (bright colors) is distributed in one supermarket, while
version two (simple colors) is in another.
Using , Do the data provided sufficient evidences that the first version is more expensive
or (Do the data provided the sufficient evidence it must outsell the other design that is its market
share, p1, must be greater than that of the other soap package design, i.e. p2.)
Solution
Step 1: Our null hypothesis is H0: (p1–p2) = 0 Vs H1: (p1–p2) > 0
Step 2: α = 0.05 and Zα = Z0.05=1.645
Step 3: The appropriate test statistics is Z and we use case 1
Step 4: The value of our z-statistic
63
Statistical methods lecture note
̂ ̂
√ ̂̂( ) √ ( )
64
Statistical methods lecture note
α= 0.05, test the claim that there is no difference in the proportions of the small and large
nursing homes with a resident vaccination rate of less than 80%.
2. A candidate for political office wants to determine whether there is a difference in his popularity
between men and women. To establish the existence of this difference, he conducts a
sample survey of voters. The sample contains 250 men and 250 women, of which 42% of the
men and 51% of the women favors his candidacy. Do these values indicate a difference in
popularity?
Paired Samples Comparison of Proportion
Consider n pair of sample points from binomial populations where each members of a pair is either
a success or a failure such data are often given as follows:
Population 1 Population 2 Number of pairs in the samples
S S nSS
S F nSF
F S nFS
F F nFF
N
To test the claim that proportion of sample is the same for the two populations, that is to test:
An appropriate test statistics is either
| |
a. and Ho is rejected atα level of significance if | | or
| |
b. and Ho is rejected atα level of significance if | | ⁄
√
Example: Consider two groups A and B of workers to be assigned for a certain task, a sample of
100 paired workers (based on some criteria of pairing), will take and subjected and subjected to the
task. The results were given as follows:
A B Number of pairs
S S 52
S F 21
F S 9
F F 18
100
Test whether the proportion of success is same for the groups of workers use α = 0.05
65
Statistical methods lecture note
Solution: let PA= the population proportions of success for group A.
PB= the population proportions of success for group B
Step 1: The hypothesis to be tested is
Step 2: α = 0.05 and
Step 3: The appropriate test statistics is
Step 4: The value of our -statistic is
| | | |
| | | |
√ √ √
Therefore, we conclude that reject because | | ⁄
3.5 Sample size determination for one population and comparative experiment
3.5.1 Sample size determination for one population
3.5.1.1 Sample size determination to estimate population Mean, µ
Since X is the point estimator of µ, we can define the error in this estimate as E = X and
hence we can be 100 (1-α) % confident that error will not exceed the maximum error of the
estimate, E, i.e. X E
From the expression E Z / 2 the minimum sample size required to estimate population mean,
n
µ is given by: n
Z / 2 2 it obtained by using the above bound E.
E2
Note: determining the sample size to estimate µ requires knowledge of the population variance 2
(standard deviation,). We can obtain an approximate sample size by estimating 2, using one of
the two methods:
1. Employ information from a prior experiment or a pilot study to calculate a sample
variance S2. This value used to approximate 2.
66
Statistical methods lecture note
2. Use the information on the range of the observation to obtain an estimate of . An
advance guess at the population standard deviation
Note: if necessary, round the answer up to obtain a whole number. That is, if there is any
fraction or decimal portion in the answer, use the next whole number for sample size n.
If population standard deviation is not known use the sample standard deviation (S) obtained from
the sample.
⁄
( )
Example: A college wants to use the mean of a random sample to estimate the average amount of
time students take to get from one class to the next class and he wants this estimate to be in error at
most 0.25 minutes with probability 0.95 and knowing that =1.5minutes from previous studies.
What will the size of the sample that fulfills his needs?
Solution:
⁄
⁄
Then, * +
pˆ qˆ
we can be (1-α) 100% confident that the error will not exceed, i.e. E P pˆ Z / 2
n
Minimum sample size required to estimate a population proportion p with 100 (1−α) % confident
that error will not exceed an amount E is given by:
pˆ qˆ Z
From above expression E Z / 2 we have n pˆ qˆ / 2 2 is required to estimate P
n E
Note: Since p is not known, there are two situations
1. If the estimated ̂ is given, we use this value. And,
2. If the estimated ̂ is not given, we should use ̂
Example: A researcher wishes to estimate, with 95%confidence the proportion of people who own
a home computer. Previous study shows that 40% of those interviewed had computer at home. The
researcher wishes to be accurate within 2% of the true proportion. Find the minimum sample size
necessary
67
Statistical methods lecture note
Solution:
Given that ̂ = 40% = 0.40, ̂ = 0.60 and E = 2% = 0.02,
For 95% confidence the value of Zα/2= 1.96
Z 1.96 2
Then substituting in the formula, we get n pˆ qˆ / 2 2 0.4 * 0.6
E 0.02
Which, when rounded up, is 2305 people to interview
Exercise: A confidence interval for population proportion is too constructed and must be accurate
within 0.01. What is the largest sample size needed to provide the desired accuracy with 95%
confidence?
3.5.2 Sample size determination in comparative experiments
The quantity of information available for a statistical test about μ is measured by the magnitudes of
the Type I and II error probabilities, α and β, for various values of μ in the alternative hypothesis Ha
Some time it may be necessary to look for a feasible sample size, which can be obtained. If the
following are known:
a) A value that represent the size of the difference between the true effects of the treatment,
regarded as important | |
b) The high probability which shows a significant difference between the treatment means, that is
high power of test, usually set at 0.8(80%) or 0.9(90%) and sometimes 0.95 and 0.99 usually
denoted by pʹ
c) The level of significance, α.
d) A known population standard deviation,
e) For a paired comparison the sample size in comparative experiment will be:
( ⁄ ) | |
( )
For two independent samples of size n each with equal population variance,
( ⁄ ) | |
Note: When are not known and are estimated from past records or guessed the following
approximation given a good result.
68
Statistical methods lecture note
1. Find to one decimal places using the formula when is known
2. For test of significance at 5% or 10% levels, increase the number of pair with paired
samples and the size
3. For test 1% level, change this increase to 3 paired sample and 2 for independent sample.
Example 1: In an experiment two independent sample the investigator using a one tailed test at 5%
level and wanted a 90% chance of getting a significant difference if . What
should be the sample size? Assuming that, the populations have the same variance.
Solution:
Then, ( ⁄ )
Example: In planning a paired experiment the investigator proposes to use one tailed test of
significance at the 5% level and wants the probability of finding a significant difference to be 0.9.
i.
ii. . How many pairs are needed? In each case give the answer if
A.
B.
Solution: i. a)
( )
i. b)
ii. a) . ( )
ii. b) ( )
Example: If how many pairs are needed to make the half width the 90% confidence
interval for the difference between the two populations means equal?
Solution: the 100(1-α) % confidence interval for is
̅ ̅ ̅ ̅ , Where ⁄ √
Half-length of interval is ⁄ √
Given:
69
Statistical methods lecture note
⁄
⁄ ⁄
Thus, ( ) ( )
√
We assume that the population standard deviation for the paired samples and for independent
samples is known. We also that developing a formula for n in pair comparison when
testing
The null hypothesis is rejected at α level of significance. If | | ⁄ where
̅
that is is rejected at α level of significance.
√
̅ ̅
If ⁄ ⁄
√ √
̅
⁄ is equivalent to ̅ ⁄ √
√
⁄
⁄ ⁄ ̅ √
(̅ ) (̅ )
√ √
√ √
( )
√
( ⁄ )
√
Thus, ( ⁄ )
√
⁄
√ ⁄
⁄
( )
Note:
For independent comparison is replaced by
⁄
For two tailed tests in paired comparison , where ⁄
Where is unknown and are estimated from the results of the experiment t-tests replace
Z-test. In this case the formula for n will be an equation that must be solved by successive
approximation.
For practical purpose the following method is satisfactory
70
Statistical methods lecture note
1. Find m, the multiplier of using the table below
Find
2. For tests of significance at 5% or 10% levels increase the number of pairs by 2 with paired
samples and the size each sample by 1 with independent samples.
3. For the test at the 1% level, change these increased to 3 for paired and 2 for independent
That is,
These values for are given when is estimated and Z-test is used. To estimate , the investigator
must apply the following information:
A. The value of
B. The desired probability P of obtaining a significant result when
C. The level of significance
Suppose we have two independent samples from two populations having variances .
We want to test null hypothesis that the two population variances are equal.
The F-Distribution
When the two populations are normal with and sample sizes, then the random variable
Where: is the degrees of freedom associated with and is the degrees of freedom
associated with .
Properties of F-Distributions
72
Statistical methods lecture note
Which gives,
Where represents the upper α quantile of the F-distribution with degrees of
freedom respectively. For example, if we know
Then we have
1.
2.
3.
( )
Test Statistic:
Rejection rule:
The decision rule that the hypothesis to be tested as specify above given as:
For given ,
1. Reject
2. Reject
3. Reject
p -Value approach:
Reject
73
Statistical methods lecture note
the researchers measured plasma estrogen (in nanograms/deciliter) for each monkey. The results are
shown below.
Solution:
4. Test statistic:
5. Critical region
and
6. Decision: Reject
Since we do not reject
7. Conclusion: Using we do not reject and conclude that we have no reason to doubt
the variation in plasma estrogen level is similar for the alcohol and control group.
Exercise 1: A medical researcher wishes to see whether the variance of the heart rates (in beats per
minute) of smokers is different from the variance of heart rates of people who do not
smoke. Two samples are selected, and the data are as shown. Using , is there enough
evidence to support the claim?
Smokers Nonsmokers
Exercise 2: The standard deviation of the average waiting time to see a doctor for non-life
threatening problems in the emergency room at an urban hospital is 32 minutes. At a
second hospital, the standard deviation is 28 minutes. If a sample of 16 patients was used
in the first case and 18 in the second case, is there enough evidence to conclude at the
74
Statistical methods lecture note
0.01 significance level that the standard deviation of the waiting times in the first hospital
is greater than the standard deviation of the waiting times in the second hospital?
75
Statistical methods lecture note
Chapter Four
4. Chi-Square Tests
4.1 Introduction
The statistical procedures that you have studied so far are appropriate only for variables at the
interval and ratio levels of measurement. The chi-square (χ2) test can be used to evaluate a
relationship between two nominal or ordinal variables. The purpose of chi-square test is to find
out whether the associations between two categorical variables are statistically significant. The Chi-
square test is used to test:
Testing independence (or association)
Testing for homogeneity
Testing of goodness-of-fit
Example: the independent variables that meet this criterion include gender (2 groups: Males and
Females), ethnicity (e.g., 3 groups: Caucasian, African American and Hispanic), physical activity
level (e.g., 4 groups: sedentary, low, moderate and high), profession (e.g., 5 groups: surgeon,
doctor, nurse, dentist, therapist), and so forth.
1. Verify Assumptions
2. Identify the claim. State the null and alternative hypotheses.
3. Specify the level of significance.
4. Calculate the test statistic.
5. Determine the critical value.
6. Make a decision to reject or fail to reject the null hypothesis.
7. Interpret the decision in the context of the original claim.
76
Statistical methods lecture note
4.2 Test of association
It examines the relationship between two categorical variables to determine if they are independent.
Two variables are said to be independent if there is no relationship between them and dependent if
there is a relationship. Similar to the correlation coefficient, except that instead of both variables
being continuous, both variables are categorical. In the Chi-Square test of independence the
frequency of one nominal variable is compared with different values of the second nominal
variable. Suppose we have a population consisting of observations having two attributes or
qualitative characteristics say A and B.
Suppose A has r mutually exclusive and exhaustive classes and B has c mutually exclusive and
exhaustive classes.
The entire set of data can be represented using c *r contingency table.
B
A B1 B2 . . Bj . Bc Total
A1 O11 O12 O1j O1c R1
A2 O21 O22 O2j O2c R2
.
A .
Ai Oi1 Oi2 Oij Oic Ri
.
.
Ar Or1 Or2 Orj Orc
Total C1 C2 Cj n
77
Statistical methods lecture note
r (Oij eij ) 2
c
cal ~ ( r 1)( c 1)
2 2
i 1 j 1 eij
Decision Rule: Reject H0 for independency at α level of significance if the calculated value of
2 exceeds the tabulated value with degree of freedom equal to (r 1)(c 1) .
(Oij eij ) 2
r c
Reject H 0 if cal 2
2 ( r 1)( c1) at
i 1 j 1
e ij
Examples 1: A geneticist took a random sample of 300 men to study whether there is association
between father and son regarding boldness. He obtained the following results.
Son
Bold 85 59
Not 65 91
Using 5% , test whether there is association between father and son regarding boldness.
Solution:
78
Statistical methods lecture note
H 0 : There is no association between Father and Son regarding boldness.
H1 : not H 0
Ri * C j
- Then calculate the expected frequencies( eij‟s) using eij
n
2 2 (Oij eij ) 2 (85 72) 2 (59 72) 2 (65 78) 2 (91 78) 2
2 cal 9.028
i 1 j 1
e ij
72 72 78 78
0.05
Degreesof freedom (r 1)(c 1) 1*1 1
02.05 (1) 3.841 from table.
- The decision is to reject H0 since 2 cal 02.05 (1)
Conclusion: At 5% level of significance we have evidence to say there is association between
father and son regarding boldness, based on this sample data.
Example 2: Random samples of 200 men, all retired were classified according to education and
number of children is as shown below.
Elementary 14 37 32
Secondary and above 31 59 27
Test the hypothesis that the size of the family is independent of the level of education attained by
fathers. (Use 5% level of significance).
79
Statistical methods lecture note
Solution:
H 0 : There is no association between the size of the family and the level of education attained by fathers.
H1 : Not H 0 .
First calculate the row and column totals
H0: two or more populations have the same proportion of individuals with some characteristics.
H1: At least one of the population proportions is different from the others.
80
Statistical methods lecture note
Example 1: The following question was asked of a random sample of individuals in 1992, 1998,
and 2001: “Would you tell me if you feel being a teacher is an occupation of very great prestige?”
The results of the survey are presented below:
Test the claim that the proportion of individuals that feel being a teacher is an occupation of very
great prestige is the same for each year at the level of significance.
Solution:
1. Null and alternative hypothesis
H0: the proportions of individuals who feel teaching is an occupation of very great prestige in
each year are equal.
H1: the proportions of individuals who feel teaching is an occupation of very great prestige in
each year are not equal.
2. Calculate the expected frequencies (counts) for each cell in the contingency table.
Observed Frequency
Expected Frequency
3. Verify the requirements for the chi-square test for homogeneity are satisfied.
(1) Data is randomly selected.
(2) All expected frequencies are greater than or equal to 1.
(3) 80% of the expected cell counts are greater than or equal to 5.
4. Select a proper level of significance
5. Compute the test statistic and P-Value.
81
Statistical methods lecture note
6. Compare the critical to test statistic.
If reject the null hypothesis or , reject the null hypothesis.
7. Conclusion
Therefore I would fail to reject the null hypothesis.
The data is not statistically significant and we cannot conclude that the proportions of individuals
who feel teaching is an occupation of very great prestige is different each year.
Example 2: In a study of the television viewing habits of children, a developmental psychologist
selects a random sample of 300 first graders 100 boys and 200 girls. Each child is asked which of
the following TV programs they like best: The Lone Ranger, Sesame Street, or The Simpsons.
Results are shown in the contingency table below.
Viewing Preferences
Total
Lone Ranger Sesame Street The Simpsons
Boys 50 30 20 100
Girls 50 80 70 200
Total 100 110 90 300
Do the boys' preferences for these TV programs differ significantly from the girls' preferences? Use
a 0.05 level of significance.
Solution
H0: Pboys who prefer Sesame Street = Pgirls who prefer Sesame Street
H0: Pboys who prefer The Simpsons = Pgirls who prefer The Simpsons
H1: At least one of the null hypothesis statements is false.
Significance level is 0.05.
82
Statistical methods lecture note
Chi square calculated is 19.39 and tabulated value is at 2 degrees of freedom is 5.991.
Interpret results: since the calculated value is greater than the tabulated value, we reject the null
hypothesis.
Conclusion: At 0.05 level of significance we have an evidence to say that the boys preferences
for TV programs is significantly different from the girls preferences.
Goodness of fit test is likely to be performed by people who have a theory of what the proportions
should be in each category. It is used to see whether a frequency distribution fits a specific pattern.
Goodness of fit test also involves only one categorical variable. The goodness-of-fit test expands
the one-proportion z-test. In the Chi-Square test of goodness of fit frequency of one nominal
variable is compared with the theoretical expected frequency. The test statistic (χ2) examines
whether the proportions in the sample reliably differ from the null hypothesis. The null hypothesis
specifies the proportion of the population in each category. It determines how well sample data
conform to proportions set forth by the null hypothesis.
Example: A large group of employees (250+) has birthdays recorded by zodiac sign. Since there
are 12 signs of the zodiac, we should expect 1/12 of the employees to have each of the signs.
Where
Example 1: suppose that a market analyst wished to see whether customer has any preference
among five flavors of a new fruit soda. A sample of 100 people provides this data. Use
Solution
83
Statistical methods lecture note
If there were no preference, you would expect each flavor to be selected with equal frequency. In
this case the equal frequency is 100/5=20. That is approximately 20 people would select each
flavor. Since the frequencies for each flavor were obtained from a sample, this actual frequency is
called the observed frequency. The frequencies obtained by calculation (if there is no preference)
are called the expected frequency.
Step 4: Making decision: The decision is to reject the null hypothesis, since .
Step 5: Conclusion: There is enough evidence to reject the claim that consumers show no
preference for the flavor.
Example 2: In consumer marketing, a common problem that any marketing manager faces is the
selection of appropriate colors for package design. Assume that a marketing manager wishes to
compare five different colors of package design. He is interested in knowing if there is a preference
among the five colors so that it can be introduced in the market. A random sample of 400
consumers reveals the following. Do the consumer preferences for package colors show any
significant difference?
Solution:
84
Statistical methods lecture note
Package Color Red Blue Green Pink Orange
Expected counts 80 80 80 80 80
3. Verify the requirements for the chi-square test for goodness of fit are satisfied.
(1) Data is randomly selected
(2) All expected frequencies are greater than or equal to 1
(3) 80% of the expected cell counts are greater than or equal to 5.
4. Select a proper level of significance
5. Compute the test statistic and P-value
Exercise 1: A study of 667 drivers who were using a cell phone when they were involved in a
collision on a weekday examined the relationship between these accidents and the day of the week.
Are the accidents equally likely to occur on any day of the working week?
85
Statistical methods lecture note
Chapter Five
5. Analysis of Variance (ANOVA)
5.1 Introduction
The purpose of ANOVA is much the same as the t tests presented in the preceding sessions. The
difference between ANOVA and the t tests is that ANOVA can be used in situations where there
are two or more population means being compared, whereas the t tests are limited to situations
where only two population means are involved. Analysis of variance is necessary to protect
researchers from excessive risk of a Type I error in situations where a study is comparing more than
two population means. These situations would require a series of several t tests to evaluate all of the
mean differences. Remember, a t test can compare only two means at a time. Although each t test
can be done with a specific α-level (risk of Type I error), the α-levels accumulate over a series of
tests so that the final experiment wise α-level can be quite large.
Assumptions of ANOVA
Violating the assumption of a common variance is more serious, especially when the sample sizes
are not nearly equal.
5.2 Test of hypothesis about the equality of more than two population means
The ANOVA is used to test whether or not there is a statistically significant difference among the
population means of two or more groups. ANOVA allows researcher to evaluate all of the mean
differences in a single hypothesis test using a single α-level and, thereby, keeps the risk of a Type I
error under control no matter how many different means are being compared.
The test statistic for ANOVA is an F-ratio, which is a ratio of two sample variances. In the context
of ANOVA, the sample variances are called mean squares, or MS values. The top of the F-ratio
Mean Square between measures the size of mean differences between samples. The bottom of the
ratio is Mean Square with in measures the magnitude of differences that would be expected without
any treatment effects.
86
Statistical methods lecture note
Thus, the F-ratio has the same basic structure as the independent-measures t statistic.
We might think that to compare the means of three or more samples, we can use the t test
comparing two means at a time. But there are several reasons why the t test should not be done.
1) When you are comparing two means at a time, the rest of the means under study are ignored.
With the F test, all the means are compared simultaneously.
2) When you are comparing two means at a time and making all pair wise comparisons, the
probability of rejecting the null hypothesis when it is true is increased, since the more t tests
that are conducted, the greater is the likelihood of getting significant differences by chance
alone.
3) The more means there are to compare, the more t tests are needed.
For example: For the comparison of 3 means two at a time, 3 t tests are required.
For the comparison of 5 means two at a time, 10 tests are required.
For the comparison of 10 means two at a time, 45 tests are required.
One-way ANOVA
In a one-way ANOVA, there is only one independent variable. The data to be analyzed are
obtained from either (1) a random sample of subjects who belong to different groups or (2) an
experiment in which the subjects are randomly assigned to one of several groups.
Suppose we want to compare k population means, , based on independent random
samples of size from normal populations with a common variance . That is,
each of the normal populations has the same shape, but their locations might be different.
The null hypothesis being tested here is that the population group means are equal to one
another.
If the null hypothesis is true, the adjusted among (between) and within group variations should
be similar.
87
Statistical methods lecture note
If the null hypothesis is false, the adjusted among (between) groups variation should be larger
than the adjusted within-group variation because it includes variation between the populations
as well as the within-group variation.
Even though you are comparing three or more means in this use of the F test, variances are used
in the test instead of means.
With the F test, two different estimates of the population variance are made.
The first estimate is called the between-group variance, and it involves finding the variance of
the means.
The second estimate, the within-group variance, is made by computing the variance using all the
data and is not affected by differences in the means.
If there is no difference in the means, between-group variance estimate will be approximately
equal to the within-group variance estimate, and the F test value will be approximately equal to
one. The null hypothesis will not be rejected.
However, when the means differ significantly, between-group variance will be much larger than
the within-group variance; the F test value will be significantly greater than 1; and the null
hypothesis will be rejected.
Since variances are compared, this procedure is called analysis of variance (ANOVA).
One-Way ANOVA
∑( ̅)
Variation due to treatment: sum of square among or sum of square between treatments or among
groups variation.
Variation due to random sampling: sum of squares within or sum of squares error or within
group variation.
Computing Formulas
(∑ ) (∑ )
∑
(∑ )
∑
For a test of the difference among three or more means, the following hypotheses should be used:
.
Test Statistic
Where, MST is Mean Square for Treatment and MSE is Mean Square for Error.
Degrees of Freedom
Where k is the number of groups or levels or population and n is the sum of the sample sizes of
the groups .
Critical regions: and compare with
Decision: Reject if
Conclusion: interpreting the result of the test where there is a difference or not among the
means.
89
Statistical methods lecture note
Note: The sample sizes need not be equal. The F test to compare means is always right-tailed.
Example: Is the attention span of children affected by whether or not they had a good breakfast?
Twelve children were randomly divided into three groups and assigned to a different meal plan. The
response was attention span in minutes during the morning reading time.
(∑ )
(∑ )
(∑ ) (∑ )
with 2 degrees of freedom.
90
Statistical methods lecture note
Testing the treatment means
1. State the hypothesis test
3. Test statistic
5. Decision
Reject if
Since we reject
6. Conclusion
We reject and conclude that there is a difference in average attention span.
The ANOVA Table
Source Df SS MS F
Treatment 2 64.6667 32.333 5
Error 9 58.25 6.4722
Total 11 122.9167
7 10 1
14 1 12
32 1 1
19 0 9
10 11 1
11 1 11
91
Statistical methods lecture note
Exercise 2: Lowering Blood Pressure
A researcher wishes to try three different techniques to lower the blood pressure of individuals
diagnosed with high blood pressure. The subjects are randomly assigned to three groups; the first
group takes medication, the second group exercises, and the third group follows a special diet. After
four weeks, the reduction in each person‟s blood pressure is recorded. At α= 0.05, test the
claim that there is no difference among the means. Construct ANOVA Table. The data are shown.
There are several techniques for testing the differences between means, but the most common test
are the Least Significant Difference Test, Tukey, and Scheffé.
92
Statistical methods lecture note
Where the s are constants satisfying the property that ∑ . For example, if we wanted to
compare we would write the linear form
and ∑ .
We often write the contrasts with all the ais as integer values. We accomplish this by rewriting the
ais with a common denominator and then multiplying the ais by this common denominator. For
example the contrast in four treatments means:
. The common denominator is 12, which we multiply by each
Where the number of sample observations is selected from population i and is the mean
square within samples obtained from analysis of variance.
Note: two contrasts ̂ and ̂ , where ̂ ∑ ̅ and ̂ ∑ ̅ are said to be orthogonal if
∑
A set of contrasts is said to be mutually orthogonal if all pairs of contrasts in the set are
orthogonal.
Example: Consider a completely randomized design for comparing t = 4 populations‟ means,
with sample sizes Are the following
contrasts orthogonal? ̂ ̅ ̅ ̂ ̅ ̅
93
Statistical methods lecture note
Solution: we can rewrite the contrasts in the following form:
̂ ̅ ̅ ̅ ̅
̂ ̅ ̅ ̅ ̅
Thus, we can identify and
∑
and hence the contrasts are orthogonal.
Least Significant Difference (LSD) test is the simplest and the most commonly used procedure for
making pair comparisons. It uses t tests to perform all pairwise comparisons between group means.
No adjustment is made to the error rate for multiple comparisons. This test is used when the number
of treatment is small, but invalid if number of treatment is large.
Procedure:
1. State null and alternative hypothesis
(Two sided)
2. Identify level of significance
3. Test statistic
Compute the mean difference between the ith and jth treatments as: ̅ ̅
Solution:
No of break fast Light break fast Full break fast
94
Statistical methods lecture note
8 14 10
7 16 12
9 12 16
13 17 15
̅ ̅ ̅
̅ √
Thus
√ √
4. Decision
Since absolute value of ̅ ̅ we reject null hypothesis.
5. Conclusion
At 5% level of significance there is a significant mean difference between number of breakfast and
light breakfast attention span.
This test is to focus on the largest value of the difference between two group means. Since, picking
the largest pairwise difference in means allows us to control the experiment-wise error rate for all
possible pairwise contrasts. We are aware of the major drawback of a multiple-comparison
procedure with a controlled per-comparison error rate. Even when = …..= unless
α, the per-comparison error rate (such as with Fisher‟s unprotected LSD) is quite small, there is a
high probability of declaring at least one pair of means significantly different when running
95
Statistical methods lecture note
multiple comparisons. To avoid this, other multiple-comparison procedures have been developed
that control different error rates.
Tukey (1953) proposed a procedure that makes use of the Studentized range distribution. When
more than two sample means are being compared, to test the largest and smallest sample means, we
could use the test statistic.
̅ ̅
√ ⁄
Where, n is the number of observations in each sample and Sp is a pooled estimate of the common
population standard deviation σ. This test statistic is very similar to that for comparing two means,
but it does not possess a t distribution. One reason it does not is that we have waited to determine
which two sample means (and hence population means) we would compare until we observed the
largest and smallest sample means. This procedure is quite different from that of specifying
̅ ̅ , and forming a t statistic.
The quantity
̅ ̅
√ ⁄
follows a Studentized range distribution. We will not discuss the properties of this distribution, but
will illustrate its use in Tukey‟s multiple-comparison procedure.
Tukey’s multiple-comparison procedure:
1. Rank the t sample means.
2. Two population means are declared different if | ̅ ̅ |
Where, √
is the mean square within samples based on v degrees of freedom, is the upper-
tail critical value of the Studentized range for comparing t different populations, and n is the
number of observations in each sample. A discussion follows showing how to obtain values
of from Table of studentized range distribution.
3. The error rate that is controlled is an experiment wise error rate. Thus, the probability of
observing an experiment with one or more pairwise comparisons falsely declared to be
significant is specified at α.
96
Statistical methods lecture note
We can obtain values of from Table of studentized range distribution. Values of v are
listed along the left column of the table with values of t across the top row. Upper-tail values for the
Studentized range are then presented for α= .05 and .01. For example, in comparing 10 population
means based on 9 degrees of freedom for , the .05 upper-tail critical value of the Studentized
range is = 5.74.
Example: Various agents are used to control weeds in crops. Of particular concern is the over
usage of chemical agents. Although effective in controlling weeds, these agents may also drain into
the underground water system and cause health problems. Thus, several new biological weed agents
have been proposed to eliminate the contamination problem present in chemical agents. Researchers
conducted a study of biological agents to assess their effectiveness in comparison to the chemical
weed agents. The study consisted of a control (no agent), two biological agents (Bio1 and Bio2),
and two chemical agents (Chm1 and Chm2). Thirty 1-acre plots of land were planted with hay. Six
plots were randomly assigned to receive one of the five treatments. The hay was harvested and the
total yield in tons per acre was recorded. The data are given here.
Agent 1 2 3 4 5
Type None Bio1 Bio2 Chm1 Chm2
̅ 1.175 1.293 1.328 1.415 1.500
0.1204 0.1269 0.1196 0.1249 0.1265
6 6 6 6 6
Use Tukey‟s W procedure with to make pairwise comparisons among the five population
means.
Solution: Step 1 is to rank the sample means from smallest to largest, to produce
Agent 1 2 3 4 5
̅ 1.175 1.293 1.328 1.415 1.500
For this experiment, we have
t=5 (we are making pairwise comparisons among five means)
(is the mean square error in the Analysis of Variance (AOV)
v=25 ( had degrees of freedom equal to dfError in the AOV)
α=0.05 (we specified αE, the experiment wise error rate at .05)
n = 6 (there were six plots randomly assigned to each of the agents) from the studentized range
distribution 4.158
97
Statistical methods lecture note
The absolute value of each difference in the sample means |̅ ̅ | must then be compared to
√ √ = .2100
By substituting W for LSD, we can use the same stepwise procedure for comparing sample means.
Having ranked the sample means from low to high, we compare against ̅ , which is ̅ , as
follows:
Comparison Conclusion
̅ ̅ ̅ ̅ >W; processed
̅ ̅ ̅ ̅ >W; processed
̅ ̅ ̅ ̅ <W; stop
Comparison Conclusion
̅ ̅ <W; stop
All populations are not underlined by a common line have population means that are significantly
different from each other; that is and are significantly larger than . No other pairs of
means are significantly different.
A limitation of Tukey‟s procedure is the requirement that all the sample means are based on the
same number of data values. There are no available tables for the case in which the sample sizes are
unequal. If the sample sizes are only somewhat different, then Miller (1981) recommends replacing
the value of n in the formula for W with the harmonic mean of the ni„s:
For large departures from equal sample sizes, the experimenter should consider using either the
LSD procedure or a Bonferroni test procedure.
Tukey‟s procedure can also be used to construct confidence intervals for comparing two means.
However, unlike the confidence intervals that we can form from Fisher‟s LSD, Tukey‟s procedure
enables us to construct simultaneous confidence intervals for all pairs of treatment differences. For
a specified α level from which we compute W, the overall probability is that all differences
will be included in an interval of the form
98
Statistical methods lecture note
̅ ̅
That is, the probability is that all the intervals ̅ ̅ include the corresponding
population differences .
2.3.4 Scheff ́ ’s S Method
Out of the three mean comparisons test you can run (the other two are Fisher‟s LSD and Tukey‟s
HSD). The Scheffe test is the most flexible or conservative ((less sensitive) than the two, but it is
also the test with the lowest statistical power. The previous two procedures have been developed for
pairwise comparisons among t population means. However, Scheffe test performs simultaneous
joint pairwise comparisons for all possible pairwise combinations of means and uses the F sampling
distribution. This test can be used to examine all possible linear combinations of group means, not
just pairwise comparisons.
Scheff ́ ’s procedure:
1. Consider any linear comparison among the t population means of the form:
+
We wish to test the null hypothesis that against the alternative
2. The test statistic is
̂ ̅ + ̅ ̅
3. Let
√ ̂ ( ̂)√
Where
̂ ( ̂) ∑
t is the total number of population means, is the upper-tail critical value of the F
distribution for the specified value of with , and is the degrees of freedom
for .
4. For a specified value of we reject if | ̂| .
5. The error rate that is controlled is an experiment wise error rate. If we consider all
imaginable contrasts, the probability of observing an experiment with one or more contrasts
falsely declared to be significant is designated by .
Example: Refer the previous example in the t=5 treatment means in an attempt to investigate the
differences in the average hay production on fields treated with either the control or one of the four
99
Statistical methods lecture note
weed agents. Use the sample data and Scheffé‟s procedure to determine which if any of the four
contrasts are significantly different from zero. Use
Solution: the four contrasts of interest are given in the following table along with their estimates.
value of √ √
Because the absolute value of ̂ is .836 exceeds .750, we have significant evidence ( ) to
indicate that the average hay production from the fields treated with a weed agent exceeds the
average yield in the fields having no treatment for weeds. The computations for the other three
contrasts are summarized in the above table and can be done in similar fashion.
100
Statistical methods lecture note
101
Statistical methods lecture note
Chapter Six
Statistical tests, such as the z, t, and F tests, are called parametric tests. Parametric tests are
statistical tests for population parameters such as means, variances, and proportions that involve
assumptions about the populations from which the samples were selected. One assumption is that
these populations are normally distributed. But what if the population in a particular hypothesis-
testing situation is not normally distributed?
102
Statistical methods lecture note
Disadvantages
They are less sensitive than their parametric counterparts when the assumptions of the
parametric methods are met. Therefore, larger differences are needed before the null
hypothesis can be rejected.
They tend to use less information than the parametric tests. For example, the sign test
requires the researcher to determine only whether the data values are above or below the
median, not how much above or below the median each value is.
They are less efficient than their parametric counterparts when the assumptions of the
parametric methods are met. That is, larger sample sizes are needed to overcome the loss of
information. For example, the nonparametric sign test is about 60% as efficient as its
parametric counterpart, the z test. Thus, a sample size of 100 is needed for use of the sign
test, compared with a sample size of 60 for use of the z test to obtain the same results.
Since there are both advantages and disadvantages to the nonparametric methods, the researcher
should use caution in selecting these methods. If the parametric assumptions can be met, the
parametric methods are preferred. However, when parametric assumptions cannot be met, the
nonparametric methods are a valuable tool for analyzing the data.
The basic assumption for nonparametric statistics is that the samples are randomly obtained. When
two or more samples are used, they must be independent of each other unless otherwise stated.
Ranking
Many nonparametric tests involve the ranking of data, that is, the positioning of a data value in a
data array according to some rating scale. Ranking is an ordinal variable.
For example: suppose a judge decides to rate five speakers on an ascending scale of 1 to 10, with 1
being the best and 10 being the worst, for categories such as voice, gestures, logical presentation,
and platform personality. The ratings are shown in the chart.
Speaker A B C D E
Rating 8 6 10 3 1
103
Statistical methods lecture note
Speaker E D B A C
Rating 1 3 6 8 10
Ranking 1 2 3 4 5
Since speaker E received the lowest score, 1 point, he or she is ranked first. Speaker D received the
next-lower score, 3 points; he or she is ranked second; and so on. What happens if two or more
speakers receive the same number of points? Suppose the judge awards points as follows:
Speaker A B C D E
Rating 8 6 10 6 3
Speaker E D B A C
Rating 3 6 6 8 10
nd
Ranking 1 Tie for 2 and 3rd 4
5
When there is a tie for two or more places, the average of the ranks must be used. In this case, each
would be ranked as Hence, the rankings are as follows:
Speaker E D B A C
Rating 3 6 6 8 10
Ranking 1 2.5 2.5 4 5
Many times, the data are already ranked, so no additional computations must be done.
So far, the methods we learned were for the population mean, population proportion and population
variance. The mean is a good measure of center when the data is bell-shaped, but it is sensitive to
outliers and extreme values. When the data is skewed, however, a better measure of center would be
the median. The median, you may recall, is a resistant measure. In other words, we may want to
consider a test for the median and not the mean.
6.3. Sign-test
6.3.1 Single sample sign test (one sample sign test)
The one sample sign test simply computes a significance test of a hypothesized median value for a
single data set. The one sample sign test is a nonparametric hypothesis test used to determine
104
Statistical methods lecture note
whether statistically significant difference exists between the median of a non-normally distributed
continuous data set and a standard. This test basically concerns the median of a continuous
population. The one sample sign test is to compare the total number of observations less than (-) or
greater than (+) the hypothesized value. The one sample sign test is similar to the one-sample
Wilcoxon signed-rank test, but less powerful than the Wilcoxon signed test.
When using the sign test, the researcher hypothesizes the specific value for the median of a
population; then he or she selects a sample of data and compares each value with the conjectured
median. If the data value is above the conjectured median, it is assigned a plus sign. If it is below
the conjectured median, it is assigned a minus sign. And if it is exactly the same as the conjectured
median, it is assigned a 0. Then the numbers of plus and minus signs are compared. If the null
hypothesis is true, the number of plus signs should be approximately equal to the number of minus
signs. If the null hypothesis is not true, there will be a disproportionate number of plus or minus
signs. Alternatively, the one sample sign test is a nonparametric version of one sample t test.
Similar to one sample t-test, the sign test for a population median can be one-tailed (right or left
tailed) or two-tailed distribution based on the hypothesis.
Left tailed test: H0: median ≥ Hypothesized value k; H1: median <k
Right tailed test: H0: median ≤ Hypothesized value k; H1: median >k
Two tailed test: H0: median = Hypothesized value k; H1: median ≠k
105
Statistical methods lecture note
Step 3: Compute the test value. Count the numbers of positive and negative signs found in step 2,
and use the smaller value as the test value.
Step 4: Make the decision. Compare the test value with the critical value in Table J. If the test value
is less than or equal to the critical value, reject the null hypothesis.
Step 5: Summarize the results.
Example: A convenience store owner hypothesizes that the median number of snow cones she sells
per day is 40. A random sample of 20 days yields the following data for the number of snow cones
sold each day.
18 43 40 16 22
30 29 32 37 36
39 34 39 45 28
36 40 34 39 52
Step 2: Find the critical value. Compare each value of the data with the median. If the value is
greater than the median, replace the value with a plus sign. If it is less than the median, replace it
with a minus sign. And if it is equal to the median, replace it with a 0. The completed table follows.
- + 0 -
- - - -
- - - +
- 0 - -
Step 3: Compute the test value. Count the number of plus and minus signs obtained in step 2, and
use the smaller value as the test value. Since there are 3 plus signs and 15 minus signs,
Step 4: Make the decision. Compare the test value with the critical value. If the test value is less
than or equal to the critical value, the null hypothesis is rejected.
106
Statistical methods lecture note
Step 5: Summarize the results. There is enough evidence to reject the claim that the median number
of snow cones sold per day is 40.
Example 2: Bank of America West Palm Beach, FL branch manager indicates that the median
number of savings account customers per day is 64. A clerk from the same branch claims that it was
more than 64. Clerk collected the number of savings account customers per day data for 10 random
days. Can we reject the branch manager‟s claim at 0.05 significance levels?
Solution
1) H0: Savings account customer median = 64;
H1: Savings account customer median >64
2) Assign observations less than 64 with – sign and observations above 64 with + sign
3) Critical values: total number of + values are 8 and total number of – values are 2
Alternatively, the null hypothesis is true (the number of + and – signs are equal). We can
use the Binomial distributions to determine the p value.
( ) ( ) *( ) ( ) ( )+
4) Conclusion: which is greater than 0.05. Hence we failed to reject the null
hypothesis. So, there is no significant evidence that the savings account customers per day
are more than 64.
Alternatively, we can precede this example like the previous fashion. The test value is
smaller numbers of + or – signs. So, the test value is 2.
The critical value for n=10, α=0.05 for one tailed test is 1. Since, the test value=2 > critical
value=1. Hence, the null hypothesis is not rejected. So, they have the same decisions and
conclusions for both methods.
Note: If the sample size n is 26 or more, the following formula is used for the test value:
107
Statistical methods lecture note
√
Where,
X = smaller number of signs
n = sample size
The sign test can also be used to test sample means in a comparison of two dependent samples, such
as a before-and-after test. Recall that when dependent samples are taken from normally distributed
populations, the t test is used. When the condition of normality cannot be met, the nonparametric
sign test can be used.
Example: A medical researcher believed the number of ear infections in swimmers can be reduced
if the swimmers use earplugs. A sample of 10 people was selected, and the number of infections for
a four-month period was recorded. During the first two months, the swimmers did not use the
earplugs; during the second two months, they did. At the beginning of the second two-month
period, each swimmer was examined to make sure that no infections were present. The data are
shown here. At , can the researcher conclude that using earplugs reduced the number of
ear infections?
Number of Ear Infections
Swimmer Before, After,
A 3 2
B 0 1
C 5 4
D 4 0
E 2 1
F 4 3
G 3 1
H 5 3
I 2 2
J 1 3
Solution
Step 1 State the hypotheses and identify the claim.
: The number of ear infections will not be reduced.
: The number of ear infections will be reduced (claim).
108
Statistical methods lecture note
Step 2 Find the critical value. Subtract the after values from the before values and indicate
the difference by a positive or negative sign or 0, according to the value, as shown in the table.
Number of Ear Infections
Swimmer Before, After, Sign difference
A 3 2 +
B 0 1 -
C 5 4 +
D 4 0 +
E 2 1 +
F 4 3 +
G 3 1 +
H 5 3 +
I 2 2 0
J 1 3 -
From Table J, with (the total number of positive and negative signs; the 0 is not counted) and
(one-tailed), at most 1 negative sign is needed to reject the null hypothesis because 1 is
the smallest entry in the column of Table J.
Step 3 Compute the test value. Count the numbers of positive and negative signs found in step 2,
and use the smaller value as the test value. There are 2 negative signs, so the test value is 2.
Step 4 Make the decision. There are 2 negative signs. The decision is to not reject the null
hypothesis. The reason is that with .
Step 5 Summarize the results. There is not enough evidence to support the claim that the use of
earplugs reduced the number of ear infections.
When conducting a one-tailed sign test, the researcher must scrutinize the data to determine whether
they support the null hypothesis. If the data support the null hypothesis, there is no need to conduct
the test. In Example above, the null hypothesis states that the number of ear infections will not be
reduced. The data would support the null hypothesis if there were more negative signs than positive
signs. The reason is that the before values in most cases would be smaller than the after
values , and the values would be negative more often than positive. This would
indicate that there is not enough evidence to reject the null hypothesis. The researcher would stop
here, since there is no need to continue the procedure.
On the other hand, if the number of ear infections were reduced, the values, for the most part,
would be larger than the values, and the values would most often be positive. Hence,
109
Statistical methods lecture note
the researcher would continue the procedure. A word of caution is in order, and a little reasoning is
required.
Exercise 1: manufacturer believes that if routine maintenance (cleaning and oiling of machines) is
increased to once a day rather than once a week, the number of defective parts produced by the
machines will decrease. Nine machines are selected, and the number of defective parts produced
over a 24-hour operating period is counted. Maintenance is then increased to once a day for a week,
and the number of defective parts each machine produces is again counted over a 24-hour operating
period. The data are shown here. At , can the manufacturer conclude that increased
maintenance reduces the number of defective parts manufactured by the machines?
Machine 1 2 3 4 5 6 7 8 9
Before 6 18 5 4 16 13 20 9 3
After 5 16 7 4 18 12 14 7 1
A popular nonparametric test to compare outcomes between two independent groups is the Mann
Whitney U test. The Mann Whitney U test, sometimes called the Mann Whitney Wilcoxon Test or
the Wilcoxon Rank Sum Test, is used to test whether two samples are likely to derive from the
same population (i.e., that the two populations have the same shape). Some investigators interpret
this test as comparing the medians between the two populations. Recall that the parametric test
compares the means (H0: μ1=μ2) between independent groups.
In contrast, the null and two-sided research hypotheses for the nonparametric test are stated as
follows:
H0: The two populations are equal versus H1: The two populations are not equal.
This test is often performed as a two-sided test and, thus, the research hypothesis indicates that the
populations are not equal as opposed to specifying directionality. A one-sided research hypothesis
is used if interest lies in detecting a positive or negative shift in one population as compared to the
other. The procedure for the test involves pooling the observations from the two samples into one
combined sample, keeping track of which sample each observation comes from, and then ranking
lowest to highest from 1 to n1+n2, respectively.
110
Statistical methods lecture note
Step 1: State the hypothesis and identify the claim.
a) Combine the data from the two samples, arrange the combined data in order, and rank each
value.
b) Sum the ranks of the group with smaller size. (Note: If both groups have the same sample
size, either one can be used.)
c) Use the following formulas to find the test value.
√
Where, R is the sum of ranks of the data in the smaller sample and are each
greater than equal to 10.
Step 4: Make a decision.
Step 5: Summarize the result.
Example: Two independent samples of army and marine recruits are selected, and the time in
minutes it takes each recruit to complete an obstacle course is recorded, as shown in the table.
At , is there a difference in the times it takes the recruits to complete the course?
Army 15 18 16 17 13 22 24 17 19 21 26 28 Mean=19.67
Marines 14 9 16 19 10 12 11 8 15 18 25 Mean=14.27
Solution:
1) There no difference in the times it takes the recruits to complete the obstacle course.
There a difference in the times it takes the recruits to complete the obstacle course
(claim).
2) Critical value. Since and this test is two tailed test use the
3) Compute the test value.
a) Combine the data from the two samples, arrange it in order, and rank each value.
Time 8 9 10 11 12 13 14 15 15 16 16 17
Group M M M M M A M M M M A M
111
Statistical methods lecture note
Rank 1 2 3 4 5 6 7 8.5 8.5 10.5 10.5 12.5
Time 17 18 18 19 19 21 22 24 25 26 28
Group A M A M A A A A M A A
Rank 12.5 14.5 14.5 16.5 16.5 18 19 20 21 22 23
√ √
The Wilcoxon signed rank test (also called the Wilcoxon signed rank sum test) is a non-
parametric test to compare data. This test provides an alternative to the student t-test for matched
score data where the assumptions for the parametric t-test cannot be met. As you will now
appreciate, the sign test only makes use of the signs of the differences between observed data and
the median (M) or pairs of differences between observed data in the case of a paired sample. In
either case, no account is taken of the size of the differences arising. The statistician Frank
Wilcoxon developed a procedure which takes into account both the sign and the magnitude of the
differences arising. The resulting test is now widely known as the Wilcoxon signed-rank test. In
using this test, the difference is obtained between each of N pairs of scores observed on matched
objects, for example, the difference between pretest and post-test scores for a group of students. The
difference scores obtained are then ranked. The ranks of negative score difference are summed and
the ranks of positive score difference are summed. The test statistic T is the smaller of these two
sums. Difference scores of 0 are eliminated since a rank cannot be assigned. If the null hypothesis
of no difference between the groups of scores is true, the sum of positive ranks should not differ
from the sum of negative ranks beyond that expected by chance.
112
Statistical methods lecture note
The basic procedures in the Wilcoxon signed-rank test include the following steps.
Compute the change (difference) in the variable of interest in each experimental subject.
Rank all the differences according to their absolute magnitude (ignoring the sign of the
difference).
For observations with tied differences, assign the average of the ranks that would be assigned
if they were not tied.
Drop cases where the difference is zero, and reduce the sample size N by the number of
dropped cases.
Apply the sign of the difference for each observation to its rank.
Calculate the sum of the signed ranks to obtain the test statistic Vs=S1+...+Ss.
Compare the observed value of Vs to the distribution of W expected under the null
hypotheses, to determine if it is extreme.
Example: A study is run to evaluate the effectiveness of an exercise program in reducing systolic
blood pressure in patients with pre-hypertension (defined as a systolic blood pressure between 120-
139 mmHg or a diastolic blood pressure between 80-89 mmHg). A total of 15 patients with pre-
hypertension enroll in the study, and their systolic blood pressures are measured. Each patient then
participates in an exercise training program where they learn proper techniques and execution of a
series of exercises. Patients are instructed to do the exercise program 3 times per week for 6 weeks.
After 6 weeks, systolic blood pressures are again measured. The data are shown below.
Patient 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Before Exercise 125 132 138 120 125 127 136 139 131 132 135 136 128 127 130
After Exercise 118 134 130 124 105 130 130 132 123 128 126 140 135 126 132
Is there is a difference in systolic blood pressures after participating in the exercise program as
compared to before?
Step 1: Set up hypotheses and determine level of significance.
H0: The median difference is zero versus H1: The median difference is not zero α=0.05
Step 2: Select the appropriate test statistic.
The test statistic for the Wilcoxon Signed Rank Test is W, defined as the smaller of W+ and W-
which are the sums of the positive and negative ranks, respectively.
Step 3: Set up the decision rule.
113
Statistical methods lecture note
The critical value of W can be found in the table of critical values. To determine the appropriate
critical value from Table we need sample size (n=15) and our two-sided level of significance
(α=0.05). The critical value for this two-sided test with n=15 and α=0.05 is 25 and the decision rule
is as follows: Reject H0 if W < 25.
Step 4: Compute the test statistic.
Because the before and after systolic blood pressures measures are paired, we compute difference
scores for each patient.
Patient 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Before Exercise 125 132 138 120 125 127 136 139 131 132 135 136 128 127 130
After Exercise 118 134 130 124 105 130 130 132 123 128 126 140 135 126 132
Difference (B-A) 7 -2 8 -4 20 -3 6 7 8 4 9 -4 -7 1 -2
The next step is to rank the ordered absolute values of the difference scores, give ranks and assign
sign for each rank.
Observed difference 7 -2 8 -4 20 -3 6 7 8 4 9 -4 -7 1 -2
Ordered | diff.| 1 2 2 3 4 4 4 6 7 7 7 8 8 9 20
So the test statistic is the smaller value of absolute sum of signed ranks. Hence, in this case the test
statistic is 31.
Step 5: Conclusion
We do not reject H0 because 31 > 25. Therefore, we do not have statistically significant evidence at
α=0.05, to show that the median difference in systolic blood pressures is not zero (i.e., that there is a
significant difference in systolic blood pressures after the exercise program as compared to before).
Exercise: Is there a difference between the median values for the following sets of treatment data
for the twelve groups?
114
Statistical methods lecture note
Group 1 2 3 4 5 6 7 8 9 10 11 12
Treatment 1 2.5 3.5 2.9 2.1 6.9 2.4 4.9 6.6 2.0 2.0 5.8 7.5
Treatment 2 4.0 5.6 3.2 1.9 9.5 2.3 6.7 6.0 3.5 4.0 8.1 19.9
The analysis of variance uses the F test to compare the means of three or more populations. The
assumptions for the ANOVA test are that the populations are normally distributed and that the
population variances are equal. When these assumptions cannot be met, the nonparametric
Kruskal-Wallis test, sometimes called the H test, can be used to compare three or more means. In
this test, each sample size must be 5 or more. In these situations, the distribution can be
approximated by the chi-square distribution with k-1 degrees of freedom, where k number of
groups. This test also uses ranks. The formula for the test is given next. In the Kruskal-Wallis test,
you consider all the data values as a group and then rank them. Next, the ranks are separated and the
H formula is computed. This formula approximates the variance of the ranks. If the samples are
from different populations, the sums of the ranks will be different and the H value will be large;
hence, the null hypothesis will be rejected if the H value is large enough. If the samples are from
the same population, the sums of the ranks will be approximately the same and the H value will be
small; therefore, the null hypothesis will not be rejected. This test is always a right-tailed test. The
chi-square table with k -1 df should be used for critical values.
( )
Where,
115
Statistical methods lecture note
a) Arrange the data from lowest to highest and rank each value.
b) Find the sum of the ranks of each group.
c) Substitute in the formula.
( )
Solution
Step 1 State the hypotheses and identify the claim.
H0: There is no difference in the number of infections in the three groups of hospitals (claim).
H1 : There is a difference in the number of infections in the three groups of hospitals.
Step 2 Find the critical value. Use the chi-square table (Table G) with d.f. k -1, where k the
number of groups. With 0.05 and d.f =3 - 1 = 2, the critical value is 5.991.
Step 3 Compute the test value.
a. Arrange all the data from the lowest value to the highest value and rank each value.
Amount 80 105 110 116 155 167 178 232 315 476 557 920
Group B C C B C C A B A B A A
Rank 1 2 3 4 5 6 7 8 9 10 11 12
116
Statistical methods lecture note
( )
Where,
Therefore, ( )
Step 4 Make the decision. Since 5.346 is less than the critical value of 5.991, the decision is to not
reject the null hypothesis.
Step 5 Summarize the results. There is not enough evidence to reject the claim that there is no
difference in the number of infections in the groups of hospitals.
Hence the differences are not significant at =0.05.
Spearman rank correlation is a non-parametric alternative to linear regression and correlation when
they have two measurement variables and one or both of them may not be normally distributed; this
requires converting both measurements to ranks. Linear regression and correlation that the data
are normally distributed, while Spearman rank correlation does not make this assumption, so people
think that Spearman correlation is better.
Spearman's rank correlation coefficient (Conover, 1999) is a measure of association between two
variables. It is calculated by ranking the data within two different variables and computing the
Pearson correlation coefficient on the ranks for the two variables.
Spearman‟s Rank correlation coefficient is used to identify and test of the strength of a relationship
between two sets of data. Spearman‟s correlation coefficient is a statistical measure of the strength
of a monotonic relationship between paired data. Monotonic relationship means:
Monotonically increasing - as the x variable increases the y variable never decreases;
Monotonically decreasing - as the x variable increases the y variable never increases;
Not monotonic - as the x variable increases the y variable sometimes decreases and sometimes
increases.
Spearman‟s returns a value from -1 to 1 or
And its interpretation is similar to that of Pearson‟s, e.g. the closer is to positive or negative 1 the
stronger the monotonic relationship. Correlation is an effect size and so we can verbally describe
the strength of the correlation using the following guide for the absolute value of r is:
.00-.19 “very weak correlation between ranks”
.20-.39 “weak correlation between ranks”
117
Statistical methods lecture note
.40-.59 “moderate correlation between ranks”
.60-.79 “strong correlation between ranks”
.80-1.0 “very strong correlation between ranks”
1.1 Steps
1. Rank the different items in X and Y.
2. Find the difference of the ranks in a pair , denote them by Di
3. Use the following formula
∑
7 27 2 50 28 29 20 12 6 17
Solution
The ramks of X and Y, and their difference of the ranks in a pair is given as follows:
7 27 2 50 28 29 20 12 6 17
Rank, 1 2 3 4 5 6 7 8 9 10
Rank, 1 6 8 7 10 9 3 5 2 4
0 -4 -5 -3 -5 -3 4 3 7 6
0 16 25 9 25 9 16 9 49 36
Solution: ∑
ranks.
Exercise: The scores for nine students in physics and math are as follows:
Physics: 35, 23, 47, 17, 10, 43, 9, 6, 28
Mathematics: 30, 33, 45, 23, 8, 49, 12, 4, 31
118
Statistical methods lecture note
Compute the student‟s ranks in the two subjects and compute the Spearman rank correlation.
Example: The variables for this analysis are Fishnum (number of fish displayed) and Fishgood
(rating of fish quality on a 1-10 scale).
Fishnum 32 41 31 38 21 13 17 22 24 11 17 20
Fishgood 6 5 3 3 7 9 9 8 6 9 7 8
Solution
Step 1: Rank order of the variable separately.
Fishnum 32 41 31 38 21 13 17 22 24 11 17 20
Rank(Fishnum) 10 12 9 11 6 2 3.5 7 8 1 3.5 5
119
Statistical methods lecture note
Fishgood 6 5 3 3 7 9 9 8 6 9 7 8
Rank(Fishgood) 4.5 3 1.5 1.5 6.5 11 11 8.5 4.5 11 6.5 8.5
Step 2: For each pair of scores, compute the difference (d) between the ranks, compute the square
of this difference (d²) and then find the sum of these squared differences.
Fishnum 32 41 31 38 21 13 17 22 24 11 17 20
Rank(Fishnum) 10 12 9 11 6 2 3.5 7 8 1 3.5 5
Fishgood 6 5 3 3 7 9 9 8 6 9 7 8
Rank(Fishgood) 4.5 3 1.5 1.5 6.5 11 11 8.5 4.5 11 6.5 8.5
Difference (Di) 5.5 9 7.5 9.5 -0.5 -9 -7.5 -1.5 3.5 -10 -3 -3.5
∑
Step 3: Compute Spearman's correlation (r) using the following formula
∑
Step 4: The critical value of r for the appropriate sample size. Critical, (N = 12, α = .05) = .588
Step 5: DR: we would decide to reject the null hypothesis, because the absolute value of the
obtained (.86) is larger than the critical (.588).
Step 6: the negative obtained value agrees with the negative rank-order relationship hypothesized
by the researcher.
120
Statistical methods lecture note
121
Statistical methods lecture note
122
Statistical methods lecture note
Chapter 7
7. Simple Linear Regression and Correlation
Linear regression and correlation is studying and measuring the linear relationship among two or
more variables. When only two variables are involved, the analysis is referred to as simple
correlation and simple linear regression analysis, and when there are more than two variables the
term multiple regression and partial correlation is used.
Regression Analysis: is a statistical technique that can be used to develop a mathematical equation
showing how variables are related.
Correlation Analysis: deals with the measurement of the closeness of the relationship which are
described in the regression equation.
We say there is correlation if the two series of items vary together directly or inversely.
Simple Correlation
Suppose we have two variables X ( X 1 , X 2 ,...X n ) and Y (Y1 , Y2 ,...Yn )
When higher values of X are associated with higher values of Y and lower values of X are
associated with lower values of Y, then the correlation is said to be positive or direct.
Examples:
- Income and expenditure
- Number of hours spent in studying and the score obtained
- Height and weight
- Distance covered and fuel consumed by car.
When higher values of X are associated with lower values of Y and lower values of X are
associated with higher values of Y, then the correlation is said to be negative or inverse.
Examples:
- Demand and supply
- Income and the proportion of income spent on food.
The correlation between X and Y may be one of the following:
1. Perfect positive (slope=1)
2. Positive (slope between 0 and 1)
3. No correlation (slope=0)
4. Negative (slope between -1 and 0)
5. Perfect negative (slope=-1)
123
Statistical methods lecture note
The presence of correlation between two variables may be due to three reasons:
1. One variable being the cause of the other. The cause is called “subject” or “independent”
variable, while the effect is called “dependent” variable.
2. Both variables being the result of a common cause. That is, the correlation that exists
between two variables is due to their being related to some third force.
Example:
Let X1= ESLCE result
Y1= rate of surviving in the University
Y2= the rate of getting a scholar ship.
Both X1 & Y1 and X1 & Y2 have high positive correlation, likewise Y1 & Y2 have positive
correlation but they are not directly related, but they are related to each other via X1.
3. Chance: The correlation that arises by chance is called spurious correlation.
Examples:
Price of teff in Addis Ababa and grade of students in USA.
Weight of individuals in Ethiopia and income of individuals in Kenya.
Therefore, while interpreting correlation coefficient, it is necessary to see if there is any likelihood
of any relationship existing between variables under study.
The correlation coefficient between X and Y denoted by r is given by
r
( X i X )(Yi Y ) and the short cut formula is
( X i X ) 2 (Yi Y ) 2
n XY ( X )( Y )
r
[n X 2 ( X ) 2 ] [n Y 2 ( Y ) 2
r
XY nXY
[ X 2 nX 2 ] [ Y 2 nY 2 ]
Remark: Always this r lies between -1 and 1 inclusively and it is also symmetric.
Interpretation of r
1. Perfect positive linear relationship ( if r 1)
2. Some Positive linear relationship ( if r is between 0 and 1)
3. No linear relationship ( if r 0)
4. Some Negative linear relationship ( if r is between -1 and 0)
5. Perfect negative linear relationship ( if r 1)
124
Statistical methods lecture note
Examples: Calculate the simple correlation between mid-semester and final exam scores of 10 students
(both out of 50)
Solution:
n 10, X 31.2, Y 32.9, X 2 973.4, Y 2 1082.4
XY 10331, X 2
9920, Y 2
11003
r
XY nXY
[ X 2 nX 2 ] [ Y 2 nY 2 ]
10331 10(31.2)(32.9)
(9920 10(973.4)) (11003 10(1082 .4))
66.2
0.363
182.5
This means mid semester exam and final exam scores have a slightly positive correlation.
Exercise The following data were collected from a certain household on the monthly income (X)
and consumption (Y) for the past 10 months. Compute the simple correlation coefficient.
X: 650 654 720 456 536 853 735 650 536 666
Y: 450 523 235 398 500 632 500 635 450 360
The above formula and procedure is only applicable on quantitative data, but when we have
qualitative data like efficiency, honesty, intelligence, etc. we calculate what is called
Spearman‟s rank correlation coefficient as discussed in chapter six.
125
Statistical methods lecture note
1.3 Steps
1. Rank the different items in X and Y.
2. Find the difference of the ranks in a pair , denote them by Di
3. Use the following formula
6 Di
2
rs 1
n(n 2 1)
Where rs coefficien t of rank correlatio n
D the difference between paired ranks
n the number of pairs
Example: Aster and Almaz were asked to rank 7 different types of lipsticks, see if there is correlation
between the tests of the ladies.
Lipstick types A B C D E F G
Aster 2 1 4 3 5 7 6
Almaz 1 3 2 4 5 6 7
Solution:
Lipstick types A B C D E F G
Rank(X) 2 1 4 3 5 7 6
Rank(Y) 1 3 2 4 5 6 7
Rank(X)- Rank(Y) 1 -2 2 -1 0 1 -1
D2 1 4 4 1 0 1 1
6 Di
2
6(12)
rs 1 1 0.786
n(n 1)
2
7( 48)
- Simple linear regression refers to the linear relationship between two variables
- We usually denote the dependent variable by Y and the independent variable by X.
- A simple regression line is the line fitted to the points plotted in the scatter diagram, which
would describe the average relationship between the two variables. Therefore, to see the type of
relationship, it is advisable to prepare scatter plot before fitting the model.
126
Statistical methods lecture note
- The linear model is:
Y X
Where:Y Dependentvar iable
X independent var iable
Re gression cons tan t
regression slope
randomdisturbance term
Y ~ N ( X , 2 )
~ N (0, 2 )
- To estimate the parameters ( and ) we have several methods:
The free hand method
The semi-average method
The least square method
The maximum likelihood method
The method of moments
Bayesian estimation technique.
- The above model is estimated by: Yˆ a bX
Where a is a constant which gives the value of Y when X=0 .It is called the Y-intercept. b is a
constant indicating the slope of the regression line, and it gives a measure of the change in Y for a
unit change in X. It is also regression coefficient of Y on X.
b
( X i X )(Yi Y ) XY nXY a Y bX
( X i X )2 X 2 nX 2
Example 1: The following data shows the score of 12 students for Accounting and Statistics
examinations.
a) Calculate a simple correlation coefficient.
127
Statistical methods lecture note
b) Fit a regression equation of Statistics on Accounting using least square estimates.
c) Predict the score of Statistics if the score of accounting is 85.
∑ ∑ ∑
a)
√ ∑ ∑ ∑ ∑ √
The Coefficient of Correlation (r) has a value of 0.92. This indicates that the two variables are
positively correlated (Y increases as X increases).
∑ ∑ ∑
b)
√ ∑ ∑ √
̅ ̅
̂ is the estimated regression line.
c) Insert X=85 in the estimated regression line.
̂
128
Statistical methods lecture note
Exercise: A car rental agency is interested in studying the relationship between the distance driven
in kilometer (Y) and the maintenance cost for their cars (X in birr). The following summarized
information is given based on samples of size 5.
2
i 1 X i 147,000,000 i 1Yi 314
5 5 2
(Yˆ Y ) 2
i.e r 2
(Y Y ) 2
Where r the simple correlatio n coefficien t.
SX Y
( X i X )(Yi Y ) XY nXY
n 1 n 1
o We can express the relationship between the coefficients using the following formula:
2
S SX Y
i. r XY r 2 2 2
S X SY S X SY
bS X rS
ii. r b Y
SY SX
Where, is the covariance between X and Y, is the standard deviation of X and, is the
standard deviation of Y.
129
Statistical methods lecture note