0% found this document useful (0 votes)
215 views47 pages

Chapter 5.test of Hyp

The document discusses hypothesis testing, which involves formulating a null hypothesis (H0) and an alternative hypothesis (Ha) to test claims about population parameters. The key points are: 1) H0 assumes no difference or the "zero difference" between variables, while Ha assumes a significant difference. 2) The type of test (one-tailed or two-tailed) depends on the form of Ha - a two-tailed test for "not equal to", a left-tailed test for "less than", and a right-tailed test for "greater than". 3) There are two types of errors in hypothesis testing - Type I errors occur when H0 is wrongly rejected, and Type II errors

Uploaded by

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

Chapter 5.test of Hyp

The document discusses hypothesis testing, which involves formulating a null hypothesis (H0) and an alternative hypothesis (Ha) to test claims about population parameters. The key points are: 1) H0 assumes no difference or the "zero difference" between variables, while Ha assumes a significant difference. 2) The type of test (one-tailed or two-tailed) depends on the form of Ha - a two-tailed test for "not equal to", a left-tailed test for "less than", and a right-tailed test for "greater than". 3) There are two types of errors in hypothesis testing - Type I errors occur when H0 is wrongly rejected, and Type II errors

Uploaded by

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

Chapter

Statistics can help us in making decisions; establishing numerical benchmarks;


monitoring and evaluating the progress of experiments; proving the effectiveness
of the proposed systems or treatments to a problem, policy, or program; and many
more. Part of the process includes forming reliable conclusions; and the decision
making starts with the testing of the hypothesis.
Good decisions will lead to success, progress, and improvements. On the other
hand, bad ones may cause serious problems and conflicts. The test of hypothesis
will aid the decision making process so we can make the right choices for better
results.

149
LESSON 5-1
Introduction to
y pothesis Testing
H

After this lesson, you should be


able to:
• illustrate the null and
alternative hypotheses,
the level of significance,
Explore and Learn
the rejection region, and
the types of errors in
hypothesis testing; In the previous lessons, we have learned that the
• calculate the probability of sample mean and proportion are point estimates in
committing a Type I error; determining the confidence interval in the z- and
• identify the real parameter T-distribution which can be used in solving
to be tested in real-life problems related to real life situations.
problems; In this lesson, we perform the steps in making
• formulate a null and decisions and drawing conclusions from the results of
alternative hypothesis the data obtained in hypothesis testing.
about a population mean;
and
• identify the appropriate
form of test statistic.

A hypothesis is a proposed explanation, assertion, or assumption about


a population parameter or about the distribution of a random variable. It is a
supposition advanced as a basis for argument. It is tested using statistical methods,
generally using experimental samples.

IntroductIon to HypotHesIs testIng 151


Statistical Hypotheses
The question of interest or under test is simplified into two competing contradictory
statements: the null hypothesis, denoted by H0, against the alternative hypothesis,
denoted by Ha. These two hypotheses, however, are not treated on an equal basis. Special
consideration is given to the null hypothesis because it is the hypothesis to be tested as to
whether it should be rejected or not. The alternative hypothesis, from the word itself, will be
the choice if the null hypothesis were to be rejected.

The null hypothesis (H0) is a statement of “zero” difference. Here, H0 assumes that
there is no difference between two means (the population mean and the sample mean) or
variables being compared.

On the other hand, the alternative hypothesis (Ha) is a statement that assumes there is a
significant difference between the two means or variables under test or investigation.

In the previous lesson, if the difference between the means or variables being compared
is based on the right tail or left tail of the curve, the test is a one-tailed test. It indicates that
the data obtained in sampling is either higher or lower than the idealized model data.

Illustrative Example 5-1

The school’s record management claims that the average score of the incoming
freshmen during the admission test is 73. The teacher wishes to find out if the claim is true.
She tests whether or not there is a significant difference between the batch average and the
mean scores of students in her class. What is the appropriate hypothesis to be used in this
case?

Solution:

Let the population mean be µ or the average score of the incoming freshmen, and the
sample mean be or the average score of the students in her class.

The teacher may select any of the following statements as her null and alternative
hypothesis:

H0: The average score of the incoming freshmen is 73; or µ = 73.


Ha: The average score of the incoming freshmen is not 73; or µ ≠ 73.
or

H0: The average score of the incoming freshmen has no significant difference
with the mean score of her students; or µ = .

Ha: The average score of the incoming freshmen has a significant difference with
the mean score of her students; or µ ≠ .

IntroductIon to HypotHesIs testIng 151


Illustrative Example 5-2

The mean profit of a company is 1.02 million a month with a standard deviation of
0.2 million. The newly appointed company manager utilized a proposed system of
operation in 5 randomly selected branches, and the mean profit in one month is
1.2 million. If the manager wishes to find out if the proposed system of operation he
utilized is more effective than the existing one, what is the appropriate hypothesis to be
tested in this problem?

Solution:

In the given situation, µ = 1.02 is considered as the idealized model while


= 1.20 the data obtained from sampling.

The manager may select the following statements as his null and alternative
hypothesis:

H0: µ = ; or
There is no significant difference between the mean profit under the existing
system of operation and the mean profit under the proposed system.
Ha: µ < ; or
The mean profit under the existing system is less than that of the proposed
system.

In hypothesis testing, it is necessary to choose the right type of test in order to arrive at a
reliable conclusion. As a rule of thumb, we follow the conditions below.
1. If Ha is of the form µ ≠ or µ ≠ c where c is a constant, then we use a two-tailed test.
2. If Ha is of the form µ < or µ < c where c is a constant, then we use a left-tailed test,
which is a one-tailed test.
3. If Ha is of the form µ > or µ > c where c is a constant, then we use a right-tailed test,
which is a one-tailed test.
Based on the rules above, we should use a two-tailed test for illustrative example 5-1 and
a left-tailed test for illustrative example 5-2.

IntroductIon to HypotHesIs testIng 151


