# Statistical Test for Two Group Means

I've got two group means and I want to see if the difference is statistically significant.

I'm using US Census data and race. For instance, I'll have one group of 100 people that is 50% white and another group of 50 people that is 70% white.

What test should I use?

Also if I want to compare a median income for two different groups, is there a different test I should use (as it is impossible to calculate the variance)?

• what assumption do you make on the data? – Lost1 Nov 25 '13 at 22:42
• It is US Census data. For race, I'm assuming that they counted everyone correctly (in fact they probably missed 0.5-1%). For income, the data comes with an estimated confidence interval. I'm not assuming that the racial distribution of the US population is a normal distribution. The income distribution of the US population might be closer to normal. – Aaron Kreider Nov 25 '13 at 22:48

I am assuming you have data from samples of two subsets of the population. With these samples you want to infer something about the population.

Is the mean of two subgroups of the population different?

1. Given sample sizes of 50 and 100*, you can conduct a two sample (unpaired) t-test. Almost every statistical package can do it; it is often used to compare the mean outcome in experiments between control and treatment group. In your example, it tells you if you can conclude with a given level of confidence that the share of "white" in the first subgroup is larger than in the second subgroup (or vice versa).

2. Since the data already contains confidence intervals computed by the census office, you can also use those. If the sample share of whites is, say, 50%, then the confidence intervals tell you the population share of this subgroup is in the intervals $[50- CI, 50+CI]$ for $\alpha$ samples drawn, where $\alpha$ is the confidence level (typically 95%). Therefore, if the confidence intervals of the two subgroups do not overlap, then the means are statistically different at least at confidence level $\alpha$. (But a slight overlap of confidence intervals need not imply that they are not statistically different; in that case, conduct the t-test.)

How to compare the median of two subgroups?

The t-test is not suitable to test this hypothesis, because it really tests equality of means. Most people would recommend the Wilcoxon rank sum test here, which is fine, but this is not strictly a test of the equality of median. It tests whether, say, incomes in one group tend to be higher than those in the other group (i.e., it compares ordinal ranks). Indeed, this is usually more interesting than the median. To specifically test equality of medians, you can use the median test.

*for considerably smaller sample sizes, you would have to check whether the data is normally distributed. For large samples, the mean is approximately normally distributed by the central limit theorem.

• What is the "median test"? – Aaron Kreider Dec 9 '13 at 19:29
• en.wikipedia.org/wiki/Median_test – Nameless Dec 10 '13 at 14:13
• Is it possible to determine whether or not the means are different without any knowledge of either the population or sample standard deviation? My intuition tells me "not really". – jim_shook Jun 7 '14 at 17:29
• Typically not, since without a measure of variance you cannot judge whether a difference is statistically "big" or "small". Maybe if you had something else like quantiles of the data instead of sd.. – Nameless Jun 9 '14 at 20:50