I have a question regarding error bars. I understand that error bars (EBs) constructed with 1 standard deviation (SD) present different things about the population than EBs constructed with 95% confidence intervals (CI). Namely, EBs with SD show the spread (or dispersion) of the variable's actual values, while EBs with CI show the range that the actual mean should most likely fall within.

My data include a variable, the number (count) of times a person visits the doctor per year. The mean visit number is 3 and the SD is 5, while the confidence interval is 2.5 to 3.5. Is it inherently wrong to show the EBs based on SD since it would extend to negative values (i.e., 3-5 = -2)? Does it violate any assumption?

If I draw the bar graph showing mean 3 and EBs based on 1 SD, the EBs will range from 0 to 8, can I still claim that ~68% of values fall within 0 to 8, or because it is right skewed and the supposed lower EBs largely reaches the negative, this no longer holds? If so, how can I interpret the 0 to 8 which truncates the negative?

  • 1
    $\begingroup$ A confidence interval of '2.5--3.5' doesn't seem entirely meaningful, either -- how do you visit the doctor half a time? $\endgroup$
    – avid
    Jul 24, 2020 at 2:50
  • 6
    $\begingroup$ @avid If the mean had been 3.2 or 2.8 would you have objected to that? There is a problem there, but it's mostly in explaining to a lay readership. If the mean number of legs per person turns out to be a little less than 2, that can be thought through fairly easily. $\endgroup$
    – Nick Cox
    Jul 24, 2020 at 9:01
  • $\begingroup$ Closely related: stats.stackexchange.com/questions/615205/… $\endgroup$
    – mkt
    Jul 31, 2023 at 9:04

2 Answers 2


No, in this case, it does not make sense to draw error bars using SDs.

Take a step back. Why do we draw error bars with SDs? As you write, it's to show where "much" of the data lies. This makes sense if your data come from a normal distribution: 68% of your data will lie within $\pm 1$ SD from the mean, so showing the mean with an error bar of $\pm 1$ SD will give you an interval that contains 68% of your data.

However, the number of visits to a doctor is a count, so it is discrete. And it can't be negative. Thus, it can't be normal. For high counts, you can often treat counts as normal, but not for a mean of 3 and an SD of 5. Using SD-based error bars is the wrong way of answering the original question, i.e., showing where "much" of the data falls.

Better: calculate the top and bottom ends of your interval directly, by calculating (e.g.) the 16% and the 84% quantile of your observations. The range between them will again contain 68% of your data, as in the normal case the interval around the mean $\pm 1$ SD.

Alternatively, you can fit a distribution. For instance, a mean of 3 and an SD of 5 are consistent with a negative binomial distribution with a mean of 3 and a size parameter of $\frac{3^2}{5^2-3}$ (see R's help page ?qnbinom - there are many different parameterizations of the negbin). For such a distribution, we can again calculate the parametric 16%/84% quantiles, which turns out to give us an interval $[0,6]$:

> qnbinom(pnorm(c(-1,1)),mu=3,size=3^2/(5^2-3))
[1] 0 6
  • 4
    $\begingroup$ (+1) For graphics, I would try first a histogram, with some appreciation that a square root scale for frequency might be a good idea and that using a histogram at all might be a bad idea if the tail is really long. $\endgroup$
    – Nick Cox
    Jul 23, 2020 at 14:30
  • $\begingroup$ A histogram with unequal bin widths could still work with long tails. E.g. 10 bins for 0-9, a bin for 10-15 and a bin for 16+. Does the shape of the tail really matter? $\endgroup$
    – MSalters
    Jul 24, 2020 at 11:01

You are not looking for error bars but for boxplots, violin plots or any other histogram-like method that summarizes the data. An SD doesn’t graphically summarize the data. It summarizes their dispersion.

Unless you’re trying to predict something, this problem is a data description problem so it must be solved with data description tools, not with inference tools such as fitting a binomial distribution, etc.

If I draw the bar graph showing mean 3 and EBs based on 1 SD, the EBs will range from 0 to 8, can I still claim that ~68% of values fall within 0 to 8

It’s a wrong interpretation. $x\%$ of the data lie between the $p$-th and $(p+x)$-th percentiles, for any $p \in [0, 100-x]$. But the SD is simply the square root of the mean squared difference from the data mean, it doesn’t say where the data are.

In a boxplot, we choose $p$ such that $\frac{p + (p+x)}{2}$ equals the median, and $x=50$.

how can I interpret the 0 to 8 which truncates the negative?

You interpret it as $\max \{ 0, \mu - \sigma \}$ ($\mu$ the mean, $\sigma$ the SD). You can’t do better. $\mu - \sigma$ doesn’t translate to any interesting graphical interpretation unless the data follow a specific distribution such as the normal one (which is rarely—not to say never—the case).

  • 1
    $\begingroup$ The SD isn't the mean squared difference from the mean; that is the variance. $\endgroup$
    – Nick Cox
    Jul 31, 2023 at 9:15
  • 1
    $\begingroup$ Indeed sorry, that was a mistake from thinking too fast. I’ll edit this. $\endgroup$ Aug 1, 2023 at 11:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.