The data below shows the mean scores in the post-test of two sample groups of
students taught using two different methods of teaching mathematics.

= 80 1 = 8 = 20

= 90 2 = 10 = 10

Formulate a null hypothesis about the population mean.

Formulate an alternative hypothesis for (a) a two-tailed test and


(b) a one-tailed test.

The following are notations and definitions we will encounter in hypothesis testing:

Notation Definition
Significance level (1%, 5%, etc.); Probability of Type I error or the probability
of rejecting H0 when H0 is true.
Probability of not rejecting the alternative hypothesis; Probability of Type II
error or the probability of not rejecting H0 when H0 is false.
Confidence level (99%, 95%, etc.); This is related to , such that =1– .
n Sample size
f (x) Probability function, values of which are restricted between 0 and 1.
F(x) Probability distribution function
df Number of degrees of freedom
H0 Null hypothesis
Ha Alternative hypothesis
c The z- or t-value set as the critical value
(x) Probability distribution function (standardized probability)
μ Population mean
σ2 Population variance
σ Population standard deviation
Sample mean
s2 Sample variance
s Sample standard deviation

IntroductIon to HypotHesIs testIng 153


Two Types of Errors
• Type I error – occurs when the null hypothesis H0 is rejected when it is true. That is,
when H0 is wrongly rejected.
• Type II error – occurs when the null hypothesis H0 is not rejected when it is, in fact,
false.

A table of outcomes in decision making is shown below. Each outcome comes with the
corresponding probabilities of their occurence.

Decision

Reject H0 Do not reject H0


μ = μ1 μ = μo

Type I Error Correct


Hypothesis

H0 : μ = μo
Correct

P= P=1–

Correct Type II error


Ha : μ = μ1
P=1–β P=β

Probability of Committing a Type I or Type II Error


Assume that the population is normally distributed with a mean μ. Then, a sample is
taken from the population and it has a sample mean . To test the null hypothesis H0 that
the sample mean is the same as the population mean, a critical value c is determined such
that the probability of being outside the interval [μ, c] is very small. This is the
probability that the null hypothesis is rejected when it is actually true.

In this section, we will only focus on Type I error as the computation for the Type II
error is beyond the scope of this book.

A sample two-tailed test when = 5%:


Two-tailed test

95 %
Rejection Acceptance Rejection
region region for region

2.5 % 2.5 %

(critical value c)
z = –1.96

IntroductIon to HypotHesIs testIng 154


z
=
1
.
9
6
(
c
r
i
t
i
c
a
l
v
a
l
u
e
c
)

IntroductIon to HypotHesIs testIng 155


A sample one-tailed test when = 5%:

95 %
Acceptance Rejection
region for region
5%

z = 1.645
(critical value c)

Illustrative Example 5-3

The mean score of all grade 11 students during a departmental examination in calculus
is claimed to be 65 with a standard deviation of 9. The 40 students of section Peter have a
mean score of 68. The teacher wishes to find out if the scores of the grade 11 students are
significantly higher than the scores of the students in section Peter. Assuming the scores are
normally distributed,

1. write an appropriate null and alternative hypotheses; and

2. compute the probability of committing Type I error.

Solution:

Given: µ = 65 (population mean), = 68 (sample mean), σ = 9 (population standard


deviation), and n = 40

1. H0: The mean score of all grade 11 students is 65; or


H0: µ = 65.
Ha: The mean score of all grade 11 students is higher than 65; or
Ha: > 65.
2. The probability of committing a Type I error is equivalent to the probability of
getting the alpha error . If the scores follow a normal distribution, then from the
Central Limit Theorem:

z= = = 2.11

IntroductIon to HypotHesIs testIng 156


At z = 2.11, the area under the normal curve to the right of is 0.4826 or 48.26%. Thus,
= 0.0174 or 1.74%.

Type II error
0.4826
(48.26%) Type I error
= 0.0174 or 1.74%

–3 –2.5 –2 –1.5 –1 –0.5 0 0.5 1 1.5 2 2.5 3


= 65 = 68
z = 2.11

Hence, the probability of committing a Type I error is 1.74%.

Illustrative Example 5-4

The mean age of the registered voters in a certain municipality is 35. A random sample
of 35 registered voters from the same community has a mean age of 37 and the variance is
known to be 36. If the field reporter wants to prove that that the record is not 35, what is
the appropriate null and alternative hypotheses? What is the probability of getting a Type I
error? Can we conclude that the mean age is not 35 given a confidence level of 95%?

Solution:

Given: = 35, = 37, 2


= 36 (which yields = 6), and n = 35
H0: The mean age of the registered voters is 35; that is H0: = 35.
or

H0: There is no significant difference between the mean age of the population and
the sample group of registered voters; that is, H0: =

Ha: There is a significant difference between the mean age of the population and the
mean age of the sample group of registered voters; that is, Ha: ≠
We will utilize the two-tailed test since the aim is to prove that the mean age is not
35 and could either be lower or higher than 35.

IntroductIon to HypotHesIs testIng 157


The probability of committing a Type I error is equivalent to the probability of
getting the alpha error ( ) or the significant level. If the scores follow a normal
distribution, then from the Central Limit Theorem:

z= = = 1.97.

At z = 1.97, the value of is equal to 0.0244 or 2.44%.

Hence, the probability of getting a Type I error must be 2.44% × 2 = 4.88%.

The graphs below shows the comparison between the alpha error ( ) of the
computed value of z and the confidence interval at a confidence level of 95%.

At 95% confidence interval, H 0 is rejected.

95% confidence
interval = 2.44% (z = 1.97)
= 2.44% falls in the
z = 1.97 0.45 0.45 rejection region

= 0.025(2.5%) = 0.025(2.5%)
-3 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3

z = 1.96 z = 1.96

Conclusion: We reject the null hypothesis in favor of the alternative hypothesis.

Take note of the following:


