# Can confidence interval of positive values be negative?

Can confidence interval of positive values be negative if I use sample mean +- sample standard deviation?

If I need a log-log plot (with confidence interval), what should I do in this case?

• Yes, your procedure can produce neg end, but it only means that it's not appropriate for your case – Aksakal Jul 18 '18 at 19:45

The first question has a simple answer: yes.

I interpret your question to mean, "can a strictly positive sample (where all data points are positive) have a 68% confidence interval for the normal distribution with a negative lower bound?"

Proof by construction: Let $X = [1, 1, 7]^T$. The mean is $3$, the sample standard deviation is $3.46$, so the 68% confidence interval is $(-0.464, 6.46)$. $\square$

One consequence of a confidence interval that includes zero is that we are unable to reject the hypothesis that the true population has a normal distribution with mean zero.

Confidence intervals are defined relative to a particular distribution. Defining a confidence interval as mean +/- sample standard deviation implicitly assumes a normal, or at least symmetric, distribution. If we choose a distribution that itself is non-negative, say $\chi^2$ or Poisson, then the confidence interval will never go below zero. It will, however, be asymmetric.

Plotting the confidence interval on a log-log plot is less clear cut. I can see how the problem arises: a log-log plot is completely appropriate for strictly positive data, but there's not one obvious way to plot the confidence interval. Here are some options, it roughly increasing order of difficulty:

1. The simplest approach is simply to extend it to negative infinity - in other-words, just extend it to the bottom of your chart and cut it off.
2. If you use a boxplot for the CI, the "box" is drawn between the Q1 and Q3 quartiles and therefore the "box" part will always be strictly contained in the range of the original data, while only the "whisker" part will extend down past the bottom of the chart.
3. A slightly more sophisticated version of the boxplot is the violin plot. The violin shape will go off the bottom of the chart but it will be visually clear how much is getting cut off.
4. If you calculate your confidence interval after the log transform you may get a CI that is more meaningful for your data and stays on the plot.
5. If you fit a different distribution, say Poisson for count data, then you can calculate the CI from that, and the CI will not go below zero because the fitted distribution itself cannot.
• If I need a log-log plot (with confidence interval), what should I do in this case? – ZHU Jul 18 '18 at 20:30