Professional Documents
Culture Documents
Hypothesis Testing
BY
• We could then use the sample mean to estimate the mean years of
service for all employees;
• Note, under the “one tailed test” the rejection region is either in the
right or left tail of the curve;
One-tail vs. Two-tail Test
7
Left-tail or Right-tail Test?
• The direction of the test involving claims Inequality
that use the words “has improved”, “is Keywords
Symbol
Part of:
9
Step 2: Select the Significance Level
• The next step is to state the level of significance. The level of
significance is the probability of rejecting the null hypothesis when it is
true.
• The level of significance is designated 𝛼 the Greek letter alpha. It is also
sometimes called the level of risk.
• There is no one level of significance that is applied to all tests. A decision
is made to use the .05 level (often stated as the 5 percent level), the .01
level, the .10 level, or any other level between 0 and 1. Traditionally, the
.05 level is selected for studies that has to do with human behaviour, .01
for quality assurance.
Is it possible to reject a true hypothesis?
• Suppose you are given a contract by an organisation to supply computer
circuit boards and the quality control department of the organisation
specifies that it will take a sample of all incoming shipments with a
specification that if more than 6% of the sample is defective the shipment
will be rejected.
Compute the test statistic and compare it to the critical value, and
make a decision to reject or not to reject the null hypothesis.
18
Parts of a Distribution in Hypothesis Testing
19
One Sample Test: Testing for a Population Mean with a
Known Population Standard Deviation
ABC wood assembly factory produces desks and
other office equipment for both public and
private organisations. The weekly production of
the Model 325 desk at the Zaria Plant follows a
normal probability distribution with a mean of
200 and a standard deviation of 16. Recently,
because of market expansion, new production
methods have been introduced and new
employees hired. A random sample of 50 weekly
desks production was selected and the mean is
203.5. The manager of the company would like
to investigate whether there has been a change in
the weekly production of the Model 325 desk. Is
the mean number of desks produced at the Zaria
Plant different from 200 at the .01 significance
level?
20
Testing for a Population Mean with a Known Population Standard Deviation
21
Step 4: Formulate the decision rule.
Reject H0 if |Z| > Z/2
Z Z / 2
X
Z / 2
/ n
203 .5 200
Z .01/ 2
16 / 50
1.55 is not 2.58
23
Step 4: Formulate the decision rule.
Reject H0 if Z > Z
25
What does it mean when p-value < ?
26
p-Value in Hypothesis Testing - Example
Recall the last problem where the
hypothesis and decision rules were set up
as:
H0: ≤ 200
H1: > 200
Reject H0 if Z > Z
where Z = 1.55 and Z =2.33
Reject H0 if p-value <
0.0606 is not < 0.01
Conclude: Fail to reject H0
The probability of finding a z value of 1.55 or more is
.0606, found by 1- 0.9394. To put it another way, the
probability of obtaining a mean greater than 203.5 if the
mean is equal 200 is .0606. For 2 tail P value =
2(0.0606)= 0.1212 27
Testing for the Population Mean: When the Population
Standard Deviation is Unknown
• When the population standard deviation (σ) is unknown, the
sample standard deviation (s) is used in its place. The t-distribution
is used as test statistic, which is computed using the formula:
ҧ
𝑥−𝜇
•𝑡= 𝑠 with 𝑛 − 1 𝑑𝑒𝑔𝑟𝑒𝑒𝑠 𝑜𝑓 𝑓𝑟𝑒𝑒𝑑𝑜𝑚,
ൗ 𝑛
• 𝑤ℎ𝑒𝑟𝑒:
• 𝑥ҧ = 𝑖𝑠 𝑡ℎ𝑒 𝑠𝑎𝑚𝑝𝑙𝑒 𝑚𝑒𝑎𝑛;
• 𝑥ҧ = 𝑖𝑠 𝑡ℎ𝑒 𝑠𝑎𝑚𝑝𝑙𝑒 𝑚𝑒𝑎𝑛;
• 𝜇 = 𝑖𝑠 𝑡ℎ𝑒 ℎ𝑦𝑝𝑜𝑡ℎ𝑒𝑠𝑖𝑧𝑒𝑑 𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛 𝑚𝑒𝑎𝑛;
• 𝑠 = 𝑖𝑠 𝑡ℎ𝑒 𝑠𝑎𝑚𝑝𝑙𝑒 𝑠𝑡𝑎𝑛𝑑𝑎𝑟𝑑 𝑑𝑒𝑣𝑖𝑎𝑡𝑖𝑜𝑛;
• 𝑛 = 𝑖𝑠 𝑡ℎ𝑒 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑜𝑏𝑠𝑒𝑟𝑣𝑎𝑡𝑖𝑜𝑛𝑠 𝑖𝑛 𝑡ℎ𝑒 𝑠𝑎𝑚𝑝𝑙𝑒
30
Testing for the Population Mean: Population Standard Deviation Unknown
ABC insurance company claims department reports that the mean cost to
process a claim is N60. An industry comparison show this amount to be
larger than most of other insurance companies. As such, the company
Instituted cost cutting measures. To evaluate the effect of the cost cutting
measures, the manager randomly take a sample of 26 claims processed
last months. The sample information is reported below:
45 49 62 40 43 61
48 53 67 63 78 64
48 54 51 56 63 69
58 51 58 59 56 57
38 76
At 0.01 significance level, it is reasonable to conclude that the mean cost to process a claim
is less than N60.
Note: When you compute the mean sample, you will get 56.42
31
Solution:
32
t-Distribution Table (portion)
34
Testing for a Population Mean with a Known Population Standard Deviation
ഥ−𝝁
𝑿
𝒕= 𝒔 𝟓𝟔. 𝟒𝟐 − 𝟔𝟎 −𝟑. 𝟓𝟖
ൗ 𝒏 𝒕= 𝒕= 𝒕 = -1.818
𝟏𝟎. 𝟎𝟒𝟏ൗ 𝟏. 𝟗𝟔𝟗𝟎𝟎𝟔
𝟐𝟔
Because -1.818 does not fall in the rejection region, H0 is not rejected at the .01 significance
level.
We have not demonstrated that the cost-cutting measures reduced the mean cost per claim
to less than 60. The difference of -4.07 (55.93 - 60) between the sample mean and the
population mean could be due to sampling error.
38
Testing for a Population Mean with an Unknown Population Standard Deviation-
Example
The current rate for producing 5 amp fuses at Hyper Electric Co.
is 250 per hour. A new machine has been purchased and
installed that, according to the supplier, will increase the
production rate. A sample of 10 randomly selected hours from
last month revealed the mean hourly production on the new
machine was 256 units, with a sample standard deviation of 6
per hour. At the .05 significance level can Hyper Electric
concludes that the new machine is faster?
39
Testing for a Population Mean with a Known Population Standard Deviation- Example continued
40
Testing for a Population Mean with a Known Population Standard Deviation- Example continued
X 256 250
t 3.162
s n 6 10
41
Problem
• Suppose that it is known from experience that the standard deviation
of the weight of 8 ounce packages of cookies made by a certain
bakery is 0.16 ounce. To check whether its production is under
control a random sample of 25 packages were selected and the
weight mean computed for the sample is 8.091 ounce. Since the
baker stand to lose money when the mean is greater than 8 and the
customer losses out when mean is less than 8. Test the null
hypothesis mean equal 8 at 0.01 significance level.
T- Tests: Comparing Population Means
Comparing two populations – Some Examples
• Imagine you want to find out whether people who read statistics books
are better at analyzing data than those who do not.
1. You set up an experiment with two groups (A and B), group A was
allowed to read a statistics book while group B was not. The two
groups were asked to analyze the same data.
2. You run an experiment with one group only, test their analysis skills,
make them read a statistics book, and then test their skills again.
3. You find some people who read statistics books and other people
who do not and compare their analysis skills
All the 3 problems would end up with one variable that tells you
whether a person reads statistics books or not—a dichotomous variable
that defines group membership—and one continuous variable that
summarizes people’s analysis skills (or statistics performance).
t-test continues
• The above research question concerning whether people who
read statistics books are better at analyzing data can be
answered using t-test.
• A t-test takes the average score of one group and as a reference
point and determines whether a second group’s average score
differs from that of the first one by estimating the distance btw
the two means comparing that distance to the variance in the
data.
• A t-test simply calculates the difference btw 2 group means and
compares it to the average distance of all data point to the mean
Types of t-test
1. Independent sample test: This 2. Paired Sample t-test: this is
compares the average scores of two where experiment is run with
independent samples
one group only.
• With respect to the research
question raised, you can address the Get a group and test their ability
questions as follows: at data analysis, then allow them
i. Set up two groups, one read statistics book and test their
experimental group and the other ability again. i.e. test them before
controlled group the test and test them after the
ii. Get people who read statistics and test.
other people who do not and
compare their analysis skills
One Sample t-test
• The one-sample test is used to determine whether a sample comes from
a population with a specific mean. This population mean is not always
known, but is sometimes hypothesized.
• Though it compares two means, it does so based on one sample data.
For example, you are allow a group to read statistics book, give them a
test and compare with the available national average score.
• A one sample test cannot distinguish between groups, rather it will
distinguish difference between a selected dependent variables and a
specified mean.
• Your sample would be the group that read statistics books and your
population mean would be the national average score.
t -Test of Hypothesis
• Assumptions
• When you choose to analyze your data using a one-sample t-test,
ensure that the data meet the following assumptions:
1. The dependent variable should be measured at the interval or ratio
level;
2. The data are independent (i.e., not correlated/related), which means
that there is no relationship between the observations. This is more
of a study design issue than something you can test for;
3. There should be no significant outliers;
4. The dependent variable should be approximately normally
distributed.
ID Read stats books Analytic skills
1 No 32
2 Yes 61
3 Yes 93
4 No 65
5 Yes 75
6 No 70
7 No 62
8 No 61
9 Yes 65
10 Yes 78
11 Yes 94
12 Yes 96
13 No 46
14 Yes 79
... ... ...
Two Sample test: Independent Sample
• The samples are from independent populations.
X1 X 2
z
12 22
n1 n2
50
EXAMPLE 1
The U-Scan facility was recently installed at the Shoprite Mall in Abuja.
The store manager would like to know if the mean checkout time using
the standard checkout method is longer than using the U-Scan. The
manager gathered the following sample information. The time is
measured from when the customer enters the line until their bags are in
the cart. Hence the time includes both waiting in line and checking out.
Test the null hypothesis at 0.01 significance level.
Customer Type Sample Mean Population STD Sample Size
51
EXAMPLE 1 continued
52
Example 1 continued
Step 4: State the decision rule.
Reject H0 if Z > Z
Z > 2.33
53
Example 1 continued
Step 5: Compute the value of z and make a decision
Xs Xu
z
s2 u2
ns nu
5.5 5.3 The computed value of 3.13 is larger than the critical
0.40 2 0.30 2 value of 2.33. Our decision is to reject the null
hypothesis. The difference of .20 minutes between the
50 100
mean checkout time using the standard method is too
0. 2
3.13 large to have occurred by chance. We conclude the U-
0.064 Scan method is faster.
54
Comparing Population Means with Unknown Population Standard Deviations (the
Pooled t-test)
55
Comparing Population Means with Unknown
Population Standard Deviations (the Pooled t-test)
Finding the value of the test
statistic requires two steps.
n1 n2 2
p
56
Comparing Population Means with Unknown Population Standard Deviations (the
Pooled t-test)
Owens Lawn Care, Inc., manufactures and assembles lawnmowers
that are shipped to dealers throughout the United States and Canada.
Two different procedures have been proposed for mounting the
engine on the frame of the lawnmower. The question is: Is there a
difference in the mean time to mount the engines on the frames of the
lawnmowers?
The first procedure was developed by longtime Owens employee
Herb Welles (designated as procedure 1), and the other procedure
was developed by Owens Vice President of Engineering William
Atkins (designated as procedure 2). To evaluate the two methods, it
was decided to conduct a time and motion study.
A sample of five employees was timed using the Welles method and
six using the Atkins method. The results, in minutes, are shown on
the right. Is there a difference in the mean mounting times? Use the
.10 significance level.
57
Comparing Population Means with Unknown Population Standard Deviations (the Pooled t-test) -
Example
Step 1: State the null and alternate hypotheses.
H0: µ1 = µ2
H1: µ1 ≠ µ2
Step 2: State the level of significance. The .10 significance level is stated in
the problem.
58
Comparing Population Means with Unknown Population Standard Deviations (the Pooled t-test) - Example
59
Comparing Population Means with Unknown Population Standard Deviations (the Pooled t-test) -
Example
Step 5: Compute the value of t and make a decision
60
Comparing Population Means with Unknown Population Standard Deviations (the Pooled t-test) -
Example
61
Comparing Population Means with Unequal Population Standard Deviations
62
Comparing Population Means with Unequal Population Standard
Deviations
Personnel in a consumer testing laboratory are evaluating the absorbency
of paper towels. They wish to compare a set of store brand towels to a
similar group of name brand ones. For each brand they dip a ply of the
paper into a tub of fluid, allow the paper to drain back into the vat for two
minutes, and then evaluate the amount of liquid the paper has taken up
from the vat. A random sample of 9 store brand paper towels absorbed the
following amounts of liquid in milliliters.
8 8 3 1 9 7 5 5 12
An independent random sample of 12 name brand towels absorbed the
following amounts of liquid in milliliters:
12 11 10 6 8 9 9 10 11 9 8 10
Use the .10 significance level and test if there is a difference in the mean
amount of liquid absorbed by the two types of paper towels.
63
Comparing Population Means with Unequal Population Standard Deviations
64
Comparing Population Means with Unequal Population Standard Deviations -
Example
The computed value of t is less than the lower critical value, so our
decision is to reject the null hypothesis. We conclude that the
mean absorption rate for the two towels is not the same.
65
Two-Sample Tests of Hypothesis: Dependent Samples
Dependent samples are samples that are paired or related in some
fashion.
For example:
• If you wished to buy a car you would look at the same car at two
(or more) different dealerships and compare the prices.
• If you wished to measure the effectiveness of a new diet you
would weigh the dieters at the start and at the finish of the
program.
66
Comparing Dependent and Independent Samples
• Before and after studies: Suppose you want to measure whether the
production output of workers is influenced by music. First you select a
sample of workers and measure their output under the current
environmental conditions. Then you install the musical device and
again measure the output of the same workers
• Pairing observations: Assume you want to evaluate the best teaching
method , you apply 2 different methods to same sample and compare
the scores.
Why do we prefer dependent samples to
independent samples?
• By using dependent samples we are able to reduce the variation in
sampling distributions.
Hypothesis Testing Involving Paired Observations
Use the following test when the samples are dependent:
d
t
sd / n
Where
d is the mean of the differences
sd is the standard deviation of the differences
n is the number of pairs (differences)
69
Hypothesis Testing Involving Paired
Observations - Example
• ASO Savings and Loan wishes to
compare the two companies it uses to
appraise the value of residential
homes. The company selected a
sample of 10 residential properties
and scheduled both firms for an
appraisal. The results, reported in
Naira are shown on the table (right).
• At the .05 significance level, can we
conclude there is a difference in the
mean appraised values of the homes?
70
Hypothesis Testing Involving Paired
Observations - Example
Step 1: State the null and alternate hypotheses.
H0: d = 0
H1: d ≠ 0
71
Hypothesis Testing Involving Paired Observations -
Example
Step 4: State the decision rule.
Reject H0 if
t > t/2, n-1 or t < - t/2,n-1
t > t.025,9 or t < - t.025, 9
t > 2.262 or t < -2.262
72
Hypothesis Testing Involving Paired Observations -
Example
Step 5: Compute the value of t and make a decision
73