• The conclusion of a hypothesis testing is always whether the null hypothesis should be
rejected or not. Rejecting the null hypothesis means that the conclusion is in favor of the
alternative hypothesis.
• Experts never accept the null hypothesis. They always use the term “do not reject” in
place of “accept”.
• If the p-value is “small,” then the sample data provides evidence that tends to refute
the null hypothesis; in particular, if the p-value is less than the significance level , then
the null hypothesis can be rejected and the result is statistically significant at that level.
However, if the p-value is greater than , then the null hypothesis is retained and the
result is not statistically significant at that level.

IntroductIon to HypotHesIs testIng 158


1. The mean water consumption of households living in Christine Subdivision is
33.5 cubic meters per month. A random sample of 40 households in the same place
has a mean water consumption of 30 cubic meters per month with a standard
deviation of 8 cubic meters. Formulate an appropriate null and alternative
hypotheses. What is the probability of committing a Type I error? Can we conclude
that the mean consumption is not 33 cubic meters per month with a confidence level
of 95%? Use a one-tailed test.

Write the letter of your answer. Write ”X” if your answer is not among the choices.
1. What is the proposed explanation, assertion, or assumption about a population
parameter?
a. assumption c. argument
b. hypothesis d. proposition

2. The probability of committing a Type I error means .


a. rejection of null hypothesis when it is true
b. not rejecting the null hypothesis when it is false
c. not rejecting the alternative hypothesis
d. acceptance of null hypothesis

3. The probability of committing Type II error means .


a. rejection of null hypothesis when it is true
b. not rejecting the null hypothesis when it is false
c. not rejecting the alternative hypothesis
d. acceptance of the null hypothesis

4. What is the probability of not rejecting the alternative hypothesis ?


a. beta error c. Type I error
b. alpha error d. confidence error

IntroductIon to HypotHesIs testIng 159


5. Which of the following is a null hypothesis?
a. µ ≠ c. µ<
b. µ > d. µ1 = µ2

For numbers 6–10: Given: µ = 300, = 290, = 25, n = 35, and Ho: µ = 300.

6. What is the probability of getting a Type I error?


a. 0.0178 c. 0.9710
b. 0.9822 d. 0.0230

7. If the test is two-tailed, what is the appropriate alternative hypothesis?


a. µ ≠ c. µ<
b. µ > d. µ =

8. Assuming the true parameter has a confidence level of 95%, the error is .
a. beta error a. Type I error
b. Type II error b. confidence error

9. What is the correct conclusion?

a. There is no significant difference between the means; or µ = .


b. There is significant difference between the two means; or µ ≠ .
c. The population mean is higher than the sample mean; or µ > .
d. The population mean is lower than the sample mean; or µ < .

IntroductIon to HypotHesIs testIng 160


LESSON 5-2
Test of y pothesis Using

the z -test

After this lesson, you should be Explore and Learn


able to:
• explain the basic principles
of hypothesis testing; In the previous lesson, we learned about
the distinction between the null and alternative
• evaluate the difference
hypotheses, as well as when to reject or not reject the
between the sample mean
null hypothesis.
and the hypothesized
population mean; In this lesson, you will learn about the power of
• test a hypothesis about the hypothesis testing, its significance in obtaining
population proportion by accurate findings, and how to draw the right
using z-test; and conclusions.

• use software for one-


sample test and two-
sample test.

The z-test is a test used to investigate large sample sizes (n > 30) and assess
whether two means or proportions differ significantly. The data are assumed to come
from a normal population whose variance is known.

Targets in Testing the Hypothesis


1. Test whether the difference between two means or proportions is significant or not.
2. Confirm existing information.
IntroductIon to HypotHesIs testIng 161
3. Verify a theory.
4. Formulate an educational guess resulting from anecdotal observations.

IntroductIon to HypotHesIs testIng 162


Recall the following notations and definitions in hypothesis using the z-test.
Notation Definition
Significance level (commonly used are 1%, 2.5%, 5%, 1%, and 10%);
Probability of a Type I error
β Probability of not rejecting the alternative hypothesis; probability
of a Type II error
μ Population mean
Sample mean
Population standard deviation
s Sample standard deviation
N Population size
n Sample size
s2 Sample variance
γ Confidence level (95%, 99%, etc.)
Ho Null hypothesis
Ha Alternative hypothesis
c z-value as the critical value

Steps in Hypothesis Testing Using the z -test


Step 1 Formulate a null hypothesis H0 or the hypothesis to be tested.

Note that H0 takes any of the following forms: µ = or µ1 = µ2. Then form an Ha
which asserts an inequality between the values of µ and or µ1 and µ2.
Hence, Ha may take the two-tailed form: µ ≠ or µ1 ≠ µ2; or a one-tailed test form,
either a left-tailed test: µ < or µ1 < µ2; or a right-tailed test: µ > or µ1 > µ2.

Step 2 Determine the appropriate test to be used. We use the z-test if n > 30 and the
population standard deviation is given. On the other hand, we use the
t-test if n ≤ 30 (to be discussed in the next chapter).
Step 3 Determine the critical value c using the table below.

Level of significance
Test type
= 1% = 2.5% = 5% = 10%

One-tailed test c = 2.33 c = 1.96 c = 1.645 c = 1.28

Two-tailed test c = 2.575 c = 2.33 c = 1.96 c = 1.645

test of HypotHesIs usIng tHe z-test 161


Step 4 Compute for the z-score using the Central Limit Theorem:

1. For one-sample group

• Standard score of the sample mean using the population mean:

z=

2. For two-sample groups with sizes n1 and n2

• Two sample means with n1 = n2 = n:

z= or z =

• Two population means with n1 = n2 = n:

z=

• Two sample means with n1 ≠ n2:

• Two population means with n1 ≠ n2:

Step 5 Decide whether to accept or not accept H0.


If the computed value of z in step 4 is less than the critical value c in step 3, we fail
to reject the null hypothesis H0. However, if the computed value z > c, then we
reject H0.

Illustrative Example 5-5

