StatLabStudent EditionUser guideGalleryFeaturesAbout

Bar charts (simple, clustered, stacked) with error bars

Shows counts, percentages or a summary (mean, median, sum) of a variable for each category, optionally split by a second category into clustered or stacked bars, with confidence-interval, standard-error or standard-deviation error bars for means.

Menu: Graphs → More charts → Bar chart (clustered / stacked, error bars)…

When should I use it?

What are the assumptions?

How do I run it in StatLab?

  1. Put the category variable on the category axis.
  2. Optionally choose a variable to summarize (else bars show counts).
  3. Optionally add a cluster/stack variable and pick clustered or stacked.
  4. Choose error bars for means.

How do I read the output?

OutputMeaning
BarsOne bar per category (and cluster); hover for the exact value and n.
Error barsThe interval named in the footnote, e.g. 95% CI of the mean.

Worked example

On the practice survey dataset (File → Sample dataset), this command — which the dialog's Paste button also produces — runs the procedure:

PROC vizBar /x=group /y='' /color='' /stat=auto /mode=clustered /errorBars=ci /dataLabels=NO.

Computed by StatLab's validated procedure code when this page was built. The example only illustrates the steps; choose variables that fit your own research question.

What are common mistakes?

Open StatLab   All guide topics