In one sample t-test we only compare a population with a certain value, but in reality cases using this type of test are very rare. Researchers, particularly in agriculture, are more concerned with cases that require comparisons between two conditions or two population averages.
Before we do the analysis, we must first consider whether the two populations come from a normal distribution, are the variances of the two populations homogeneous? This will guide us in choosing the right method and formula for conducting a t-test analysis to compare the two population mean values. In this article, we will describe the 2 population/sample t-test with heterogeneous variance .
A full discussion of the t-student test can be read in the following document.
Hypothesis
Test Type: | |||
Two-Tailed | Right Tailed | Left Tailed | |
H0 : μ1 = μ2 | H0 : μ1 = μ2 | H0 : μ1 = μ2 | |
HA : μ1 ≠ μ2 | HA : μ1 > μ2 | HA : μ1 < μ2 | |
Decision: | |||
Reject H0 if: | |t| > tα/2,df | t > t α,df | t < -t α,df |
Statistical Test
If σ1 ≠ σ2 and both are not known in value, the value is approached with the approximate value, i.e. the average deviation of the example, s. because the two populations have different variations, the standard deviation of the example is approached by:
$$s_{{\bar{y}}_1-{\bar{y}}_2}=\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}$$
with
$$ df=\frac{\left(\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}\right)^2}{\left(\frac{\left(\frac{s_1^2}{n_1}\right)^2}{n_1-1}+\frac{\left(\frac{s_2^2}{n_2}\right)^2}{n_2-1}\right)}$$
The df value is rounded to the nearest number.
Thecalculated value of t is determined by the following formula:
$$t=\frac{{\bar{y}}_1-{\bar{y}}_2}{SE_{{\bar{y}}_1-{\bar{y}}_2}}$$ $$t=\frac{{\bar{y}}_1-{\bar{y}}_2}{\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}}$$
Example 1:
There are two groups of land types, namely arable land and barren land, from each of these lands 7 pieces were sampled for the size of fine gravel. Test at the level of 5% is the fine gravel content in fertile land different from barren land? Fine and coarse gravel data are presented in the following Table:
Table.Fine gravel in surface soil (Torrie, 1980)
Number | Result | |
Fertile Land | Barren Land | |
1 | 5.9 | 7.6 |
2 | 3.8 | 0.4 |
3 | 6.5 | 1.1 |
4 | 18.3 | 3.2 |
5 | 18.2 | 6.5 |
6 | 16.1 | 4.1 |
7 | 7.6 | 4.7 |
Manual Calculation (Classical/Traditional Method)
Fertile Land | Barren Land | |
n | 7 | 7 |
$\bar{{y}}$ | 10.9143 | 3.9429 |
s | 6.33441 | 2.63619 |
- Step 1: Claim: the alleged average difference between the two lands can be denoted by: μ1 ≠ μ2, if the conjecture is false, then μ1 = μ2
- Step 2: From the two equations above, the μ1 = μ2 contains an element of equality, thus becoming the null hypothesis and alternative hypothesis(H1) μ1 ≠ μ2.
- H0: μ1 = μ2
- H1: μ1 ≠ μ2
- Significant level: α = 0.05
- Determine the statistical test: the sample is taken randomly; n < 30; normally distributed (Kolmogorov-Smirnov/Shapiro-Wilk Test) and σ1 ≠ σ2 (Levene Test). From these conditions, the appropriate statistical test is an independent t-test with different variations.
- Calculate tstat and determine tcritical:
- Calculation of the calculated value of t
$$s_{{\bar{y}}_1-{\bar{y}}_2}=\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}$$
$$\begin{matrix}s_{{\bar{y}}_1-{\bar{y}}_2}=\sqrt{\frac{(6.33441)^2}{7}+\frac{(2.63619)^2}{7}}\\=2.59324\\\end{matrix}$$
With:
$$ df=\frac{\left(\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}\right)^2}{\left(\frac{\left(\frac{s_1^2}{n_1}\right)^2}{n_1-1}+\frac{\left(\frac{s_2^2}{n_2}\right)^2}{n_2-1}\right)}$$
$$=\frac{\left(\frac{(6.33441)^2}{7}+\frac{(2.63619)^2}{7}\right)^2}{\frac{\left(\frac{(6.33441)^2}{7}\right)^2}{7-1}+\frac{\left(\frac{(2.63619)^2}{7}\right)^2}{7-1}} \\=8.018 \approx 8$$
$$ t=\frac{{\bar{y}}_1-{\bar{y}}_2}{s_{{\bar{y}}_1-{\bar{y}}_2}}=\frac{10.9143-3.9429}{2.59324}=2.688297$$
- Determine thetcritica with df = 8 and α = 0.05. From the t-student table obtained the value of tkritis for a Two-Tailed test = 2.305
- Because |tstat| > tcritical = |2,688| > 2.305, then H0 is rejected!
- From the results of the t-test, it was concluded that at a significant level of 5%, the average fine gravel content on arable and barren land is different.
Calculations by using the SmartstatXL Excel Add-In
Analysis Results
Calculation using SPSS software v.16:
Group Statistics | |||||
Land | N | Mean | Std. Deviation | Std. Error Mean | |
Gravel | Fertile | 7 | 10.9143 | 6.33441 | 2.39418 |
Barren | 7 | 3.9429 | 2.63619 | .99639 |
Tests of Normality | |||||||
Land | Kolmogorov-Smirnova | Shapiro-Wilk | |||||
Statistics | Df | Sig. | Statistics | Df | Sig. | ||
Gravel | Fertile | .271 | 7 | .130 | .828 | 7 | .076 |
Barren | .145 | 7 | .200* | .962 | 7 | .838 | |
a. Lilliefors Significance Correction | |||||||
*. This is a lower bound of the true significance. |
Independent Samples Test | ||||||||||
Levene's Test for Equality of Variances | t-test for Equality of Means | |||||||||
F | Sig. | t | Df | Sig. (2-tailed) | Mean Difference | Std. Error Difference | 95% Confidence Interval of the Difference | |||
Lower | Upper | |||||||||
Gravel | Equal variances assumed | 19.775 | .001 | 2.688 | 12 | .020 | 6.97143 | 2.59324 | 1.32124 | 12.62161 |
Equal variances not assumed | 2.688 | 8.018 | .028 | 6.97143 | 2.59324 | .99372 | 12.94914 |
Normality Test
The normality test (Kolmogorov-Smirnova/ Shapiro-Wilk) for both groups was not significant. This shows that the two samples are normally distributed.
Variance homogeneity test:
The results of the Levene's Test showed that the two populations had unequal variance (p = 0.001 < 0.05), so the t-test used was a test assuming unequal variance (Equal variance not assumed). This Hal suggests that the two samples came from different populations.
Conclusion:
Hypothesis:
- H0: μ1 = μ2
- H1: μ1 ≠ μ2
Classic Method
tstat = tstat = T-Value = 2.688
tcritica = ttable = t(0.05.9) = 2,305 (obtained from the table value t-student)
Since |tstat| > |tcritical| = 2,688 > 2,305 then H0 is rejected!
Modern Methods:
Tests with modern methods use p-value in determining whether or not a statistical test is significant.
If: P-Value < Significant Level then the significant test or H0 is rejected
If: P-Value > Significant Level then the non-significant test or H0 is accepted
Conclusion:
See the output of the analysis results using SmartstatXL and SPSS software above!
Since its signification value (p-value or Sig. = 0.028) < 0.05, then H0 is rejected and HA is accepted. This shows that at a significant level of 5%, the average fine gravel content on arable and barren land is different.
In the output the Table also includes the value of the confidence interval.
P(0.99372 < μ1 - μ2 < 12.94914) = 95%
Which means that 95% of us believe that the difference between the two average lands is in the range between 0.99372 and 12.94914.