A manufacturer of cellular phone batteries claims that when fully charged, the mean life
of his products lasts for 26 hours with a standard deviation of 5 hours. Mr. DG, a regular
distributor, randomly picked and tested 35 of the batteries. His test showed that the average
life of his sample is 24.3 hours. Is there a significant difference between the average life of all

test of HypotHesIs usIng tHe z-test 162


of the manufacturer’s batteries and the average battery life of his sample? Use the
two-tailed test at = 5%.

Solution:

Given: population mean µ = 26


sample mean = 24.3
sample size n = 35
standard deviation =5
level of significance = 5% (two- tailed)
Step 1 Form the null hypothesis H0.

H0: There is no significant difference between the population mean


and sample mean.
or
H0: The batteries are not significantly different from the sample
batteries in terms of the number of hours the batteries last.

Form the alternative hypothesis Ha.


Ha: There is a significant difference between the population mean and
sample mean.
or
Ha: The mean life of the batteries significantly differs from the mean
life of the sample batteries.
Step 2 A two-tailed z-test must be used since n > 30 and the population variance
is known (from = 5, it follows that 2 = 25).
Step 3 A two-tailed test at = 5% would give c = 1.96.

Two-tailed (Two-sided) test

test of HypotHesIs usIng tHe z-test 163


Step 4 The computed value is:

z=

= 2.01

Step 5 Since z > c, or that the computed z-score is in the rejection region
of H0, we reject H0.
Conclusion: There is a significant difference between the population mean and
the sample mean; or
When fully charged, the mean life of the sample batteries are
significantly different from the rest of the batteries.

Illustrative Example 5-6

Test the hypothesis in illustrative example 5-5 using a one-tailed test and µ = 25.5.
Solution:
Given: population mean µ = 25.5
sample mean = 24.3
sample size n = 35
standard deviation =5
level of significance = 5% (one-tailed)

Step 1 Form the null hypothesis.

H0: There is no significant difference between the mean of the


batteries and sample of the batteries; or
The batteries are not significantly different from the sample
batteries.

Form the alternative hypothesis.


The alternative hypothesis will change for this problem since a one-
tailed statement is required.
Ha: The mean life of the batteries are significantly longer than the
mean life of sample batteries.

test of HypotHesIs usIng tHe z-test 164


Step 2 Since n > 30, we use a one-tailed z-test with = 5%.

Step 3 The critical value c is 1.645.

Step 4 Using the formula, the computed z-value is:

z= = = –1.42.

Step 5 Since z < c, we fail to reject H0.


Conclusion: The mean life of the manufacturer’s batteries have no significant
difference with the mean life of the sample.

Testing the Hypothesis Using a z -test Calculator

The z-test calculator, which works like scientific and probability calculators, can be
downloaded for free. In this chapter, we will use one example of this software, the “in-
silico,” which may be accessed through http://in-silico.net/tools/statistics/ztest.

Illustrative Example 5-7

Test the difference between the two means given in illustrative example 5-5 using the
z-test calculator.

Step 1 Select “One-Sample z-test.”

test of HypotHesIs usIng tHe z-test 165


Step 2 Input the following data: µ = 26, = 24.3, n = 35, = 5, and = 5%. Click the
appropriate “Tail/side.” Choose “Both” if you are using a two-tailed test.
Then click “Calculate.”

Step 3 The interpretation appears at the lower part of the box at the right side. This
means that we have to reject the null hypothesis in favor of the alternative
hypothesis. That is, there is a significant difference between the population
mean and the sample mean.

test of HypotHesIs usIng tHe z-test 166


In building an arena, steel bars with a mean ultimate tensile strength of
400 Megapascal (MPa) with a variance of 81 MPa were delivered by the manufacturer.
The project engineer tested 50 steel bars and found out that the mean ultimate tensile
strength is 390 MPa. The decision for the extension of the contract with the manufacturer
depends on the engineer. Test the hypothesis whether or not there is no significant
difference between the two means using a two-tailed test with = 0.01.

What are the appropriate hypotheses for the two-tailed test?

What is the test statistic to be used and the reasons for its selection?

What is the critical value c?

What is the value of the test statistic or the computed value?

Formulate a conclusion about the given situation.

z -test with Two Sample Means

Illustrative Example 5-8

The data were gathered from the result of testing the effectiveness of two different
strategies in increasing the mean sales of a product . Can we conclude that there is a
significant difference between the two strategies based from the mean sales? Test the
hypothesis using a two-tailed test at = 10% with the given data in each strategy.

Strategy A: = 155,000, s1= 7,000, and n1 = 45 locations.


Strategy B: = 149,000, s2= 5,000, and n2 = 45 locations.

Step 1 State the null and alternative hypotheses.

H0 : There is no significant difference between the two strategies based from


the mean sales of the product. (µ1 = µ2)

Ha : There is a significant difference between the two strategies based from


the mean sales of the product. (µ1 ≠ µ2)

Step 2 We use the z-test since n > 30.

test of HypotHesIs usIng tHe z-test 167


Step 3 The z-table gives c = ±1.645 for = 0.1 (10%) two-tailed test.

90%
Rejection region Non-rejection Rejection region

z = –4.68 z = 4.68
= 5%
-3 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 2.5 3

c = –1.645 c = –1.645

Step 4 Since = n, we have:

z = = 4.68.

Step 5 Since the computed value z is higher than critical value c, thus, it falls in the
rejection region which means we reject H0.
Conclusion: There is a significant difference between the mean sales of the two
strategies.

Now we test the hypothesis of the given data in illustrative example 5-8 using a z-test
calculator.

Click “Two-Sample z-test”.

Enter the data: = 155,000, s1 2 = 7,000, n1 = 45, 2 = 149,000, s22 = 5,000, and n2 = 45.
Choose “Both” then click “Calculate.”

test of HypotHesIs usIng tHe z-test 168


The results at the right tell us that our two samples are significantly different.

test of HypotHesIs usIng tHe z-test 169


