Can anyone explain the difference between on way ANOVA and t-test? It would be good if someone explains both tests by giving examples related to Agriculture?
The main difference between 1-Way ANOVA and a t-test is the number of groups (or measurements) you are comparing: t-tests only compare 2 whereas 1-Way ANOVA compares 2 or more.
If you find there is a difference between several groups with a 1-Way ANOVA you might then be interested to find out which groups are different - this is known as post hoc testing. There are different ways of doing this as there are different ways of handling the risk on a false positive (known as a Type I error).
As Peter stated, the number of groups, which can be compared, is one main difference.
Another difference are the assumptions about the distribution within the groups:
With a t test you can balance for different variance within the compared groups (t or Welch test), with ANOVA you have to assume that the variances are equal. There are several suggestions to transform the variable under scrutiny to attain equal variance in the groups to be compared.
Manfred, one can perform (Welch's) ANOVA when variance are not homogenous. So the assumptions are the same for t-test and ANOVA. Actually the only difference is the number of groups as explained by Peter. Nonetheless, you can always perform ANOVA for any number of groups and this would not be wrong. Those tests produce the same result.
Both tests require a continuous dependent variable and a categorical independent variable. The hypothesis to be tested in these tests is whether means of the dependent variable is equal among different groups (independent variable). So a significant test result would mean that, group means are not equal. For examples related to agriculture, an internet search will be helpful.
If you have only two groups. Assume you have different variance within the groups
You cannot apply ANOVA (except on transformed data, which might you might be able to equalise the variances in the two groups; however, this transformation leaves you with artificial variables, which are harder to interpret).
However, you can apply a t test, which estimates the variances in the two groups separately and combine the variance estimation for the difference of the means - then you have to judge this t statistic on a t distribution with a (Welch) corrected) number of degrees of freedom.
There is no such t test alternative for more than two groups and separate two-groups comparisons for more groups leads to the multiple comparison problems (with alpha inflation).