# How to calculate 95% confidence interval of two group means and perform hypothesis test comparing group means?

Below is the information about the weight of coffee (in thousand kg) sold at two locations (location1 and location 2)

26.3, 26.5, 16.2, 16.2, 26.4, 16.8, 16.1, 16.9 (8 shops)
44.4, 44.7, 34.9, 54.1, 44.8, 22.6, 36.4 (7 shops)

1. Find the 95% confidence interval for the difference between the mean weight for the coffee sold at different locations.
2. where do you prefer to own a shop? Why? Explain
3. Now you need to prove whether preferred area has really got higher mean of weight of coffee sold over the week in question. carry out appropriate tests at 5% and 1% levels.
-
Since this is homework, it is very important that you show us what you've tried to do to solve it. – Zen Jun 24 '12 at 5:31

Assuming the first 8 shops are at location 1 and the next 7 at location 2 you can do a two sample t test. It appears that the differences in weight is large and will be significant at both the 5% and 1% levels but that should be determined by calculating the test statistic and comparing it to the critical value for a t distribution with 8+7-2=13 degrees of freedom. If it appears that the samples do not come from normal distributions then the Wilcoxon rank sum test could be applied.

-

While this is obviously a homework question which wants you to do a t-test (more details on that if you show some effort yourself!), I want to add some practical concerns.

First off, doing the t-test assumes normality and with your sample size you can not even assert robustness. Your sample size is also too small to really check for normality. However, if I got those values two things would immediately attract my notice: the first set of values looks suspiciously bimodal. This could be caused by two different sublocations or other differences between the shops. And the second set of values seems to have one value which is considerably smaller than the others. So either the other values give a bad estimate of the standard deviation or it is an outlier. Both would not be optimal.

Note that both of these observations might be a fluke given your small sample size. But they would urge caution and further investigation (if this were not a homework problem).

All this together means a simple t-test would be a bad idea. A Wilcoxon test does also not circumvent the possible problem of bimodality in one of the sets. It also tests a different hypothesis than difference of the means. In practice it is often very close your homework problem explicitly asks for difference of means. I also consider it bad practice to calculate confidence intervals on groups as small as this, but I don't want to elaborate too much on this here.

-