Illustrative Example 5-9

Test the hypothesis of the given data in illustrative example 5-8, assuming n1 = 40 so
n1 ≠ n2. Use a one-tailed test at = 1%.
Strategy A: 1 = 155,000 s1 = 7,000 n 1 = 40 areas
Strategy B : 2 = 149,000 s2= 5,000 n 2 = 45 areas

Solution:
Step 1 H0: There is no significant difference between the two strategies based
from the mean sales of the product; or µ1 = µ2.

Ha: The mean sales of the product from strategy A is higher than the
mean sales of the product in strategy B; or µ1 > µ2.
Step 2 We use the z-test since n > 30.

Step 3 From the table of z-scores where = 0.01 in a one-tailed test, c is 2.33.

Alpha error Alpha error


Test type
= 1% (0.01) = 5% (0.05)

One-tailed test + 2.33 + 1.645

Step 4 Compute for the z-value.

For n1 ≠ n2 in a two-sample group:

test of HypotHesIs usIng tHe z-test 170


Step 5 The computed z-value is higher than the critical value c = 2.33. Thus, it falls in
the rejection region, which means we reject H0.
Conclusion: The mean sales of the product from strategy A is higher than the
mean sales of the product in strategy B; or µ1 > µ2.

Given the previous set of data, we test the hypothesis using a z-test calculator.

Notice that there is a slight difference in the values of z because of the rounding-off of
the value in step 4.

A hog raiser in a certain province uses two methods of pig-farming: intensive pig
farming, where pigs are housed indoors in group-housing or straw-lined sheds; and
extensive pig farming, where pigs are allowed to wander around the farm or fence. Test
the hypothesis whether or not the mean weight of pigs in intensive farming is better
than the extensive farming based from the mean weight of the pigs in the sample with
data shown below. Use a one-tailed test at = 1%.

Intensive farming: = 85 kg, = 10 kg, = 55

Extensive farming: = 79 kg, = 6 kg, = 45

test of HypotHesIs usIng tHe z-test 171


Formulate null and alternative hypotheses.
Write the test statistic, the level of significance and the one-tailed test.
Determine the critical value of the test statistic.
Find the computed value of the test statistic.
What is the correct decision and conclusion?

Hypothesis Testing of the Difference in Proportions


Testing the difference in proportions is the same as testing the difference betwen two
means. They differ only in formula.

For a one-sample group:

and

where n is the sample size

x is the number of “successes” in n samples

is the proportion of the number of successes to the number of samples


p0 is the proportion to be tested

For a two-sample group:

Letting

where n1 is the sample size of the first sample

test of HypotHesIs usIng tHe z-test 172


x1 is the number of “successes” in the first sample

1 is the proportion of the number of “successes” to the number of samples in the


first sample

n2 is the sample size of the second sample


x2 is the number of “successes” in the second sample

2 is the proportion of the number of “successes” to the number of samples in the


second sample.

Illustrative Example 5-10

The records of patients in the hospital show that 35 of 100 patients have a high
cholesterol level of 240 mg/dl and above. Can we conclude that 30% of the patients have
high cholesterol level? Use a one-tailed test with = 5%.

Solution:

Given: x = 35, n = 100, = 0.35, = 0.05, p0 = 0.3

Step 1 H0: There is no significant difference between the population and sample
proportions, that is, p0 = .

Ha: The population proportion is higher than the sample proportion; that
is, p0 = .
Step 2 We use the z-test with = 5%, one-tailed test.

Step 3 Using = 5% and one-tailed test, we have c = 1.645.

Step 4 The computed z-value is:

z=

= 1.09

Step 5 Since z < c, thus, it does not fall in the rejection region, which means we
do not reject H0.
Conclusion: There is no significant difference between the population and sample
proportions; or H0: p0 = .

test of HypotHesIs usIng tHe z-test 173


To check our answer using the z-test calculator, we have the following:

Click “One-proportion Z-test.” Enter the necessary data. Then click “Right” for a
right-tailed test. Click “Calculate.”

Hypothesis Testing for Two Sample Proportions


Illustrative Example 5-11

In a study on the effect of cigarette smoking to human health, it was found out that
35 among 55 cigarette smokers aged 40 years old and above suffer from cigarette-related
diseases, and 28 from among 50 smokers aged below 40 years suffer from the same
diseases. Is it safe to conclude that the proportion of smokers aged 40 years old and above
is significantly higher than the proportion of smokers aged below 40 years who suffer from
cigarette-related diseases? Test the hypothesis at = 0.01.

Solution:
The following are the given for each age group:

Age 40 years old and above: x1 = 35, n1 = 55, = 0.64

Age below 40 years old: x2 = 28, n2 = 50, = 0.56

Step 1 H0: That the proportion of smokers aged 40 years old and above does not
differ from the proportion of smokers aged below 40 years old who suffer
from cigarette-related diseases. That is, p1 = p2.
Ha: The proportion of smokers aged 40 years old and above is significantly
higher than the proportion of smokers aged below 40 years old who
suffer from cigarette-related diseases. That is, p1 > p2.

test of HypotHesIs usIng tHe z-test 174


Step 2 We use the z-test with = 0.01, one–tailed test.
Step 3 From the table of z-values, we have c = 2.33.

Alpha error Alpha error


Test type
= 1% = 5%

One-tailed test 2.33 1.645

Step 4 The compute z-value is:

Step 5 The computed z-value is less than the critical value c = 2.33, thus, it does not
fall in the rejection region, which means we do not reject H0.
Conclusion: The proportion of smokers aged 40 years old and above does not
significantly differ from the proportion of smokers aged below
40 years old who suffer from cigarette-related diseases; that is,
p1 = p2.

test of HypotHesIs usIng tHe z-test 175


Checking our the answer using a z-test calculator, we select “Two-proportion Z-test,”
“Unequal” variance, and “Right” Tail-side. After we enter the given data, we click
“Calculate” to get the final answer as shown in the screenshot below.

