# An alternative to 'dynamite plots' (i.e., a bar depicting the mean, with a line depicting the standard deviation or error)

We've all seen various examples of 'dynamite plots' --- the plots where the mean value is depicted with a bar, and the standard deviation or error is depicted with a line that connects to the bar. However, many of us forget how misleading these plots can be, especially when you have small sample sizes. Specifically, the mean can be grossly changed when you have a value that is very dissimilar to the rest of the values in the sample (e.g., take the mean of the values 2, 3, and 15).

When you have a small sample, or small samples in each group, a better alternative to the 'dynamite plot' is to plot a boxplot overlaid with the actual data points (i.e., a stripchart). This boxplot and stripchart not only show the summary statistics of your sample (i.e., median), but it also shows the actual data values so you can see where the data points cluster and fall.

As an example, let's generate a boxplot overlaid with a stripchart based on the `samplefile.txt` data file. Here, we generate a boxplot and strichart of age for each level of race.

```x <- read.table("samplefile.txt", header=TRUE)
with(x, stripchart(age ~ race, vertical=TRUE, method="jitter", pch=19, jitter=0.3,
col="gray"))
with(x, boxplot(age ~ race, add=TRUE, varwidth=TRUE, notch=TRUE))
```
We used `method = "jitter"` in the `stripchart()` function to add random noise to concurrent points (i.e., those with the same value) in order to be able to visually distinguish them. Also, we used the `add = TRUE` argument of the `boxplot()` function to force the `boxplot()` function (usually a high-level plotting command) to act as a low-level plotting command - i.e., to add the boxplot on top of the stripchart.

You can add more to the plot using additional arguments - such as the labels. 