There seem to be a lot of different confidence interval variations for proportions (e.g. Wald, Wilson, Agresti-Coull, Jeffreys). I can't seem to find any variations for means though. What options are available?

The reason is, I have an issue where the mean is close to zero and the sample size is low. The confidence interval then goes below zero, which is impossible for this sort of data. Something like the Wilson interval for proportions (which doesn't go below zero), but for means would be useful.

I have added an extreme (made up) case as an example (using R). This would only the be case if I was using a grouping variables where some of the groups had small sample sizes. In this case, the lower bound of group 1 is below zero and the upper bound is above 100, even though scores can only be between 0 and 100.


df <- tibble(score = c(25, 100, 0, 25, 25, 0, 0, 100, 0, 100, 100,  
                       75, 0, 100),
             counts = 1,
             groups = c(rep(c(1,2), 7))) %>%  
             mutate(groups = factor(groups))

df %>% 
  group_by(groups) %>% 
  summarise(mean = mean(score), var = var(score), sd = sqrt(var),
            count = sum(counts), se = sd/sqrt(count)) %>%  
  mutate(lower = mean - (se*1.96), upper = mean + (se*1.96)) 
# A tibble: 2 x 8
  groups  mean   var    sd count    se lower upper
  <fct>  <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1       21.4 1339.  36.6     7  13.8 -5.68  48.5
2 2       71.4 1756.  41.9     7  15.8 40.4  102. 
  • 3
    $\begingroup$ Bootstrap would give you a confidence interval with a lower endpoint $>0$. $\endgroup$
    – Dave
    Commented Jul 27, 2020 at 2:17
  • $\begingroup$ Yes, good point. $\endgroup$ Commented Jul 27, 2020 at 2:27
  • $\begingroup$ Also, as long as you have half a dozen observations, a nonparametric CI for a Wilcoxon signed rank test should give you a CI for the median that has positive end points. // If observations can be near 0 but not negative, the population not likely normal. If exponential, then natural chi-sq based CI will have positive lower endpoint // Can you provide context, preferably with example, where this arises? Bootstrap is good idea, but, if available, a distribution-specific CI might be better than a bootstrap CI. $\endgroup$
    – BruceET
    Commented Jul 27, 2020 at 2:38
  • 1
    $\begingroup$ The OP is about confidence intervals about the true mean, thus confidence intervals for the pseudo-median would not be valid. $\endgroup$
    – Michael M
    Commented Jul 27, 2020 at 7:12
  • 1
    $\begingroup$ What about a log-link glm? $\endgroup$ Commented Jul 27, 2020 at 18:06


Your Answer

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