1. D.G Co. has an average gross sales of 37 million per week from their products in all
of their outlets with a standard deviation of 6 million. An area manager found out
that the average gross sales from the 32 outlets under his jurisdiction is 34.8 million
per week. Is the mean sales of the products of all of the outlets significantly different
from the mean sales of the outlets in the area of the manager? Use = 5%. Perform the
hypothesis testing for both one-tailed test and two-tailed tests.

2. A teacher wants to find out if the webcasting methods of teaching social sciences
subjects is more effective than the existing standard method of teaching. Two classes of
approximately equal intelligence were selected. From one class, the teacher randomly
selected a group of students as experimental group for webcasting methods. From
another class, the teacher then selected another group of students as sample for existing
standard method of teaching. After one trimester, the same tests were given to the
students. Their mean scores are shown in the following table:

Method of teaching Mean score Standard deviation Sample size

Webcasting method = 82.3 = 12 = 42

Existing standard
= 78.5 =9 = 38
method

Test the hypothesis whether or not the webcasting method of teaching social sciences
subjects is more effective than the existing standard method of teaching. Use = 0.05.

test of HypotHesIs usIng tHe z-test 176


LESSON 5-3
Test of y pothesis Using

the t -test

After this lesson, you should be Explore and Learn


able to:
• explain how t-test is used
In the previous lessons, we have learned about the
in hypothesis testing;
use of the z-test in evaluating the difference between
• evaluate the difference
two means or two proportions as well as when to
between the t-test and
reject or not reject the null hypothesis. We now know
z-test;
that the z-test is applicable if sample size
• use t-test in solving n > 30, and proportions np ≥ 5 and nq ≥ 5.
situational problems; and
• solve problems using In this lesson, we will learn about the appropriate
software for one-sample test statistic when n < 30 and the sample variance is
t-tests and two-sample predetermined. This test is popularly known as the
t-tests. t-t est.

The t-test is used when n < 30 and only the sample standard deviation is given
as a basis for the estimation of the population standard deviation. If the sample size
is small, the sampling distribution of the sample mean and standard deviation is no
longer an approximate of the standard normal distribution. Thus, you will have to use
the student’s t- distribution as compensation for using the less information to form
our conclusions.

t-t est as Compared with the z -test


The z-test is used for large sample size (when n > 30) or when the population is know to
be normally distributed with a given population variance.

test of HypotHesIs usIng tHe z-test 177


The t-test is used for small sizes (when n < 30) and when the population variance is
unknown.

test of HypotHesIs usIng tHe z-test 178


Both tests are used in hypothesis testing, specifically to test whether or not there is a
significant difference between the data of two groups. Although the formulas uased to get
the t-scores and z-scores are similar, the tables used to take their respective percentiles are
different.

The shape of a t-distribution is similar to that of a z-distribution, which is bell-shaped


with center at 0. The difference is that the t-distribution is generally shorter and flatter
around the center. This is because the t-distribution varies more since its values depend on
the fluctuations of the mean and standard deviation, whereas the z-values only depend on
the fluctuation of the mean from sample to sample. Another difference would be that the
t-distribution has fatter tails on each end since it always has a standard deviation greater
than 1, unlike the z-distribution which has a standard deviation of 1. However, as the
sample size approaches infinity, the t-distribution will look like more and more like the
z-distribution.

The t-test table or the student’s t-distributions table is shown below where is expressed
as a decimal.

for one-tailed test 0.05 0.025 0.01 0.005


for two-tailed test 0.10 0.05 0.02 0.01
df
1 6.341 12.706 31.821 63.657
2 2.920 4.303 6.065 9.925
3 2.353 3.182 4.541 5.841
4 2.132 2.776 3.747 4.604
5 2.015 2.571 3.365 4.032
6 1.943 2.447 3.143 3.707
7 1.895 2.365 2.998 3.499
8 1.860 2.306 2.896 3.355
9 1.833 2.262 2.821 3.250
10 1.812 2.228 2.764 3.169
11 1.796 2.201 2.718 3.106
12 1.782 2.179 2.681 3.055
13 1.771 2.160 2.650 3.012
14 1.761 2.145 2.624 2.977
15 1.753 2.131 2.602 2.947
16 1.746 2.120 2.583 2.921

test of HypotHesIs usIng tHe t-test 177


for one-tailed test 0.05 0.025 0.01 0.005
for two-tailed test 0.10 0.05 0.02 0.01
df
17 1.740 2.110 2.567 2.898
18 1.734 2.101 2.552 2.878
19 1.729 2.093 2.539 2.861
20 1.725 2.086 2.528 2.845
21 1.721 2.080 2.518 2.831
22 1.717 2.074 2.508 2.819
23 1.714 2.069 2.500 2.807
24 1.711 2.064 2.492 2.797
25 1.708 2.060 2.485 2.787
26 1.706 2.056 2.479 2.779
27 1.703 2.052 2.473 2.771
28 1.701 2.048 2.467 2.763
29 1.699 2.045 2.462 2.756
30 1.697 2.042 2.457 2.750
40 1.684 2.021 2.423 3.551
60 1.671 2.000 2.390 3.460
120 1.658 1.980 2.358 3.373
Infinity 1.645 1.960 2.326 3.291

The formulas used for the t-test are similar with that of the z-test.
1. One-sample t-test:

, where df = n – 1

2. Two-sample t-test:
• Two sample means with n1 = n2 or with unequal variance

, where df = n1 + n2 – 2

test of HypotHesIs usIng tHe t-test 178


• Two sample means with n1 = n2 = n with equal variance

, where df = 2n – 2

• Two population means with n1 = n2


, where df = n1 + n2 – 2

• Two sample means with n1 = n2 or n1 ≠ n2 with equal variance

, where df = n1 + n2 – 2

• Two population means with n1 ≠ n2

, where

df = n1 + n2 – 2
How to interpret the result:

