You are on page 1of 5

1

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?

He/she can broadly follow the below steps:

 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

t = (130 – 100) / ((15 / √(25))


t = (30 / 3) = 10 This is your calculated t-value.

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.

one-tailed critical t-value = 1.711 Two-tailed critical value of t = 2.064

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.

Decision: Reject the null hypothesis.

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.

A large t-score tells you that the groups are different.

A small t-score tells you that the groups are similar.

ACTIVITY 1. Applying One-sample t-test


Directions: Apply the steps in hypothesis testing in each of the following problems. Use both one-tailed and two-tailed test.
1.A perfume company claims that the best-selling perfume contains at most 25% alcohol. Twenty bottles were selected
and found to have a mean of 29.7 % and standard deviation of 4.5%. Test the claim of the perfume company at the 0.05
level of significance.
2.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 150. Did the training work? Test your hypothesis at a 5% alpha level.

Lesson 2: Two-sample T-test

There are two types of two-sample T-test:

1. Paired t-test
2. Unpaired t-test

Lesson 3: Paired t-test or t-test for


Correlated Groups

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.

Correlated groups are employed to statistically remove the effects of


chance factors and to improve the researcher’s ability to assess the effects of the
independent variable on the dependent variable.

This test of significance involves testing whether or not there is significant


difference between the means of two correlated groups such as between the pre-
and post-treatment blood pressure. The difference we see in the means of the two
groups may be due to chance and sampling error.

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

Set up the following table

Car % Particulate Matter Difference (Difference)²


BEFORE AFTER
(without filter) (with filter)
A 68.33 63.67 4.66 21.7156
B 54.67 46.33 8.34 69.5556
C 59.33 51.33 8.00 64.0000
D 56.33 49.00 7.33 53.7289
E 58.33 49.67 8.66 74.9956
F 50.33 42.00 8.82 69.3881
ΣD = 45.32 ΣD²= 353.3846

( ΣD)² (45.32) ² 2053.9024


Σd² =ΣD² - = 353.3846 - = 353.3846 - = 11.0675
N 6 6

Σd ² 11.065 ΣD 45.32 D 7.5533


SD = √ =√ = 0.6073 D= = = 7.5533 t= = = 12.437
N (N−1) 6( 5) N 6 S D 0.6073
Step 6: Calculate the degrees of freedom Df = N-1 = 6-1 =5
Step 7: Find the critical value of t using t-table Two-tailed critical value of t = 2.571 (α = 0.05)
Step 6: Compare the calculated t-value with the tabular value. T cal (1.437) > T tab (2.571)
Step 7: Decide then formulate a conclusion

Decision: Reject Ho and accept Ha


Conclusion:. There is significant difference between the mean % particulate matter of the diesel engine cars before and
after the installation of the luffa fiber filter. Hence, the luffa filter is effective.

ACTIVITY 2: Applying Paired t-test


Directions: Apply the steps in hypothesis testing in each of the following problems. Use two-tailed test only.
1. Twelve cars were equipped with radial tires and driven over a test course. Then the same 12 cars (with the same
drivers) were equipped with regular belted tires and driven over the same course. After each run, the cars’ gas
economy (in km/l) was measured. Is there evidence that radial tires produce better fuel economy?

Car gas Economy 1 2 3 4 5 6 7 8 9 10 11 12


Y1(Radial) 4.2 4.7 6.6 7.0 6.7 4.5 5.7 6.0 7.4 4.9 6.1 5.2
Y2 (Belted) 4.1 4.9 6.2 6.9 6.8 4.4 5.7 5.8 6.9 4.7 6.0 4.9
2. A teacher wants to find out whether his Strategic Intervention Material (SIM) is effective. The following are the pre-
test and post-test scores of the 10 students. The tests are parallel and composed of 30 items.
Student 1 2 3 4 5 6 7 8 9 10
Pre-test 12 4 5 7 9 11 10 21 16 17
Post-test 18 19 21 16 7 19 19 26 25 28
Lesson 4: Independent t-test (Unpaired t-test)

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

Significance level: α=0.05

df = n1 +n 2 – 2 = 15+10-2= 23

Find the critical value: Refer two tailed t


table for 23 degrees of freedom

Two Tailed T Test If the calculated t value


is less than -2.069 or greater than 2.069,
then reject the null hypothesis.

Interpret the results:Since calculated t


statistic value (1.98) < critical value, (2.069) hence null hypothesis is accepted.
Decision: Accept Ho
Conclusion: There is no significant difference between mean weights of apples in farm A and farm B.

Unpaired t-test formula if raw data are given

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.

Treatment Number of Bacterial Colonies


Replicates
A B C
Banana Leaves 4 8 7
Aluminum Foil 5 3 7
Ho: There is no significant difference between the means of bacterial colonies present in cooked rice wrapped with
banana leaves and with aluminum foil.
Ha: There is significant difference between the means of bacterial colonies present in cooked rice wrapped with banana
leaves and with aluminum foil.
Set up the following table:
Banana Leaves Aluminum Foil
X1 X 1² X2 X 2²
4 16 5 25
8 64 3 9
7 49 7 49
4
5

Σ X 1 = 19 Σ X 1 ² = 129 Σ X 2 = 15 Σ X 2 ² = 83
X 1 = 6.3 X 2 = 5.0

Compute the standard error of the difference between means


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

Df = n1 + n2 -2 = 3 + 3 -2 = 4 t tab (α = 0.05) = 2.776

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.

ACTIVITY 3: Unpaired t-test or t-test for Independent Samples

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.

Control 2.9 3.1 3.5 3.4 3 4 3.7 3 4 4


Treated 2.7 2.8 3 3.5 3.7 3.2 3 3.1 2.9 2.8

You might also like