Final - Module 4 B
Final - Module 4 B
Final - Module 4 B
Module 4
TESTING
HYPOTHESIS
4.4. HYPOTHESIS TESTING FOR THE MEANS OF TWO POPULATION
The figure below can be used as guide in testing the means of two populations.
𝜇𝑏𝑒𝑓𝑜𝑟𝑒 = 𝜇𝑎𝑓𝑡𝑒r
EXAMPLES
Example 1. A study was conducted to investigate some effects of physical training. At 0.05 level of significance, test the claim
that the mean pre-training weight equals the mean post-training weight. The weights are in kilograms. What do you conclude
about the effect of training weight?
Pre-training weight:
99 57 62 69 74 77 59 92 70 85
Post-training weight:
94 57 62 69 66 76 58 88 70 84
Solution:
a. Null hypothesis: The training is not effective, that is the mean of pre-training weight is equal to the mean of post-training
weight.
Alternative hypothesis: The training is effective, that is the mean of pre-training weight is greater the mean of post-training
weight.
d=2, sd=2.749
tc=2-02.74910=2.30
t(α,n-1)=t(0.05,10-1) =t0.05,9=1.833
Mr. Jerome L. Buhay
MODULE 4
Hypothesis Testing
• In the data tab, select data analysis: Mr. Jerome L. Buhay
MODULE 4
Hypothesis Testing
• In the data analysis, select “t-test paired sample for means”, then click “ok”.
Mr. Jerome L. Buhay
• In the dialog box, highlight the data for pre-training weight for “variable 1 range”, then
highlight the post-training weight data for “variable 2 range” ,check the “labels”, select the
location where you want to display the output. In this case, cell D1 was selected. The new
worksheet can also be selected, and the result will display in the new worksheet in excel.
Them click “ok”.
MODULE 4
Hypothesis Testing
Mr. Jerome L. Buhay
MODULE 4
Hypothesis Testing
f. Decision/Conclusion: Since the t-statistic value (2.19) is greater than the tabulated (one-tail: 1.86), the
null hypothesis was rejected. Also, the probability value for one-tail (p-value:0.03) is less than 0.05.
Thus, there is a significant difference between pre-training weight and post-training weight. The mean
for pre-training weight is 73.22, is significantly greater than 71.11 for post-training weight. This implies
that the training is effective.
4.4.2. Z-test for independent samples
The samples from each population must be independent of one another.
The populations from which the samples are taken must be normally distributed and the population variances are
known,
the sample sizes must be large i.e. n1≥30 and n2≥30.
Example 2: Two methods of teaching statistics are being tried by a professor. A class of 40 students is taught by the
method A and a class of 36 is taught by method B. The two classes are given the same final examination. The mean scores
are 78 and 74, respectively. Using a 0.05 significance level, can we conclude that the average final examination scores
produced by the two methods are different if the population standard for each is 5?
A 40 78 5
B 36 74 5
Solution:
a. Null hypothesis: The average final examination scores produced by the two methods are the same.
Alternative hypothesis: The average final examination scores produced by the two methods are different.
b.
c. Test Statistic: z-test
d. Decision rule: Reject the null hypothesis if z-computed >z-critical value, otherwise fail to reject the null.
Or, reject the null hypothesis if p-value < 0.05.
e. Computation:
Using the formula:
where
For the critical value:
f. Decision/Conclusion: Since the z-computed (3.48) is greater than the critical value (1.96),
then the null hypothesis was rejected. Thus, there is a significant difference in the average
final examination scores produced by the two methods of teaching Statistics. Looking at the
mean values, method A produced higher average final exam score as compared to method B.
4.4.3 T-test for independent samples Also called the two-sample t-test for independent samples
It intends to test whether there is a significant difference between the means of two unrelated groups
The populations from which the samples are taken must be normally distributed and the population variances are known,
It is used to test the null hypothesis: 𝜇1 = 𝜇2
4.4.3.1 Assuming equal variances ()
Example 3. In a study of abstract reasoning, a sample group of male and female students scored as shown below.
Assuming that the samples are random, would further testing of similar groups of male and female students give virtually
the same result?
Given:
Given:
Solution:
a. Null hypothesis: The two methods of checking out goods has the same means.
Alternative hypothesis: The two methods of checking out goods has different means.
b.
c. Test Statistic: t-test assuming unequal variances
d. Decision rule: Reject the null hypothesis if t-computed >t-critical value, otherwise fail to reject the null. Or,
reject the null hypothesis if p-value < 0.05.
e. Computation:
Using the formula:
=10.19
f. Decision/Conclusion: Since 10.19>2.821, the null hypothesis was rejected. Thus, there is a significant difference in the
average time of checking out goods between the two methods. The mean values show that manual method takes longer time
as compared to scanning.
Example 5. Two production lines are making thermostats to be used in toaster ovens. Samples are selected from each
production line, the thermostats are set at 350°, and then the actual temperature in the toaster oven is measured. The results of
the sampling are given below. At 0.05 level of significance, can it be concluded that the two production lines differ in terms
of temperature?
Y 326.4 338.9 355.4 351.6 350.2 356.9 352.4 349.6 351.2 344.2
Solution:
a. Null hypothesis: The two production lines have the same temperature.
b. Alternative hypothesis: The two production lines differ in temperature.
c.
d. Test Statistic: t-test assuming equal variances
e. Decision rule: Reject the null hypothesis if t-computed >t-critical value, otherwise fail to reject the null. Or, reject the null
hypothesis if p-value < 0.05.
e. Computation:
Using excel: Follow the steps in example 1.
•In the data analysis dialogue box, select “t-test assuming equal variances” then click “ok”.
M O D U L E 4 H y p o t h e s i s Te s t i n g
PRACTICE EXERCISE
Practice Exercise 4.4
Do a complete hypothesis testing in the following problems:
1. A classroom teacher wishes to compare the performance of students in statistics using two methods of teaching. Two independent samples of
size 16 were randomly selected. The following data have been obtained. Is there a significant difference between the performance of students in
the two methods of teaching statistics? Use 0.05 level of significance.
Method A 82 81 86 75 77 83 85 77
Method B 76 90 89 87 84 79 88 78
2. Over a long period of time, ten patients are selected at random and each is given two different treatments for arthritis. Test the hypothesis that
the two treatments have the same effect in treating arthritis. The results of standard tests are as follows:
Patient 1 2 3 4 5 6 7 8 9 10
Treatment1 47 38 50 33 47 23 40 42 15 36
Treatment2 52 35 52 35 46 27 45 41 17 41
3. The following data have been gathered by an industrial engineer who is comparing the time (in seconds) taken by an operator
to complete a task using two different methods. Test an appropriate hypothesis and decide which method is best.
Operator 1 2 3 4 5 6 7 8 9 10
Method A 45 88 40 32 29 34 59 55 62 50
Method B 39 71 42 27 28 30 50 60 51 48
4. Two new methods of producing automobile tires have been proposed. The manufacturer believes that there will be no
appreciable difference in the lifetimes of the tires produced by these two methods. The data show the lifetimes of the tires in unit
of 1000 miles. Are the methods equivalent?
Method
1 66.4 61.6 60.5 59.1 63.6 61.4 62.5 64.4 60.7
Method
2 58.2 60.4 55.2 62 57.3 58.7 56.1
SUPPLEMENTAL VIDEO IN t-test
Two sample t-test in excel
https://youtu.be/_WNUfgZipww
Analysis of Variance (ANOVA), sometimes also referred to as F-test is applicable in comparing three or more independent
sample means. This test is an extension of t-test for independent samples. ANOVA tests the hypothesis that all means are equal,
against the alternative that at least one mean is significantly different from others.
The null hypothesis is rejected if F computed is greater than F critical value in the ANOVA table or if p-value is less than
0.05. The computation can be done manually or by using a software like Microsoft Excel.
Assumptions:
1. The population from which the samples were drawn are normally distributed.
2. The samples are independent from each other.
3. The variances of the different samples are homogeneous
Below is the data lay out for ANOVA.
Samples Group 1 Group 2 ... Group p
1 X1 Y1 . Z1
2 X2 Y2 . Z2
3 . . . .
. . . .
Xn1 Yn2 . Znp
TOTALS T1 T2 . Tp
The source of variation is divided into two: between groups and within groups. The degrees of freedom (df) for between
groups is always the number of groups minus 1 (p-1). On the other hand, the df of within groups is equal to the total number of
observations minus number of groups to be tested (N-p). The total df is always equal to the total number of observations minus
1 (N-1). Refer to the table below.
Sources of Mean
df Sum of Square Fc P-value
Variation Square
Between
p-1 SSB MSB Fc ____
Groups
Within
N-p SSW MSW
Groups
Total N-1 SST
The sum of squares has 3 components. The Sum of Square Between (SSB), Sum of Squares Within (SSW), and the Total Sum of
Squares (SST). The Mean Square has 2 components. The Mean Square Between (MSB) and Mean Square Within (MSW). The
F-computed (Fc) is the ratio of the mean squares. The formulas are presented below.
Formula:
Example 1. Rosenbaum Restaurants specialize in meals for families. Katy Polsby, President, recently developed a new meat
loaf dinner. Before making it a part of the regular menu she decides to test it in several of her restaurants. She would like to
know if there is a difference in the mean number of dinners sold per day at the Anyor, Loris, and Lander restaurants. Use the
0.05 significance level. Can Katy conclude that there is a difference in the mean number of dinners sold between the restaurants?
Data:
1. Null hypothesis: There is no significant difference in the mean number of dinners sold between the
three restaurants.
Alternative hypothesis: There is a significant difference in the mean number of dinners sold between
the three restaurants.
2.
3. Test Statistic: Analysis of Variance (ANOVA)
4. Decision Rule: Reject the null hypothesis if F computed is greater than F-critical or if the p-value is
less than 0.05. Otherwise, fail to reject the null hypothesis.
5. Computation
The value that corresponds to the degrees of freedom for within and between groups given the alpha level of significance (0.05) is the critical
value. In this case, the intersection of (2,10) = 4.10.
ANOVA TABLE:
Source of Variation SS df MS F F crit
Between Groups 76.25 2 38.125 39.10 4.10
Within Groups 9.75 10 0.975
Total 86 12
Using Microsoft Excel:
• Follow the same procedure as the t-test. But instead of choosing t-test in the data analysis tab, select
“Anova: Single Factor” then click “ok”.
MODULE 4
Hypothesis Testing
• In the dialogue box, highlight the data set for the “input range”, check the “labels” box and find a place to display
the result in the “output range” then click “ok”.
MODULE 4
Hypothesis Testing
Data:
Level 1 Level 2 Level 3 Level 4
70.6 70.3 67.7 62.4
68.4 67.6 68.9 63.0
71.8 68.4 63.8 64.3
71.4 69.4 65.1
67.0
Solution:
1. Null hypothesis: There is no significant difference in the mean level of concentration.
2. Alternative hypothesis: There is a significant difference in the mean level of concentration.
3.
4. Test Statistic: Analysis of Variance (ANOVA)
5. Decision Rule: Reject the null hypothesis if F computed is greater than F-critical or if the p-value is less than 0.05.
Otherwise, fail to reject the null hypothesis.
5. Computation
ANOVA
Source of
Variation SS df MS F P-value F crit
Between
Groups 94.73 3 31.58 9.51 0.001 3.49
Within Groups 39.86 12 3.32
Total 134.59 15
6. Decision/Conclusion: Since the F computed (9.51) is greater than the F critical value (3.49) and the p-value (0.001) is less
than 0.05, the null hypothesis was rejected. This implies that there is a significant difference in the mean level of concentration.
Mr. Jerome L. Buhay
M O D U L E 4 H y p o t h e s i s Te s t i n g
PRACTICE EXERCISE
PRACTICE EXERCISE 4.5
1. A paint manufacturer is studying the reflective properties of four different kinds of paint. The data gathered follow. The
reflective indices of the paints have been scaled here:
Paint
1 2 3 4
195 45 230 110
150 40 115 55
205 195 235 120
120 65 225 50
160 145 80
195
Is there a significant difference in the reflective properties of the different kinds of paint? Use 0.01
level of significance.
PRACTICE EXERCISE 4.5
2. An underwriting laboratory has tested the flammability of fabric, using identical methods in five different laboratories.
The measurements are the length of the burned portion of a piece of fabric held over flame for a fixed amount of time.
Laboratories
1 2 3 4 5
2.9 2.7 3.3 3.3 4.1
3.1 3.4 3.3 3.2 4.1
3.1 3.6 3.5 3.4 3.7
3.7 3.2 3.5 2.7 4.2
3.1 4.0 2.8 2.7 3.1
4.2 4.1 2.8 3.3 3.5
3.7 3.8 3.2 2.9 2.8
3.9 3.8 2.8 3.2 3.5
3.1 4.3 3.8 2.9 3.7
3.0 3.4 3.5 2.6 3.5
2.9 3.3 3.8 2.8 3.9
Do the laboratories differ with respect to their measurement of the amount of burned fabric?
SUPPLEMENTAL VIDEO IN ANOVA
ANOVA in excel
https://youtu.be/0V5scynrVjY
ANSWERS
TO PRACTICE EXERCISE 4.4
1. Solution:
a. Null hypothesis: There is no significant difference in the performance of students between the two methods of teaching Statistics.
Alternative hypothesis: There is a significant difference in the performance of students between the two methods of teaching Statistics.
b.
c. Test Statistic: t-test assuming equal variances
d. Decision rule: Reject the null hypothesis if t-computed >t-critical value, otherwise fail to reject the null. Or, reject the null hypothesis if p-value
< 0.05.
e. Computation:
f. Decision/Conclusion: Since the t-statistic (-1.298) is less than t-critical for two-tail (2.145), the null hypothesis cannot be
rejected. Also, the p-value for two-tail (0.215) is greater than 0.05. Thus, there is no significant difference in the performance of
students between the two methods of teaching Statistics.
ANSWERS TO PRACTICE EXERCISE 4.4
2. Solution:
a. Null hypothesis: The two treatments have the same effect in treating arthritis.
Alternative hypothesis: The two treatments have different effect in treating arthritis.
b.
c. Test Statistic: t-test for dependent samples
d. Decision rule: Reject the null hypothesis if t-computed >t-critical value, otherwise fail to reject the null. Or, reject the null
hypothesis if p-value < 0.05.
e. Computation:
f. Decision/Conclusion: Since the t-statistic (-2.21) is less than t-critical for two-tail (2.26), the null hypothesis cannot be
rejected. Also, the p-value for two-tail (0.054) is greater than 0.05. Thus, the two treatments have the same effect in
treating arthritis.
ANSWERS TO PRACTICE EXERCISE 4.4
3. Solution:
a. Null hypothesis: The two methods have the same time to complete a task.
Alternative hypothesis: The two methods have different time to complete a task.
b.
c. Test Statistic: t-test for dependent samples
d. Decision rule: Reject the null hypothesis if t-computed >t-critical value, otherwise fail to reject the null. Or, reject the null
hypothesis if p-value < 0.05.
e. Computation:
f. Decision/Conclusion: Since the t-statistic (2.36) is greater than t-critical for two-tail (2.26), the null hypothesis was
rejected. Also, the p-value for two-tail (0.04) is less than 0.05. Thus, the two methods have different time to complete a
task.
ANSWERS TO PRACTICE EXERCISE 4.4
4. Solution:
a. Null hypothesis: The two methods produced the same lifetime of tires.
Alternative hypothesis: The two methods produced different lifetime of tires.
b.
c. Test Statistic: t-test assuming equal variances.
d. Decision rule: Reject the null hypothesis if t-computed >t-critical value, otherwise fail to reject the null. Or, reject the null
hypothesis if p-value < 0.05.
e. Computation:
f. Decision/Conclusion: Since the t-statistic (3.43) is greater than t-critical for two-tail (2.14), the null hypothesis was rejected.
Also, the p-value for two-tail (0.004) is less than 0.05. Thus, the two methods produced different lifetime of tires.
ANSWERS TO PRACTICE EXERCISE 4.5
1.
a. Null hypothesis: There is no significant difference in the reflective properties of the different kinds of paint.
Alternative hypothesis: There is a significant difference in the reflective properties of the different kinds of paint.
b.
c. Test Statistic: Analysis of Variance (ANOVA)
d. Decision Rule: Reject the null hypothesis if F computed is greater than F-critical or if the p-value is less than 0.01.
Otherwise, fail to reject the null hypothesis.
e. Computation:
f. Decision/Conclusion: Since the F computed (4.51) is less than the F critical value (5.29) and the p-value (0.018) is greater
than 0.01, the null hypothesis was not rejected. This implies that there is no significant difference in the reflective properties of
the different kinds of paint.
ANSWERS TO PRACTICE EXERCISE 4.5
2.
a. Null hypothesis: There is no significant difference in the measurement of the amount of burned fabric in five laboratories.
Alternative hypothesis: There is a significant difference in the in the measurement of the amount of burned fabric in five
laboratories.
b.
c. Test Statistic: Analysis of Variance (ANOVA)
d. Decision Rule: Reject the null hypothesis if F computed is greater than F-critical or if the p-value is less than 0.05. Otherwise, fail
to reject the null hypothesis.
e. Computation:
f. Decision/Conclusion: Since the F computed (4.53) is greater than the F critical value (2.56) and the p-value (0.0033) is less
than 0.05, the null hypothesis was rejected. This implies that there is a significant difference in the measurement of the amount
of burned fabric in five laboratories.
ENABLING ASSESSMENT:
THIS ASSESSMENT IS GRADED, DO YOUR BEST!
ENABLING ASSESSMENT:
THIS ASSESSMENT IS GRADED, DO YOUR BEST!
A. Direction: Perform hypothesis testing. Show all the steps and solutions. You may you use MS Excel or SPSS for your solution. 10
points each
1. An economist believed that the weekly consumption of food purchased by families with 5 members from two cities, Manila and
Makati are different. A random sample of 8 families were chosen from each city. The result are as follows
2. A dose of the drug Captrofil, designed to lower systolic blood pressure (SBP), is administered to 10 randomly selected volunteers,
with the following results. Test the effectiveness of the drug. Use 5% level
SBP before pill 120 136 160 98 115 110 180 190 138 128
SBP after pill 118 122 143 105 98 98 180 175 105 112
ENABLING ASSESSMENT:
THIS ASSESSMENT IS GRADED, DO YOUR BEST!
3. Marketing companies have collected data implying that teenage girls use more ring tones on their cellular
phones than teenage boys do. In one study of 40 randomly chosen teenage girls and boys (20 of each) with
cellular phones, the mean number of ring tones for the girls was 3.2 with a standard deviation of 1.5. The mean
for the boys was 1.7 with a standard deviation of 0.8. Conduct a hypothesis test to determine if the means are
approximately the same or if the girls’ mean is higher than the boys’ mean. Assume the variances are not the
same.
Source:https://stats.libretexts.org/Bookshelves/Introductory_Statistics/Book
%3A_Introductory_Statistics_(OpenStax)/10%3A_Hypothesis_Testing_with_Two_Samples/10.E%3A_Hypothesis_Testing_with_Two_Samples_(Exercises)
ENABLING ASSESSMENT:
THIS ASSESSMENT IS GRADED, DO YOUR BEST!
B. Direction: Perform hypothesis testing. Show all the steps and solutions. You may you use MS Excel or SPSS for
your solution. 10 points each
1. Four brands of flashlight batteries are to be compared by testing each brand in five flashlights. Twenty flashlights
are randomly selected and divided randomly into four groups of five flashlights each. Then each group of
flashlights uses a different brand of battery. The lifetimes of the batteries, to the nearest hour, are as follows.
Preliminary data analyses indicate that the independent samples come from normal populations with equal
standard deviations. At the 5% significance level, is there a significant difference on the lifetime among the 4
brands of batteries?
Source:http://www.people.vcu.edu/~wsstreet/courses/314_20033/Examples.ANOVA.pdf
ENABLING ASSESSMENT:
THIS ASSESSMENT IS GRADED, DO YOUR BEST!
2. A local marketing manager of a local fast-food chain recorded the sales in weekdays of 5 branches located
in the same city. The data is presented table 1.
Can the marketing manager conclude that average sales of the 5 branches during weekdays are the same?
Use 5% level of significance.
References:
Anderson DR, Sweeney DJ. 2018. Statistics for Business and Economics. Boston: MA: Cengage Learning.
Anderson DR, Sweeney DJ. 2016. Essentials of Modern Business Statistics with Microsoft Excel. Boston:
MA: Cengage Learning.
Anderson DR, Stamford CT, Sweeney DJ, Williams TA. 2015. Modern Business Statistics with Microsoft
Office Excel. Cengage Learning.
Reyes, C. and Saren, L. ELEMENTARY STATISTICS TEXT/WORKBOOK. National Bookstore,
Mandaluyong City
Walpole, R. PROBABILITY AND STATISTICS. NY: Macmillan Publishing Co. Inc