• If the computed value of t exceeds the critical or tabular value, then we reject H0.
• If the computed value of t is less than the critical or tabular value, then we fail to
reject H0.

Illustrative Example 5-12

The mean serum level measured in 12 patients twenty-four hours after they received
a newly recommended antibiotic was 1.2 mg/dl with a standard deviation of 0.4 mg/dl.
If the mean serum level in the general population is 1.0 mg/dl, test whether or not the
mean serum level in the sample group is significantly different from that of the general
population. Use = 5%.

Given: = 1.2, s = 0.4, n = 12, µ = 1.0, and = 5%

test of HypotHesIs usIng tHe t-test 179


Solution:
Step 1 H0: There is no significant difference between the mean serum level of the
sample group and the general population; or µ = = 1.0

Ha: That there is a significant difference between the mean serum level of
the sample group and the general population; or .

Step 2 We use the t-test since n < 30 and only the sample standard deviation is
given. Furthermore, we know that we should conduct a two-tailed test
since the alternative hypothesis is a state of inequality.
Step 3 Since n = 12, we have df = n – 1 = 12 – 1 = 11. It is also given that = 5%
or 0.05. Locating the intersection = 0.05 from two-tailed test and df = 11,
we get c = 2.201.

for one-tailed test 0.05 0.025 0.01 0.005

for two-tailed test 0.10 0.05 0.02 0.01

df

11 1.796 2.201 2.718 3.106

Step 4 Computing for the t-score, we have:

Step 5 Since our computed value of 1.73 is less than the critical value of 2.201,
then we fail to reject H0.
Conclusion: There is no siginificant difference between the mean serum of the
sample group and that of the population.

t -test Using a Statistical Calculator

Step 1 Click the t-test at the right side of the page which is one of the options under
“Statistical Calculators.”
Step 2 Choose “One-Sample t-test” at the top.

test of HypotHesIs usIng tHe t-test 180


Step 3 Click “Both” because the test is two-tailed.
Step 4 Enter the given data.
Step 5 Click “Calculate.” You will see the results to the right of the calculator.

Illustrative Example 5-13

Ten randomly selected gold mines produced 21, 19, 20, 22, 24, 21, 19, 22, 22, and 20
barrels of gold per day. Is this enough evidence to conclude that the gold mines are not
producing an average of 22.5 barrels of gold per day? Use = 1%.

Solution:
Step 1 Ho: µ = 22.5
Ha: µ ≠ 22.5
Step 2 We use the t-test since n < 30 and only the standard deviation of the
sample can be obtained. Also, we know that this is a two-tailed test for
the same reason as that of the previous example.
Step 3 Since n = 10, we have df = n – 1 = 10 – 1 = 9. It is also given that = 1%.
Thus, we have c = 3.250.
Step 4 Since we do not have given values for and s, we have to compute for
them using the given data. We should get = 21 and s = 1.56. Computing
for the value of the t-statistic, we get:

test of HypotHesIs usIng tHe t-test 181


Step 5 Since the absolute value of our computed value of –3.04, which is 3.04, is
less than the critical value of 3.250, we fail to reject H0.
Conclusion: There is not enough proof to conclude that the gold mines are not
producing an average of 22.5 barrels of gold per day.

Illustrative Example 5-14

A teacher wishes to find out if the E-learning teaching method is more effective than the
traditional lecture method. For each of the teaching method, 15 students of approximately
equal intelligence were selected to be part of the study. After two months of conducting
the two methods to the selected students, a 30-item test was given to them to assess their
performance. The scores of the students are shown in the table below.

Students 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Proposed 30 28 29 20 18 19 16 27 22 24 26 28 30 29 18

Existing 25 27 20 30 16 21 15 25 28 21 19 17 18 13 19

Is the E-learning teaching method more effective than the traditional method? Use
= 0.05 and use a one-tailed test.

Solution:
To find the mean and standard deviation of the scores in each teaching method, do
the following steps:
Step 1 To open statistical functions, press (MODE, 2). This means press “MODE”
then press 2.
Step 2 To enter the first set of data (which are the scores of the students under
the E-learning method), type in each score then press “M+.” For example,
press (30, M+). Perform this until all scores are encoded.
Step 3 To compute for the mean, press (SHIFT, 2) then (1, =). The result must be
24.27.
Step 4 To compute for the standard deviation, press (SHIFT, 2) then (3, =). The
result must be 4.98.
Step 5 For data clearing and setting your calculator to normal mode, press
(SHIFT, MODE) then (3, =).

Apply the same steps to find the mean and standard deviation for the second set of
data (which are the scores of the students under the traditional lecture method).

test of HypotHesIs usIng tHe t-test 182


The summary of the results is shown in the table.

Method n s

Proposed n1 = 15 1
= 24.27 s1 = 4.98

Existing n2 = 15 2=
20.93 s2 = 5.05

Solution:

Since n1 = n2 = 15, and there are two independent samples, we have the following test
statistics:
Step 1 State the null and alternative hypothesis.

H0: The E-learning method is as effective as the traditional method of


teaching; or µ1 = µ2.

Ha: The E-learning method is more effective than the traditional method
of teaching; or µ1 > µ2.
Step 2 It is given that = 5%. The degree of freedom is:

df = n1 + n2 – 2 = 15 + 15 – 2 = 28.
Step 3 The critical value for this is 1.701.
Step 4 The t-test formula to be used if n1 = n2 is:

Substituting the values into the formula, we obtain:

Step 5 State your conclusion.

Since the computed value of 1.83 is higher than the critical value of 1.701,
we reject H0.
Conclusion: The E-learning method is more effective than the traditional
method of teaching; or µ1 > µ2.

test of HypotHesIs usIng tHe t-test 183


t-test with Two Samples Means Where n1 n2

Illustrative Example 5-15

