Hypothesis Testing Z-Test and T-Test
Hypothesis Testing Z-Test and T-Test
HYPOTHESIS is a form of statement and the truth or validity or certainty of any statement is
questionable, it is imperative that such a statement must be tested significantly in order to
ascertain its truth or validity. Having tested the statement to be valid or invalid; true or false; one
is able to enunciate his judgment or decision.
Examples:
1. There is no significant relationship between mathematics attitude and competency levels of
second year accountancy students of CIC.
2. The percentage of shoppers who buy their favorite toothpaste regardless of price is 25%.
Such statements are subjected to statistical testing in order to determine whether it is true or
false. If the statement is true, then it is not rejected. On the contrary, if the statement is false, it is
rejected.
1. Null Hypothesis is denoted by H0. H stands for hypothesis and subscript 0 (zero) implies
no difference. It is the statement being tested and is initially assumed to be true. It is a
statement of no effect; of equality; of having no difference.
2. Alternative Hypothesis is denoted by H1. It is the research hypothesis. It is the statement
that the researchers want to support. It specifies existence of a difference or a relationship.
Examples:
1. Title: The Effects of Texting on the Academic Achievements of High School Students of
SRLCS.
H0 ===🡺 Texting of high school students of SRLCS has no significant effect on their
academic achievements.
H1 ===🡺 Texting of high school students of SRLCS has significant effects on their academic
achievements.
Types of Errors
Type I Error: Rejecting the null hypothesis when in fact it is true.
Type II Error: Not rejecting the null hypothesis when in fact it is false.
1
Level of Significance
⮚ The probability of committing a Type I error is called the level of significance of a test and is
denoted by alpha (α ).
⮚ A (1 – α ) value represents the level of confidence. For hypothesis, it is customary to use an α
of 0.05 or 0.01.
⮚ An α = 5% or 0.05 implies 0.95 or 95% level of confidence.
⮚ An α = 1% or 0.01 implies a 0.99 or 99% level of confidence.
⮚ The level of significance of a test is always associated with the rejection region of the test
(critical region), while level of confidence is associated to the acceptance region of the test.
⮚ The critical value of the test is the value that divides the distribution of the test into the
rejection and acceptance regions.
⮚ One way of determining the type of test used in hypothesis testing is based on how the
alternative hypothesis is formulated.
⮚ A one-tailed test is used when the alternative hypothesis is directional which means that the
value of the measures is either greater than ( > ) or less than ( < ) the other measures.
⮚ A one-tailed test is a hypothesis test for which the rejection region lies at only one tail of the
distribution.
⮚ One-tailed is a test classified as left-tailed test or right-tailed test. If the population mean (μ) is
less than the specified value of μ0, then it is a left-tailed test for which the alternative
hypothesis can be expressed as μ < μ0.
⮚ It is a right-tailed test if the population mean (μ) is greater than the specified value of μ0 for
which the alternative hypothesis can be expressed as μ > μ0.
⮚ A two-tailed test is used when the alternative hypothesis is non-directional which means that
the values of two measures of the same kind are not equal.
⮚ A two-tailed test has a not equal sign ( ≠ ) in the alternative hypothesis. When the population
mean ( μ )is not equal to the specified value of μ0, then the alternative hypothesis can be
expressed as μ ≠ μ0.
⮚ A two-tailed test is a hypothesis test for which the rejection region lies on both end tails of
distribution, one on the left and one on the right.
Left-Tailed Right-Tailed
Terms to Remember
Test Statistics The statistics used as a basis for deciding whether the null hypothesis should
be rejected or not.
Rejection Region The set of values of the test statistic that leads to rejection of the null
hypothesis.
Non-rejection Region The set of values of the test statistic that leads to non-rejection of the
null hypothesis.
Critical Value The values of the test statistic that separate the rejection and non rejection
regions.
2
Steps in Hypothesis Testing
1. State the null hypothesis and formulate the alternative hypothesis.
2. Decide the level of significance.
3. Choose the appropriate test statistic.
4. Establish the critical region.
5. Compute the value of the statistical test.
6. Decide whether to reject the null hypothesis or not. Reject the null hypothesis if the
calculated value of the test statistic is greater than the critical value; otherwise, do not
reject the null hypothesis.
7. Draw a conclusion.
⮚ The z-test or t-test may be used in testing the difference between two means.
⮚ The z-test is used when the population standard deviation is known while the t-test is used
when the population standard deviation is unknown.
⮚ Comparison studies make use of the z-test if the population standard deviation is known or if it
is unknown but sample size is greater than or equal to 30.
Formula:
__ __ __
Z = X – μ or Z = ( X – μ )√ n_
σ σ
√n
__
Where: X = sample mean
μ = population mean
σ = population standard deviation
n = size of the sample
Example:
1. It is claimed that the average weight of a bag of biscuit is 250 grams with a standard deviation
of 20.5 grams. Would you agree to this claim, if a random sample of 50 bags of biscuits
showed an average weight of 240 grams, using a 0.05 level of significance?
Solution:
Exercise:
A certain university claims that the mean monthly salary of their college professors is PhP
18,500 with a standard deviation of Php 3,000. A researcher takes a random sample of 80 college
professors who were found to have a mean monthly salary of PhP 16,000. Do the 80 college
professors have lower salaries than the rest. Test the claim at 5% level of significance.
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
Two – Sample – Mean Test: A sample mean is compared to another sample mean.
Formula:
__ __
Z = ( X1 - X2 ) – (µ1 - µ2 )
/ S12 + S22
√ n1 n2
Example:
1. Thirty-two (32) students from a Catholic school show a mean IQ of 111 with a variance of
64, while thirty (30) students from a non-Catholic school were found to have a mean IQ of
115 with a variance of 78. Is there a significant difference between their mean IQ using a
0.01 level of significance?
Solution:
Given: __
X1 = 111 S12 = 64 n1 = 32
__
X2 = 115 S22 = 78 n2 = 30
4
Solution:
__ __
I. Ho : X1 = X2
__ __
H1 : X1 ≠ X2
Z = (111 – 115) - 0
/ 64 + 78
√ 32 30
Z = - 1.865
VI. Decision: Do not reject Ho, reject H1 since the value of Z is less than the critical value.
VII. Conclusion: There is no significant difference between the mean IQ of students from
Catholic school and students from non-Catholic school.
Exercise:
A random sample of 42 sacks of rice from TGP Rice Store had an average weight of 48
kilograms with a standard deviation of 5 kilograms, while 55 sacks of rice from RPDC Rice
Store had an average weight of 50 kilograms with a standard deviation of 8 kilograms. Would
you say that sack of rice from TGP Rice Store has lesser content than sack of rice from RPDC
Store at 0.05 level of significance?
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
___________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
5
SMALL SAMPLE TEST OF HYPOTHESIS FOR THE DIFFERENCE BETWEEN
MEANS
When the sample is small, that is, n < 30, and when only the sample variance is known,
t-test is used.
The use of t-test involves use of the degree of freedom of the distribution. The degree of
freedom varies according to the particular type of t-test to be used.
Formula:
__ __ __
t=X–μ or t = ( X – μ )√ n
S S
√n
__
Where: X = sample mean
μ = population mean
S = population standard deviation
n = size of the sample
df = n – 1
Example:
It is claimed that the mean drying time of Paint X is less than or equal to 30 minutes. Would you
agree to this claim if a random sample of 20 cans show a mea drying time of 32 minutes with a
standard deviation of 3 minutes, using 0.05-level of significance?
__
Given: X = 32 S=3 μ < = 30 α = 0.05 Solution:
I. Ho μ < = 30 minutes
H1 μ > 30 minutes
II. Level of Significance: α = 0.05
III. Test Statistic t-test since n < 30 and standard deviation is
given
IV. Critical Value α = 0.05 and df = n – 1 = 20 – 1 = 19
19, 0.05 ====🡺 1.729
V. Computation: t = ( X – μ )√ n_
S __
t = (32 – 30) √ 20
3
t = 2.98
VI. Decision: Reject Ho, do not reject H1 since t value is greater than
the critical value.
VII. Conclusion: There is a significant difference between the drying time
of the sample from that of the population.
6
Exercise:
An expert encoder can type 70 words per minute. A random sample of 22 applicants took the
typing test and had an average speed of 65 words per minute with a standard deviation of 10
words per minute. Can you say that the applicants’ performance is below the standard at 0.01
level of significance?
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
____________________________________________________________________________________
Two Sample Mean Tests. One sample mean is compared to another sample mean.
Example:
A random sample of 14 packs of X milk showed a mean content of 480 grams with a standard
deviation of 14 grams, while a sample of 16 packs of Y milk showed a mean content of 490
grams with standard deviation of 20 grams. Using a 0.01 level of significance, is there a
significant difference between the mean content of X milk and Y milk?
Given:
X1 = 480 grams n1 = 14 s1 = 14 grams
X2 = 490 grams n2 = 16 s2 = 20 grams
7
Solution:
I. Null Hypothesis Ho X1 = X2
Alternative Hypothesis H1 X1 ≠ X2
II. Level of Significance α = 0.01
III. Test Statistic t-test since n < 30
IV. Critical Value df = n 1 + n2 - 2 = 14 + 16 – 2 = 28
CV at 28, 0.01 = ± 2.763
V. Computation:
t = ( X1 - X2 ) – (µ1 - µ2 )
S12+ S2 2
√ n1 n2
= (480 – 490) – 0
142+ 202
√ 14 16
= - 1.60
VI. Decision: Do not reject Ho. Reject H1.
VII. Conclusion: There is no significant difference between the mean content of X milk and Y
milk.
Exercise:
A random sample of 18 bottles of 500-ml C-Softdrink had a mean content of 480 ml with a
variance of 20.5 ml, while a sample of 14 bottles of 500-ml P-Softdrink had a mean content of
490 ml with a variance of 25 ml. Using 0.01 level of significance, can you say that C-Softdrink
has lesser mean content than P-Softdrink?
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
____________________________________________________________________________________
_
_____________
2 2
S = ∑d - ( ∑d )
n
√n-1
8
Where: d = mean of difference between means
S = standard deviation
n = number of cases
∑d = sum of the mean difference
∑d2= sum of the squared difference
µd = expected difference which is set to 0
Example:
A random sample of 12 women were taken to test the effectiveness of a slimming pill. Their
weights before and after taking the slimming pill were recorded in the table below. Test the
hypothesis using the 0.01 level of significance.
Woman No. Weight in Weight in
Lbs Lbs (After)
(Before)
1 150 148
2 140 139
3 138 136
4 130 128
5 145 143
6 148 145
7 160 150
8 170 167
9 166 162
10 159 155
11 157 156
12 172 169
Solution:
I. Null Hypothesis Ho X1 = X2
Alternative Hypothesis H1 X1 ≠ X2
II. Level of Significance α = 0.01
III. Test Statistic t-test since n < 30
IV. Critical Value df = n – 1 = 12 – 1 = 11 CV at 11, 0.01 = ±3.106 V. Computation:
Woman No. Weight in Weight in d d2
Lbs Lbs (After)
(Before)
1 150 148 2 4
2 140 139 1 1
3 138 136 2 4
4 130 128 2 4
5 145 143 2 4
6 148 145 3 9
8 170 167 3 9
9 166 162 4 16
10 159 155 4 16
11 157 156 1 1
12 172 169 3 9
_
d = ∑d = 37 = 3.08333333
n 12
_____________ _____________
S = ∑d2- ( ∑d )2= 177 - 372= 2.39
n 12
√ n - 1 √ 12 - 1
9
t = d - µd = 3.08333333 – 0 = 4.47
S 2.39
√ n √ 12
Professor De Castro conducted a review in his Bma 102 class. He gave an examination before
and after the review and gathered the following data:
Student Score Before Score After
Review Review
1 150 148
2 140 139
3 138 136
4 130 128
5 145 143
6 148 145
7 160 150
8 170 167
9 166 162
10 159 155
10
11