Professional Documents
Culture Documents
Statistics 2
Quarter 2 Module 5 : APPLYING T-TEST IN HYPOTHESIS TESTING
LEARNING OBJECTIVE:
Apply the three types of t-test in hypothesis testing
Lesson 1: One-Sample t-test
In a one-sample t-test, we compare the average (or mean) of one group against the set average (or mean). This set
average can be any theoretical value (or it can be the population mean).
Consider the following example – A research scholar wants to determine if the average eating time for
a (standard size) burger differs from a set value. Let’s say say this value is 10 minutes. How do you
think the research scholar can go about determining this?
Select a group of people Calculate the average eating time for the group
Record the individual eating time of a standard Finally, compare that average value with the set
size burger value of 10
That, in a nutshell, is how we can perform a one-sample t-test. Here’s the formula to calculate this:
wher e , t = t-statistic
ⴟ = sample mean
µ = population mean
s = sample’s standard deviation
n = sample size
As mentioned earlier in the assumptions that large sample size should be taken for the data to approach a
normal distribution. (Although t-test is essential for small samples as their distributions are non-normal).
The one sample t test compares the mean of your sample data to a known value. For example, you might want to
know how your sample mean compares to the population mean. You should run a one sample t test when you don’t know
the population standard deviation or you have a small sample size.
. Assumptions of the test (your data should meet these requirements for the test to be valid):
Data is independent.
Data is collected randomly.
The data is approximately normally distributed.
Illustrative Example: Your company wants to improve sales. Past sales data indicate that the average sale was P1000
per transaction. After training your sales force, recent sales data (taken from a sample of 25 salesmen) indicates an
average sale of P1300, with a standard deviation of P150. Did the training work? Test your hypothesis at a 5% alpha
level.
Step 1: Write your null hypothesis. Ho: There is no difference in sales, so:H0: μ = P1000.
Step 2: Write your alternative hypothesis. This is the one you’re testing.
Ha: There is a difference in sales. (two-tailed test) μ ≠ P1000
Ha: The mean sales increased. (one-tailed) Ha: μ > P1000.
Step 3: Identify the following pieces of information you’ll need to calculate the test statistic. The question should give you
these items:
Given: x̄ = P1300. μ =P1000 s = P150 n = 25.
Step 4: Substitute the given values in the t score formula
Step 5: Find the critical value of t in the table below. You need two values to find this:
1. The alpha level: given as 5% in the question.
2. The degrees of freedom, which is the number of items in the sample (n) minus 1: 25 – 1 = 24.
Look up 24 degrees of freedom in the left column and 0.05 in the top row.
Step 6: Compare the calculated t-value with the tabular value. The value of 10 falls into the rejection region (the left tail).
Calculated t is greater than the tabular value for both one-tailed and two-tailed.
1
2
Conclusion: There is a difference in sales meaning the training was probably a success.
The T-score
The t score is a ratio between the difference between two groups and the difference within the groups . The larger
the t score, the more difference there is between groups. The smaller the t score, the more similarity there is between
groups. A t score of 3 means that the groups are three times as different from each other as they are within each other.
When you run a t test, the bigger the t-value, the more likely it is that the results are repeatable.
1. Paired t-test
2. Unpaired t-test
A paired t-test is used when only two correlated groups are being compared and the measurements are either interval
or ratio. Two groups are correlated if (a) the same samples are observed before and after introduction of the
independent variable;(b) the same sample is both the experimental and control groups; and ,(c) if the experimental and
control groups are matched on some variable known to be correlated to the dependent variable.
2
3
Illustrative Example: A researcher wants to know the effectiveness of luffa as filter for diesel engine cars. He compared
the percentage of particulate matter present before and after installation of luffa fiber filter in the exhaust pipe.
% of Particulate Matter CAR
A B c D E F
Before (without filter) 68.33 54.67 59.33 56.33 58.33 50.33
After (with filter) 63.67 46.33 51.33 49.00 49.67 42.00
Ho: There is no significant difference between the mean % particulate matter of the diesel engine cars before and after the installation
of the luffa fiber filter.
Ha: There is significant difference between the mean % particulate matter of the diesel engine cars before and after the installation of
the luffa fiber filter. Level of significance. α = 0.05
This test is used when only two unrelated samples are being compared and the measurements are either interval
or ratio. The two groups may or may not have the same number of samples.
The t-test for independent groups involves testing whether or not there is
significant difference between the population means of the two groups.
For example, you want to compare the mean enzyme activity of the control
and experimental group.
Another example: A drug company may want to test a new cancer drug to find out if it improves life expectancy. In an
experiment, there’s always a control group (a group who are given a placebo, or “sugar pill”). The control group may
show an average life expectancy of +5 years, while the group taking the new drug might have a life expectancy of +6
years. It would seem that the drug might work. But it could be due to a fluke. To test this, researchers would use a t-test
to find out if the results are repeatable for an entire population.
3
4
Where:
x 1 is the mean of sample 1
s1 is the standard deviation of sample 1
n1 is the sample size of sample 1
x 2 is the mean of sample 2
s2 is the standard deviation of sample 2
n2 is the sample size in sample 2
Sp is the pooled standard deviation
Illustrative Example: Apple orchard farm owner wants to compare the two farms to see if there are any weight difference
in the apples. From farm A, randomly collected 15 apples with an average weight of 86 g, and the standard deviation is 7.
From farm B, collected 10 apples with an average weight of 80 g and standard deviation of 8. With a 95% confidence
level, is there any difference in the farms?
Null Hypothesis (H0): There is no significant difference between the means of the weights of the apples from the two
farms. (Mean apple weight of Farm A is equal to the mean apple weight of Farm B.)
Alternative Hypothesis (Ha) : There is no significant difference between the means of the weights of the apples from the
two farms. (Mean apple weight of farm A is not equal to farm B.) Given: n1=15 n2=10 S12=49
S22 =64 X̅1 =86 X̅2 = 80
df = n1 +n 2 – 2 = 15+10-2= 23
Illustrative Example: Consider a study wherein the effectiveness of banana leaves as an organic wrapper was compared
to that of aluminum foil. The number of bacterial colonies in rice wrapped in the two kinds of food wrappers was measured
after 12 hours at room temperature.
Σ X 1 = 19 Σ X 1 ² = 129 Σ X 2 = 15 Σ X 2 ² = 83
X 1 = 6.3 X 2 = 5.0
√
S 1 1 19² 15²
129− +83−
√
X =¿ Σ X −
2
1
(Σ X 1)²
N1
+X 2 ²−¿ ¿¿¿ ¿ +
N1 N2
= 3
N 1+ N 2−2
3 ( 1/ 3 + 1/3) = 1.668
(Note: 1/3+ 1/3 is also inside the radical or square root sign
X 1−X 2 6.3−5.0
t= = = 0.779
Sx 1.668
Decision: Since the calculated value is less than the calculated value, then Accept Ho.
Conclusion: There is no significant difference between the means of bacterial colonies present in cooked rice wrapped
with banana leaves and with aluminum foil after 12 hours. OR, The effectiveness of banana leaves and aluminum foil as
food wrapper for cooked rice within 12 hours is the same. Banana leaves are just as effective as aluminum foil as food
wrapper for cooked rice within 12 hours.
Directions: Apply the steps in hypothesis testing in each of the following problems. Use two-tailed test only.
1. A businessman prospects two possible locations for a new restaurant. A study was conducted and focused on the
pedestrian traffic at both areas. At each location, the pedestrians are observed in 1-hour units and for each hour, an index
of desirable character is compiled. The sample units are given below:
Mendiola n =25 x = 245 s =103
Recto n= 30 x = 438 s = 79
Test the claim that the characteristics mean indices in Mendiola are less than the mean indices in Recto. Use 0.05 level of
significance.
2. In a mutation breeding experiment, gamma radiation effect was evaluated on 100 seed weight in grams per plant of a
mungbean variety in M2 generation. The experimenters obtained the following results. Analyze the data using t-test and
give your inference as regards the effect of gamma irradiation.