A teacher wishes to find out if the E-learning teaching method is more effective
than the traditional lecture method. For the E-learning teaching method, 15 students
of approximately equal intelligence were selected to be part of the study while for the
traditional lecture method, 14 students were chosen. After two months of conducting the
two methods to the students, a 30-item test was given to them to assess their performance.
The scores of the students are shown in the table below.

Students 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Proposed 30 28 29 20 18 19 16 27 22 24 26 28 30 29 18

Existing 25 27 20 30 16 21 15 25 28 21 19 17 18 13

Test the hypothesis if there is no significant difference between the mean scores of
students in the two methods of teaching at = 0.01.

Method n s
Proposed n1 = 15 1
= 24.27 s1 = 4.98
Existing n2 = 14 2
= 21.07 s2 = 5.21

Solution:
Since n1 = 15 and n2 = 14 and there are two independent samples, we have the
following test statistics:
Step 1 H0: There is no significant difference between the mean scores of the two
groups of students in the study; or µ1 = µ2.

Ha: There is a significant difference between the mean scores of the two
groups of students in the study; or µ1 ≠ µ2.
Step 2 It is given that = 5%. The degree of freedom is:

df = n1 + n2 – 2 = 15 + 14 – 2 = 27.
Step 3 The critical value for this is 2.763.

test of HypotHesIs usIng tHe t-test 184


Step 4 The t-test formula to be used if n1 ≠ n2 is:

Substituting the values into the formula, we obtain:

Step 5 State your conclusion.

Since the computed value of 1.69 is less than the critical value of 2.763, we
do not reject H0.
Conclusion: There is no significant difference between the mean scores of the
two groups of students in the study; or µ1 = µ2.

The sample uric acid levels of selected basketball and tennis players of the same age and
gender in a certain university were tested. The result is shown below. Is there
a difference in the mean uric acid levels between basketball and tennis players? Use
= 0.05.

Group
Basketball players 15 4.5 1.0
Tennis players 15 3.4 1.5

test of HypotHesIs usIng tHe t-test 185


t -test Using the Microsoft Excel

Illustrative Example 5-16

Test whether there is a significant difference


between the two strategies used by the manager in
10 different branches based from average sales in
millions per month. Five branches were selected for
each strategy.

Before performing the t-test, make sure that the “Analysis Tool Pack” is installed. If not,
select “Add-ons,” “Analysis Tool Pack,” then “OK.”

To perform the t-test, execute the following steps:


Step 1 On the Data tab, click “Data Analysis.”

Step 2 Highlight the data to be used for t-test.

test of HypotHesIs usIng tHe t-test 186


Step 3 Select “t-test: Two-Sample Assuming Unequal Variances” then click “OK.”

Step 4 Select cells A1 to A6 for Variable 1 Range and cells B1 to B6 for Variable
2 Range.

Set = 5% (0.05) in default. Click in the Output Range box and select cell A8.

Step 5 Click “OK” and the t-test table will appear as shown below.

Consider the absolute value of t-stat from the table above, which is 1.263.

test of HypotHesIs usIng tHe t-test 187


t-t est Using the Microsoft Excel
Illustrative Example 5-17

Before performing the t-test, make sure that the “Analysis Tool Pak” is installed or
activated. If not, do this following:

1. Click the “File” Tab.

2. Click “Options.”

3. In the categories, select “Add-ins.”

4. In the “Manage” box at the bottom, select “Excel Add-ins,” and then click “Go.”

5. In the Add-Ins dialog box, select the “Analysis Tool Pak” check box, and then click
“OK.”

To perform the t-test, do the following steps:

Step 1 In the “Data” Tab, click “Data Analysis” located at the right side of the
ribbon.

Step 2 Select “t-test: Two-Sample Assuming Unequal Variances“ then click “OK”.

Step 3 For “Variable 1 Range”, highlight cells A1 to A6 by dragging the mouse


across the cells. For “Variable 2 Range”, highlight cells B1 to B6. Then click
the “Output Range” and select cell A8.

test of HypotHesIs usIng tHe t-test 188


Step 4 Click “OK” and the t-test table below will appear as shown below.

Consider the absolute value of “t Stat” which is 1.263

Perform hypothesis testing in illustrative example 5-15 using the Microsoft Excel.

test of HypotHesIs usIng tHe t-test 189


Test the hypothesis of the following problems using the steps discussed
previously.

1. Ten randomly selected groceries in San Francisco has an average sales of 41


thousand dollars every 6 months with a standard deviation of 5.2 thousand
dollars. Is this enough evidence to conclude that the groceries are not
selling an average of 42 thousand dollars every 6 months? Test the
hypothesis at a level of significance of 5%. Use a one-tailed test.

2. A certain manager wishes to find out if the proposed system of operations


increases the gross sales of the products of the compared with existing
system. To compare the results, six branches for each system are randomly
selected for assessment. The result is as follows:

Proposed system Existing system

Average sales in million 1 = 42.5 1 = 32.6

Standard deviation s1 = 5.7 s2 = 4.8

Number of branches n1 = 6 n2 = 6

Is the proposed system significantly better than the existing system?


Test at =
0.01 and use a one-tailed test.

3. Oil wells in a large field produce an average of 33.5 barrels per day.
Fifteen randomly selected oil wells produce an average of 30 barrels of
crude oil per day with a standard deviation of 3.5 barrels. Is this enough
evidence to conclude that the oil wells are not producing an average of
33.5 barrels of crude oil per day? Test at = 0.1.
Use a
two-tailed test.

4. In an attempt to compare the performance of students with more than


one electronic gadget and those with only one or none, the mean grades
of students and the standard deviations were taken and are shown in the
table below.

standard
mean sample
deviation
Students with 0–1 gadgets 1 = 83 s1 = 10 n1 =12

Students with more than 1 gadget = ypotHesIs


test of2 H 79 usIng = 14
s2 tHe t-test n2 =12
190
Is there a significant difference between the mean grades of students with
more than one electronic gadget and those with one or none? Use = 0.05
and use a two-tailed test.

test of HypotHesIs usIng tHe t-test 191

You might also like