By deciding whether or not you want to reject the null hypothesis based on the t-statistic. Details can be found here: http://en.wikipedia.org/wiki/Student%27s_t-test
A t-test is a dead end. Suppose you find a difference between two groups - say, between smokers and non-smokers, but you suspect that this difference is partly due to demographic differences – the smokers and non-smokers might differ in age and sex ratio. In such a case you would do a regression with smoking, sex and age as predictors.
Well, the good news is that a t-test is just a regression that has a single predictor variable that only takes on two values. So don't bother with the t-test, do the regression. The t-value from the regression is the t-value from the t-test. And if you want a correction for unequal variances, use robust variance estimation, available in Stata and other stats packages.
You could use the R-programming language (http://www.r-project.org/) to perform the t-test. Also you should calculate the power of your t-test. There is an R-language package that can perform power calculations (http://cran.r-project.org/web/packages/pwr/index.html). The R-programming language is specific to statistical computing and is also open-source.
Adel, just make sure T-test is applicable in your case (you have to know that your data are normally distributed); otherwise you'll be better off with nonparametric tests.
Wow! I just read these answers, and I am absolutely baffled about the advice given there.
The question was simple, I think: how can one perform a t-test. For this simple question, the use of difficult-to-learn sophisticated statistical software with specialized extra packages was suggested (twice, actually). Excel was suggested, but staight-away with additional specialized toolpacks. Obviousely, Adel (and maybe others who think this question is interesting) is unlikely to be an expert in statistics and programming, thus I consider such advices not very helpful.
Further there was the seemingly obligatory hint to perform a Wilcoxon test in case the distributional assumption is violated, and still this advice is repeating a wide-spread misconception. The Wilcoxon test is NOT an alternative for the t-test. The t-test is about means, the Wilcoxon test is about distributions (with a particular sensitivity to location shifts). This is something different. The question for a t-test implies that means should be tested. Advicing a test that does something else is not very helpful. The Wilcoxon test may be sensible, but clearly not for the task to test means. It might have been sensible to ask what question should be solved with the t-test. Maybe Adel simply wanted to know how the test works without having own data or a particular problem to solve with.
Mentioning that the test makes some assumptions and that a (multiple) regression may additionally account for covariables are ok, to my opinion, but again seem to more or less unneccesary blow up the feedback for a simple question of a presumed stats layman.
To my opinion a simple specific answer is missing. I would have mentioned to read the Wikipedia article, where pretty much about the t-test is explained. Or one of the many sites explaining the t-test in more or less detail (Example: http://www.socialresearchmethods.net/kb/stat_t.php). Or to explain the principle, that the mean difference is devided by the standard error of this difference yielding a t-statistic, and that the distribution of this statistic under the null hypothesis (H0) is known (t with n1+n2-2 d.f.), and that this known distribution can be used to either define H0-rejection regions for t (leading to accept or reject H0) or to calculate the probability to observe even more extreme t-values under H0 (what is the p-value). One might have given the formula to calculate the standard error, but this is anyway shown in wikipedia.
If the answer should aim to a practical solution, using Excel (or some open-source alternative spread-sheet software) is a reasonable advice since it is relatively well known. But no add-on packages and toolkits are required to solve the problem. The required function is simply T.TEST() or TTEST(). That's all. Adel could read the help for this function to understand how to use it with his data. Another option was to link one or few of the many sites where one can enter data and perform a t-test (free and without installing software). Example: http://studentsttest.com/
@Raoof, I agree. It is good to see and share many opinions. I learn a lot here in RG just because of this fact. However, there are many occasions where flawed answers are given, logically wrong things are spread, and factually unhelpful advices are given. I find it important that the answers in RG are critically reviewd by the RG community to improve and ensure the high quality of answers and comments. Therefore I consider it important to indicate good/precise/helpful/thought-provoking etc. answers as well as flawed/misleading/wrong/unhelpful answers. I do not see the vote-buttons as Facebook-like "like/dislike-buttons". Voting should be based on the above mentioned criteria, IMHO. It is also important in this context that the voters are not anonymus (in future I'd wish that voting will even include some impact measure, based on the (somehow measurable) reputation of the voter in the particular topic - not sure how to achieve this but it would be nice to have). Up-voters are listed, but down votes are unfortunately anonymus in RG. So the least thing a sensible down-voter should do is to comment what and why he/she down voted, to put things right.
So get me right: when I down vote the advice that "R is a good option" for the querist (just as example!), then I comment it and explain why I find this advice bad and try to give a better advice. I think that a down-vote is helpful for the uniformed reader who might become more careful or critical, recognizing at least that there are other people how are of the opinion that this comment is somehow "bad" (and sometimes the explanation might either demonstrate the mistake justify the opinion).
Discussions are almost always very good. They often are at least thought-provoking. And still, some comments in discussions can be wrong and/or may seriousely confuse a reader, other comments may contain great thoughts, insights or provide some beautiful explanation. It should be possible to indicate such things, and I think the up- and down-votes are the only possible way to do it here.