Professional Documents
Culture Documents
Test of Hypothesis
Source: Mahesh (2019). Everything You Need To Know about Hypothesis Testing – Part I. Retrived from:
https://towardsdatascience.com/everything-you-need-to-know-about-hypothesis-testing-part-i-4de9abebbc8a
Statistical Inference is to draw
conclusion about any population 2
parameter on the basis of the
Simple Tests of Hypothesis sample information.
2. Alternative hypothesis. The alternative hypothesis, denoted by H1 or Ha, is the hypothesis that sample
observations are influenced by some non-random cause.
The one that we conclude is true if the H o is rejected.
States that there is an effect, there is a difference, or there is a relationship.
Generally represents the idea which the researcher wants to prove
Examples on how to state the alternative hypothesis:
a. There is a significant relationship between the respondents’ sex and academic performance.
b. One variable depends on the other variable.
c. Two variables are dependent from each other.
Decision Errors
Two types of errors can result from a hypothesis test.
1. Type I error (α error). A Type I error occurs when the researcher rejects a null hypothesis when it is true.
Rejecting a true Ho
Example: Ho: Juan is not guilty. If the judge convicts Juan when in fact he is not guilty, the court
commits a Type I error.
α is read as Alpha which means level of significance
2. Type II error (β error). A Type II error occurs when the researcher fails to reject a null hypothesis that is
false.
Accepting a false Ho
Example: Ho: Juan is not guilty. If the judge acquits Juan when in fact he is guilty, the court commits a
Type II error.
β is read as Beta
The probability of not committing a Type II error is called the Power of the test.
Decision Ho is actually:
True False
Reject Ho Type I Error Correct
Decision Rules
1. P-value. The strength of evidence in support of a null hypothesis is measured by the P-value. Suppose the
test statistic is equal to S. The P-value is the probability of observing a test statistic as extreme as S,
assuming the null hypothesis is true. If the P-value is less than the significance level, we reject the null
hypothesis.
Note: The lower the p-value, the stronger the evidence that the null hypothesis is false.
2. Region of acceptance. The region of acceptance is a range of values. If the test statistic falls within the
region of acceptance, the null hypothesis is not rejected. The region of acceptance is defined so that the
chance of making a Type I error is equal to the significance level.
The set of values outside the region of acceptance is called the region of rejection. If the test statistic falls
within the region of rejection, the null hypothesis is rejected. In such cases, we say that the hypothesis has
been rejected at the α level of significance.
Source: StatTrek founded by Harvey Berman (2020).What is Hypothesis Testing?. Retrieved from: https://stattrek.com/hypothesis-
test/hypothesis-testing.aspx
A test of a statistical hypothesis, where the region of rejection is on only one side of the sampling distribution, is
called a one-tailed test. For example, suppose the null hypothesis states that the mean is less than or equal to
10. The alternative hypothesis would be that the mean is greater than 10. The region of rejection would consist
of a range of numbers located on the right side of sampling distribution; that is, a set of numbers greater than
10. Acceptance Region
5
A test of a statistical hypothesis, where the region of rejection is on both sides of the sampling distribution, is
called a two-tailed test. For example, suppose the null hypothesis states that the mean is equal to 10. The
alternative hypothesis would be that the mean is less than 10 or greater than 10. The region of rejection would
consist of a range of numbers located on both sides of sampling distribution; that is, the region of rejection
would consist partly of numbers that were less than 10 and partly of numbers that were greater than 10.
There is no rule to identify the one tailed and two tailed test of hypothesis. Generally, if direction of
differences is not given in the statement of hypothesis, then we use two tailed test. Similarly, if the
direction of difference like at least, at most, increase, decrease, majority, minority, larger, taller, high, low,
more than, less than etc. is included in the statement of hypothesis, then we use on tailed test.
Source: Raj Chand Takuri (2019). Testing of Hypothesis. In SlideShare. Retrieved from:
https://www.slideshare.net/RajThakuri/testing-of-hypotheses
Read “Understanding Hypothesis Tests: Significance Levels (Alpha) and P values in Statistics”
Link: https://blog.minitab.com/blog/adventures-in-statistics-2/understanding-hypothesis-tests-significance-levels-alpha-and-p-values-in-
statistics
6
In testing the difference between two means, the z-test or t-test may be used.
1. Formulate the null hypothesis (Ho) that there is no significant difference between items being compared.
State the alternative hypothesis (Ha) which is used in case Ho is rejected.
2. Set the level of significance, α. Typically the 0.05 or the 0.01 level is used.
3. Determine the test to be used.
4. Determine the degrees of freedom (df) and the tabular value for the test.
For a single sample, df = number of items – 1 = n – 1.
For two samples, df = n1 + n2 – 2, where n1 refers to the number of items in the first sample; and the n 2
refers to the number of items in the second sample.
For a z-test, use the table of critical values of z based on the area of the normal curve.
For a t-test, look for the tabular value from the table of t-distribution.
5. Compute for z or t as needed, using any of the formulas found on the next page.
7
A. z-test
a. Sample mean compared with Population mean
z= ( - μ) n
σ
where:
= sample mean
µ = population mean
σ = population standard deviation
n = number of items within the sample
where:
1 = mean of the first sample
2 = mean of the second samle
s1 = standard deviation of the first sample
s2 = standard deviation of the second sample
n1 = number of items in the first sample
n2 = number of items in the second sample
P1 - P2
z= -----------------------------
P1q1 + P2q2
n1 n2
where:
P1 = proportion of the first sample
P2 = proportions of the second sample
q1 = 1 – P1
q2 = 1 - P2
n1 = number of items in the first sample
n2 = number of items in the second sample
B. t-test
a. Sample Mean Compared with Population
t = ( - μ) n -1
s
8
where:
= sample mean
µ= population mean
s= sample standard deviation
n= number of items within the sample
b. Comparing Two Sample Means (independent-measures t statistic)
Where:
1 = mean of the first sample
2 = mean of the second sample
s1 = standard deviation of the first sample
s2 = standard deviation of the first sample
n1 = number of items in the first sample
n2 = number of items in the second sample
∑D
t= ----------------------------------
N ∑ D2 - (∑ D)2
--------------------------
n-1
Where:
D = the difference between the two scores (posttest – pretest)
n = number of samples
∑D2 = the sum of the squares of the difference between the posttest and pretest
∑D = the summation of the difference between the posttest and pretest
Source: Published in Statology by Zach (2020). How to Read the t-Distribution Table. Retrieved from:
https://www.statology.org/how-to-read-t-distribution-table/
Note: In this lesson, we will be considering only z-test for comparing two sample means, t-test for comparing
two samples means (independent data) and t-test for correlated or dependent data.
10
Find the mean, standard deviation and variance of the following data.
Scores
Note:
88
A function in Excel and Google Sheets is a built-
87 in formula. All functions begin with the equal
78 sign (=) followed by the function's name such as
AVERAGE, STDEV, SUM, etc.
90
88
Row 3
Column B
Useful Link in solving for the mean, standard deviations and variance
if excel is not available.
https://www.mathsisfun.com/data/standard-deviation-calculator.html
https://www.socscistatistics.com/descriptive/variance/default.aspx
2
Results: Variance (s ) is calculated by
squaring the standard deviation.
= 86.20
s = 4.71 s2 = (4.71)*(4.71) = 22.18
s2 = 22.18
11
Example1: (Using z-test for comparing two sample means; n ≥ 30 for both groups)
An instructor wants to know if students without calculator got significantly lower scores in Statistics
exam than those students with calculator. He gathered the following data:
No. With Without
Calculator Calculator
1. 85 80
2. 86 75
3. 95 78
4. 87 85 The number 1 or the
5. 75 77 subscript 1 in n1 or s1 means
6. 88 82 that you are considering the
7. 86 80 first group of students. The
8. 84 85 n2 or s2 also means that you
9. 92 86 are considering the second
10. 78 90 group of students.
11. 79 74
12. 83 85
13. 96 81
14. 89 83
15. 88 77
16. 87 78
17. 85 88
18. 79 92
19. 85 85
20. 86 74
21. 87 77
22. 88 85
23. 90 82
24. 89 85
25. 89 84
26. 89 86
27. 91 85
28. 90 88
29. 88 79 The z-Table is used
30. 89 78 since z-test is utilized.
31. 90
32. 88
Solution:
1. Ho: There is no significant difference between the mean scores of the two groups of students.
(μ 1 = μ 2)
Ha : There is a significant difference between the mean scores of the two groups of students.
(μ 1 ≠ μ 2) non directional test, two tailed test
2. α = 0.05 z- Table (critical values)
3. use z-test for comparing two sample means
(since n in both groups ≥ 30). Test Level of Significance (α)
4. df = n1 + n2 – 2 = 32 + 30 - 2 = 60 0.01 0.05
Tabular z or critical z = 1.96 (for α = 0.05) One-tailed ±2.33 ±1.65
Two-tailed ±2.58 ±1.96
12
Note: To get the and sd of students without Getting the standard deviation (s)
calculator, simply drag the formula to the right. of students with calculator
13
Useful Link in solving for the mean, standard deviations and variance
if excel is not available.
https://www.mathsisfun.com/data/standard-deviation-calculator.html
https://www.socscistatistics.com/descriptive/variance/default.aspx
86.91 - 82.13
z= -------------------------------------
(4.51)2 + (4.75)2
32 30
4.78 4.78
z= -------------------------------- = --------------- = 4.058
0.6356 + 0.7521 1.1780
Data
Students with Calculator: Students without Calculator 1. Solve for and S
n1 = 32 n2 = 30
= 86.91 = 82.13
s1 = 4.51 s2 = 4.75
2 2
s1 = 20.35 s2 = 22.53
2. Enter Data
p-value = 0.000
Computed z = 4.058
Tabular z = 1.96
15
Table 1
Analysis Table of the Mean Scores of the Students With and Without Calculators
s n Computed Critical Decision Remark
Students z z
With Calculator 86.91 4.51 32 4.058 1.96 Reject Ho Significant
Discussion:
Table 1 presents the mean scores of the two groups of students. The first group is using a calculator
and the second group does not have a calculator. As presented, the group of students with calculator has a
mean rating (86.91) which is numerically higher than the mean rating of the group of students without calculator
(82.13). To test the data statistically, z-test is utilized (since n ≥ 30). The findings indicate that the computed z-
value (4.058) is greater than the critical z-value (1.96). This finding results to the rejection of the null
hypothesis. This means that at 5% level, there is a significant difference in the mean ratings of the students in
favor of those group with calculator. This implies that the use of calculator helps the students in obtaining a
higher rating.
16
Using the p-value and level of significance (This is widely used by most researchers).
Previous Results
Table 1
Analysis Table of the Mean Scores of the Students With and Without Calculators
n = 62
s n Decision Remark
Students p-value
With Calculator 86.91 4.51 32
0.000 Reject Ho Significant
Discussion:
Table 1 presents the mean scores of the two groups of students. The first group is using a calculator
and the second group does not have a calculator. As presented, the group of students with calculator has a
mean rating (86.91) which is numerically higher than the mean rating of the group of students without calculator
(82.13). To test the data statistically, z-test is utilized (since n ≥ 30). The findings indicate that the computed p-
value (0.000) is less than the level of significance (0.05). This finding results to the rejection of the null
hypothesis. This means that at 5% level, there is a significant difference in the mean ratings of the students in
favor of those group with calculator. This implies that the use of calculator helps the students in obtaining a
higher rating.
17
Visit this link for you to understand the concept on “I Fail to Reject the Null Hypothesis”.
18
Activity No. 13
z-test for Comparing Two Sample Means
Problem
A professor is eager to identify if students coming from private schools are better than those students coming
from public schools in Statistics subject. She gathered the following data:
Table 1
Analysis Table of the Mean Scores of the Students From Private and Public Schools
s n Computed Critical Decision Remark
Students z z
Private
Public
Discussion:
__________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_______________________________________________________________________________________
20
Example 2: (Using t-Test for Comparing Two Sample Means; n < 30)
The following are the scores of 14 male and 14 female students in Mathematics. Test the null hypothesis that
there is no significant difference between the performance of the male and female students. Use 0.05 level of
significance.
Male Female
80 81 Useful Link in solving for the mean, standard deviations and variance if excel is not available.
80 84 https://www.mathsisfun.com/data/standard-deviation-calculator.html
84 84 https://www.socscistatistics.com/descriptive/variance/default.aspx
84 85
84 85
87 87
88 87
89 88
90 90
90 91
91 91
91 91
92 91
92 92
Solution:
1. Ho: There is no significant difference between the mean scores of the students in Mathematics subject.
(μ 1 = μ 2)
Ha : There is a significant difference between the mean scores of the students in Mathematics subject.
(μ 1 ≠ μ 2) non directional test, two tailed test
2. α = 0.05
t-distribution Table
3. use t-Test for comparing two means (n < 30)
4. df = n1 + n2 – 2 = 14 + 14 - 2 = 26
Tabular t or critical t = 2.056
5. computation:
Method 1: (Use excel in getting the mean and standard deviation
and manually compute the value of t.)
Computed value of t
-
21
Mean (Male)
Mean (Female)
Computed t-value
p-value (two-tailed)
Table 2
Analysis Table of the Mean Scores of the Students in Mathematics
n = 28
Computed Critical
Respondents s n t t Decision Remark
Male 87.29 4.20 14 -0.247 2.056 Fail to reject Ho Not significant
Female 87.64 3.46 14
5% level of significance and 26 degrees of freedom
Discussion:
Table 2 presents the mean scores of the students in Mathematics subject. It is reflected that the mean
score of the female students (87.64) is numerically higher than the mean score of the male students (87.28). To
test the data statistically, t-test for comparing two means is applied. It is shown that the computed t-value (-
0.247) is less than the tabular or critical t-value (2.056). At 5% level of significance and 26 degrees of freedom,
the null hypoyhesis is not rejected. This means that the data are not sufficient to conclude that there is a
significant difference between their means. This result may suggest that the mean achievements of the female
and male students are just the same.
Table 2
Analysis Table of the Mean Scores of the Students in Mathematics
n = 28
Respondents s n p-value Decision Remark
Male 87.29 4.20 14 0.805 Fail to reject Ho Not significant
Female 87.64 3.46 14
Level of significance = 0.05; df = 26
Discussion:
Table 2 presents the mean scores of the students in Mathematics subject. It is reflected that the mean
score of the female students (87.64) is numerically higher than the mean score of the male students (87.28). To
test the data statistically, t-test for comparing two means is applied. It is shown that the p-value (0.805) is
greater than the level of significance (0.05). Thus, the null hypoyhesis is not rejected. This means that the data
are not sufficient to conclude that there is a significant difference between their means. This result may suggest
that the mean achievements of the female and male students are just the same.
23
Activity# 14
t-test for Comparing Two Sample Means (Independent or Uncorrelated Data)
Problem:
A personality test was administered to 15 boys and 11 girls in a private school to test whether the girls differed
in their personality from that of the boys. Higher scores indicate higher personality traits.
Data: Solution:
No. Boys Girls
6. Ho: ___________________________________________________
33. 11 17
34. 16 19 ___________________________________________________
35. 16 22 (μ 1 = μ 2)
36. 19 24
37. 20 27
Ha : ___________________________________________________
38. 20 25
39. 20 26 ___________________________________________________
40. 21 29 (μ 1 ≠ μ 2) non directional test, two tailed test
41. 23 32
42. 24 35
7. α = 0.05 (use 0.05 if its not emphasized in the problem)
43. 26 36
44. 27 8. use t-test for comparing two sample means (< 30).
45. 28
46. 30 9. df = n1 + n2 – 2 = ___________________ = ______
47. 32
Tabular or critical t-value = ______ (from the t-distribution Table)
10. Computation:
t-value = ______
p-value = ______
24
Final Table and Discussion (Using the computed t and tabular or ciritical t values)
Table 1
Analysis Table of the Mean Scores of the Boys and Girls in a Personality Test
n = _________
Computed Critical
Respondents t t Decision Remark
s n
Boys
Girls
5% level of significance and _____________ degrees of freedom
Discussion:
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
25
Pretest Posttest
18 20
16 22
18 24
12 10
20 25
17 19
18 20
20 21
22 23
20 20
10 10
8 12
20 22
12 14
16 12
16 20
18 22
20 24
18 23
21 17
Solution:
1. Ho: There is no significant difference between the Pretest and Posttest results of the students.
(μ 1 = μ 2)
Ha : There is a significant difference between the means of the Pretest and Posttest results of the studentst.
(μ 2 > μ 1) directional test, one - tailed test (antipating that posttest scores > Pretest scores)
2. α = 0.05
5. computation:
D = Posttest – Pretest = 20 – 18 = 2 26
Pretest Posttest D D2
18 20 2 4
16 22 6 36
18 24 6 36
12 10 -2 4
20 25 5 25
17 19 2 4
18 20 2 4
20 21 1 1
22 23 1 1
20 20 0 0
10 10 0 0
8 12 4 16
20 22 2 4
12 14 2 4
16 12 -4 16
16 20 4 16
18 22 4 16
20 24 4 16
18 23 5 25
21 17 -4 16
Add all results of D2
2
= 17 = 19 ∑D= 40 ∑D = 244
Mean (Pretest)
Mean (Posttest)
Pretest
= 17
Posttest
= 19
Computed Value
Computed t = -3.044 (or 0.3.044)
p-value = 0.003
Critical or Tabular t = 1.729
Table 3
Testing the Significance of the Difference Between Means of the
Pretest and Posttest Results of the Students
n = 20
Computed Critical
Test t t Decision Remark
Table 3 reveals the overall results of administering a test to a group of students before and after a
tutorial session . It can be gleaned in the table that the posttest mean score (19) is two points higher than the
pretest mean score (17). Using t-test for correlated or dependent data, it shows that the computed t-value
(3.044) is greater than the tabular or critical t-value (1.729) at 5% level of significance and 19 degrees of
freedom. This finding will result to the rejection of the null hypothesis which means that there is a significant
difference between the posttest and pretest results of the students. This simply implies that the tutorial class has
an impact to the students and it is effective that made them obtained better scores in the posttest.
29
Table 3
Testing the Significance of the Difference Between Means of the
Pretest and Posttest Results of the Students
n = 20
Test p-value Decision Remark
Table 3 reveals the overall results of administering a test to a group of students before and after a
tutorial session . It can be gleaned in the table that the posttest mean score (19) is two points higher than the
pretest mean score (17). Using t-test for correlated or dependent data, it shows that the computed p-value
(0.003) is less than the level of significance (0.05). This finding will result to the rejection of the null hypothesis
which means that there is a significant difference between the posttest and pretest results of the students. This
simply implies that the tutorial class has an impact to the students and it is effective that made them obtained
better scores in the posttest.
30
Activity # 15
t-Test for Correlated or Dependent Data
Problem:
A group of students was given an attitude test and a controversial subject. Then they were shown a film
favorable to the subject and the attitude test was then re-administered. Make a directional test with alpha = 0.01.
Data:
Scores Scores After Solution:
Before the the Film
1. Ho: ___________________________________________________
Film Showing Showing
17 21 ___________________________________________________
18 22 (μ 1 = μ 2)
20 24
24 28 Ha : ___________________________________________________
24 34 ___________________________________________________
22 20 (μ2 > μ1) directional test, one - tailed test
20 24
17 23 2. α = 0.01 (this is emphasized in the problem)
10 18
3. use t-test for dependent or correlated data
11 19
20 26 4. df = n – 1 = ___________________(df for paired observations)
15 20
Tabular or critical t-value = ______ (from the t-distribution Table or this
can be seen in the output if you are using Data Analysis ToolPak)
5. Computation:
t-value = ______
p-value = ______
31
Final Table and Discussion: (Using the computed t and tabular or critical t values)
Table 3
Testing the Significance of the Difference Between Means of the
Pretest and Posttest Results of the Students
n = _________
Computed Critical
Test t-value t-value Decision Remark
Pretest
Posttest
1% level of significance and _____________ degrees of freedom
Discussion:
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
32