t test for single mean, t test for means of independent samples, t test for means of dependent sample ( Paired t test). Case study / Examples for hands on experience of how SPSS can be used for different hypothesis testing - t test.
3. t test
for
single mean
Step 1: Null hypothesis H0: 𝜇 = 𝜇0
Step 2: Alternative hypothesis H1: 𝜇 ≠ 𝜇0 or 𝜇 > 𝜇0 or 𝜇 < 𝜇0
Step 3: Check Assumptions
Step 4: Test statistic – t and p value
Step 5: Conclusion
• If p ≤ Level of significance (∝), We Reject Null hypothesis
• If p > Level of significance (∝), We fail to Reject Null hypothesis
Assumptions Tests
The population from which the sample
drawn is assumed as Normal distribution
Shapiro-Wilks
/ qq plot
The population variance 𝜎2 is unknown ____
4. Example 1.
Based on field experiments, a new variety of green gram is expected to give an average yield
of 12.0 quintals per hectare. The variety was tested on 10 randomly selected farmer’s fields.
The yield (quintals/hectare) were recorded as
14.3,12.6,13.7,10.9,13.7,12.0,11.4,12.0,12.6,13.1.
(File Name: Green_gram.xlsx)
Do the results confirm to the expectation?
5. Null & Alternative
Hypothesis
Step 1: Null hypothesis H0: 𝜇 = 12
[Average yield is 12 quintals per hectare ]
Step 2: Alternative hypothesis H1: 𝜇 ≠ 12 ( Two-tailed test)
[Average yield is not 12 quintals per hectare ]
12. Step 5:
Here, the test statistic- t value = 1.836 and p = 0.100 > 0.05
So we fail to reject the Null hypothesis at 5% level of significance
Thus, new variety of green gram is expected to give a yield of 12.0 quintals per
Output
13. Example 2
A researcher is investigating hemoglobin levels of school girls in a particular area. 15 school
girls were randomly selected and their hemoglobin level is as follows. Does the data reveal
that average hemoglobin level among school girls is more than 11.5? Use 5 % level of
significance. (File Name: Hb_girls.xlsx)
11.9 11.5 11.1 10.6 10.4 12 10.9 11.6 11.4 11.6 11.8 11.5 10.9 11.2 11.7
14. Null &
Alternative
Hypothesis
Step 1: Null hypothesis H0: 𝜇 = 11.5
[Average haemoglobin level is not more than 11.5]
Step 2: Alternative hypothesis H1: 𝜇 > 11.5 ( One-tailed test)
[Average haemoglobin level is more than 11.5]
21. Step 5:
Here, the test statistic- t value = -1.301 and p = 0.214 ( for two-tailed)
∴ p value for one-tailed will be (0.214/2) = 0.107 > 0.05
So we fail to reject the Null hypothesis at 5% level of significance
Thus, average hemoglobin level among school girls is not more than 11.5.
Output
22. t test
for
means of two
independent
samples
Step 1: Null hypothesis H0: 𝜇1= 𝜇2
Step 2: Alternative hypothesis H1: 𝜇1 ≠ 𝜇2 or 𝜇1 > 𝜇2 or 𝜇1 < 𝜇2
Step 3: Check Assumptions
Step 4: Test statistic – t and p value
Step 5: Conclusion
• If p ≤ Level of significance (∝), We Reject Null hypothesis
• If p > Level of significance (∝), We fail to Reject Null hypothesis
Assumptions Tests
The population from which two samples drawn are
assumed as Normal distribution
Shapiro-Wilks
/ qq plot
Two population variance are unknown
(Equal / Unequal)
F test
The two samples are independently distributed ____
23. t test for Equal Variances t test for Unequal Variances
(Welch t test)
d.f. =
where
24. Example 1.
In a fertilizer trial, the grain yield of paddy (Kg/plot) was observed as follows:
(File Name: Fertilizers.xlsx)
Under ammonium_chloride 42, 39, 38, 60, 41
Under urea 38, 42, 56, 64, 68, 69, 62
Find whether there is any difference between the sources of nitrogen?
25. Null & Alternative
Hypothesis
Step 1: Null hypothesis H0: 𝜇1= 𝜇2
[There is no significant difference between the sources of
nitrogen]
Step 2: Alternative hypothesis H1: 𝜇1 ≠ 𝜇2 ( Two-tailed test)
[There is no significant difference between the sources of
nitrogen]
28. For Ammonium Chloride, p = 0.967 > 0.05. So, data of yield of paddy under
Ammonium chloride is normally distributed.
For Urea, p = 0.172 > 0.05. So, data of yield of paddy under urea is normally
distributed.
Output
29. Here the points are almost close to the line, so we can say that both the data is
normally distributed
Output
32. Before testing equality of two means, we have to test equality of two variances.
Here, the test statistic- F value = 9.872 and p = 0.010 < 0.05
So we reject the Null hypothesis at 5% level of significance
∴ Variances are not equal
Output
33. Step 5:
Here, the test statistic- t value = -3.580 and p = 0.011 < 0.05
So we reject the Null hypothesis at 5% level of significance
Thus, there is difference in the yield of paddy because of sources of nitrogen.
Output
34. Example 2
Researchers wished to know if body temperature of males is less than that of
females. He took a random sample of 51 females and 49 males and measured their
body temperature. (Data: bodytemperature.txt)
What should the researchers conclude?
35. Null & Alternative
Hypothesis
Let 𝜇1 = average body temperature of males
and 𝜇2 = average body temperature of females
Step 1: Null hypothesis H0: 𝜇1= 𝜇2
[ Body temp. of males is not less than that of females]
Step 2: Alternative hypothesis H1: 𝜇1< 𝜇2
[ Body temp. of males is not less than that females]
( One-tailed test)
38. For females, p = 721 > 0.05. So, data of body temperature of females is normally
distributed.
For males, p = 0.135 > 0.05. So, data of body temperature of males is normally
distributed.
Output
39. Here the points are almost close to the line, so we can say that data of body
temperature of females and males is normally distributed
Output
42. Before testing equality of two means, we have to test equality of two variances.
Here, the test statistic- F value = 2.248 and p = 0.137 > 0.05
So we fail to reject the Null hypothesis at 5% level of significance
∴ Variances are equal
Output
43. Step 5:
Here, the test statistic- t value = -1.353 and p = (0.177/2) = 0.0885 > 0.05
So we fail to reject the Null hypothesis at 5% level of significance
Thus, body temp. of males is not less than that of females
Output
44. t test
for
means of two
dependent
samples
(Paired t test)
Step 1: Null hypothesis H0: 𝑑 = 0
Step 2: Alternative hypothesis H1: 𝑑 ≠ 0 , 𝑑 > 0, 𝑑 < 0
Step 3: Check Assumptions
Step 4: Test statistic – t and p value
Step 5: Conclusion
• If p ≤ Level of significance (∝), We Reject Null hypothesis
• If p > Level of significance (∝), We fail to Reject Null hypothesis
Assumptions Tests
The difference between the two samples
are normally distributed.
Shapiro-Wilks
/ qq plot
The difference between the two samples
are independently distributed
____
The two samples are independently
distributed
____
45. Example 1
The iron contents of fruits before and after applying farm yard manure was observed as follows:
Fruit No: 1 2 3 4 5 6 7 8 9 10
Before Applying 7.7 8.5 7.2 6.3 8.1 5.2 6.5 9.4 8.3 7.5
After Applying 8.1 8.9 7.0 6.1 8.2 8.0 5.8 8.9 8.7 8.0
Is there any significant difference between the mean iron contents in the fruits after applying the
farm yarn manure? (File Name: Fruit_iron_content.xlsx)
46. Null &
Alternative
Hypothesis
Step 1: Null hypothesis H0: 𝑑 = 0
[There is no significant difference between the mean iron
contents in the fruits after applying the farm yarn manure]
Step 2: Alternative hypothesis H1: 𝑑 ≠ 0 ( two-tailed test)
[There is significant difference between the mean iron contents in
the fruits after applying the farm yarn manure]
54. Here, the test statistic- t value = -0.655 and p = 0.529 > 0.05
So we fail to reject the Null hypothesis at 5% level of significance
∴ There is no significant difference between the mean iron contents in the fruits
after applying the farm yarn manure
Output
55. THANK YOU
Dr Parag Shah | M.Sc., M.Phil., Ph.D. ( Statistics)
pbshah@hlcollege.edu
www.paragstatistics.wordpress.com