FAQ/linebar - CBU statistics Wiki
location: FAQ / linebar

Adding error bars to line plots of means in EXCEL

Let us assume we have the following input for age (young, old) and clinical group (control, patient) with means and width of confidence interval half width equal to upper limit - mean. Confidence intervals can be obtained e.g. using ANALYZE:DESCRIPTIVE STATISTICS:EXPLORE in SPSS.

Means

CI half width

Group

Young

Old

Young

Old

Control

12

21

2

1

Patient

9

15

3

2

  1. Enter the values of the variable to be plotted in one row or column and the confidence interval half-width pertaining to each variable column in another row or column.
  2. Click on the chart wizard icon (identified by a graph of coloured bars) or choose CHART on the INSERT toolbar.
  3. Under CHART TYPE choose LINE and choose LINE WITH MARKERS DISPLAYED AT EACH DATA POINT under CHART SUB-TYPE. Click SERIES tab.

  4. Delete the contents of the rectangular slot next to 'Name' and type in it Control. Delete the contents of the rectangular slot next to 'Values' and, keeping the cursor in this slot, highlight the two cells in the controls corresponding to the two age means ie 12 and 21.
  5. Click ADD. Control should appear in the series window.

  6. Repeat for Patient deleting the content of the slot next to Name and inserting Patient and deleting the contents of the slot next to Value and then highlighting the two patient means, 9 and 15. Control and Patient should now both be in the series window.

  7. In Category (X) axis labels slot (obtained clicking on the series tab) put ={"Young","Old"}. Make other amendments such as axis titles and Graph title and click on FINISH. The graph should appear in the spreadsheet.

  8. Doubleclick on one of the data points (means) and we can proceed as with the bar chart.
  9. Click on the tab called Y ERROR BARS in the resultant FORMAT DATA SERIES Window.

  10. Click on the display named BOTH and choose CUSTOM.

  11. Highlight the standard error row in the spreadsheet. The co-ordinates of the standard error row should appear in the '+' box in the CUSTOM section.

  12. Click on the window adjacent to '-' and highlight the standard error row. The co-ordinates of the standard error row should appear in the '-' box.

  13. Click OK. You should now have a line graph with error bars. Doubleclicking on the error bars and clicking the PATTERNS tab in the FORMAT ERROR BARS window allows the user to change the style, colour or thickness of the lines forming the error bars.

A slightly different approach is needed if using EXCEL 2007 - see here.

This gives the following graph.

None: FAQ/linebar (last edited 2014-03-28 14:12:27 by RussellThompson)