Omley
Omley

Reputation: 446

What is the default confidence interval used to draw error bars in a Seaborn barplot?

Seaborn's barplot shows error bars or caps to "provide some indication of the uncertainty around that estimate." By default, what confidence interval is used to draw those error bars?

Upvotes: 4

Views: 4031

Answers (1)

ndmeiri
ndmeiri

Reputation: 5029

From seaborn v0.12.0 the parameter is now errorbar.

See Statistical estimation and error bars.

errorbar : string, (string, number) tuple, callable or None Name of errorbar method (either 'ci', 'pi', 'se', or 'sd'), or a tuple with a method name and a level parameter, or a function that maps from a vector to a (min, max) interval, or None to hide errorbar.

The default is errorbar=('ci', 95)


According to the documentation for version 0.8.1, the default value for the ci parameter of seaboard.barplot is 95. So, by default, a Seaborn barplot is drawn with 95% confidence intervals.

The documentation given in the link above also states the accepted values for the ci parameter:

ci : float or "sd" or None, optional

Size of confidence intervals to draw around estimated values. If "sd", skip bootstrapping and draw the standard deviation of the observations. If None, no bootstrapping will be performed, and error bars will not be drawn.


For the sake of completeness, here is the signature of the seaboard.barplot function according to the documentation linked at the top of this answer. ci is the parameter of interest.

seaborn.barplot(
  x=None,
  y=None,
  hue=None,
  data=None,
  order=None,
  hue_order=None,
  estimator=<function mean>,
  ci=95,
  n_boot=1000,
  units=None,
  orient=None,
  color=None,
  palette=None,
  saturation=0.75,
  errcolor='.26',
  errwidth=None,
  capsize=None,
  dodge=True,
  ax=None,
  **kwargs
)

Upvotes: 6

Related Questions