What are the most accepted ways to visualize the results of an independent two sample t-test? Is a numeric table more often used or some sort of plot? The goal is for a casual observer to look at the figure and immediately see that they are probably from two different populations.
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
It is worth being clear on the purpose of your plot. In general, there are two different kinds of goals: you can make plots for yourself to assess the assumptions you are making and guide the data analysis process, or you can make plots to communicate a result to others. These are not the same; for example, many viewers / readers of your plot / analysis may be statistically unsophisticated, and may not be familiar with the idea of, say, equal variance and its role in a t-test. You want your plot to convey the important information about your data even to consumers like them. They are implicitly trusting that you have done things correctly. From your question setup, I gather you are after the latter type.
Realistically, the most common and accepted plot for communicating the results of a t-test to others (set aside whether it is actually the most appropriate) is a bar chart of means with standard error bars. This does match the t-test very well in that a t-test compares two means using their standard errors. When you have two independent groups, this will yield a picture that is intuitive, even for the statistically unsophisticated, and (data willing) people can "immediately see that they are probably from two different populations". Here is a simple example using @Tim's data:
That said, data visualization specialists typically disdain these plots. They are often derided as "dynamite plots" (cf., Why dynamite plots are bad). In particular, if you have only a few data, it is often recommended that you simply show the data themselves. If the points overlap, you can jitter them (add a small amount of random noise) so that they no longer overlap. Because a t-test is fundamentally about means and standard errors, it is best to overlay the means and standard errors onto such a plot. Here is a different version:
If you have a lot of data, boxplots may be a better choice to get a quick overview of the distributions, and you can overlay the means and SEs there too.
Simple plots of the data, and boxplots, are sufficiently simple that most people will be able to understand them even if they aren't very statistically savvy. Bear in mind, though, that none of these make it easy to assess the validity of having used a t-test to compare your groups. Those goals are best served by different kinds of plots.
The most commonly used way to visualize $t$-test-like comparison is to use boxplots. Below I provide example using dataset describing "relationship between marijuana smoking and a deficit in performance on a task measuring short term memory" from this site.
Actually, boxplots are commonly used for "informal" hypothesis testing, for example as described by Yoav Benjamini in 1988 paper Opening the Box of a Boxplot:
This plot does not show quantities directly involved in $t$-test, as @NickCox noticed. If you want direct comparison of means with confidence intervals you can use bar plot with marked confidence intervals. Using means and confidence intervals also enables you to conduct hypothesis test (see here or here).
As you can see from other posts and comments under this thread, both boxplots and dynamite plots are somewhat controversial choice, so let me give you one more alternative that was not mentioned yet. First, recall that $t$-test and regression are related. You can plot $t$-test-like comparison as two points with errorbars (confidence intervals) that are connected with line. Slope of the line is proportional to regression slope if you used linear regression rather than $t$-test in this situation. Major advantage of such plot is that it enables you to easily judge the magnitude of difference of means by looking at the slope of the line. It's disadvantage may be that it may suggest that there is some "continuity" between the means (i.e. that you had paired samples).
Boxplots seem to be more commonly used since they provide more information about the distribution of variables visualized (comparing to mean with confidence interval only). They also complement rather than duplicate the information from $t$-test and such usage of plot is encouraged by most style guides, e.g. by Publication Manual of the American Psychological Association:
This is mostly a variation on the helpful answers by @Tim and @gung, but the graphs cannot be fitted into a comment.
Small but possibly useful points:
Quantile-box plots for smokers and non-smokers. The boxes show medians and quartiles. The horizontal lines in blue show means.
Note. The graph was created in Stata. Here is the code for those interested.
EDIT. This further idea in response to the answer by @Frank Harrell superimposes two normal probability plots (really quantile-quantile plots). The horizontal lines show means. Some would want to add lines for each group indicating perfect fit, e.g. through ($0$, its mean) and ($1$, its mean $+$ its SD) or robust-resistant alternatives.
Besides the nice goal of presenting the results there should be some consideration about which graphics check the assumptions of the two-sample equal variance $t$-test for it to have excellent performance. That would be normal inverse functions of the two empirical cumulative distribution functions. To satisfy the test assumptions these two curves must be parallel straight lines.