= 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 || ||||||||||||<20% style="VERTICAL-ALIGN: top; TEXT-ALIGN: center"> '''Group''' ||'''Young''' ||'''Old''' || '''Young''' || '''Old''' || ||||||||||||<20% style="VERTICAL-ALIGN: top; TEXT-ALIGN: center"> '''Control''' || 12 ||21 || 2 || 1 || ||||||||||||<20% style="VERTICAL-ALIGN: top; TEXT-ALIGN: center"> '''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. 1. Click on the chart wizard icon (identified by a graph of coloured bars) or choose CHART on the INSERT toolbar. 1. Under '''CHART TYPE''' choose '''LINE''' and choose '''LINE WITH MARKERS DISPLAYED AT EACH DATA POINT''' under '''CHART SUB-TYPE'''. Click '''SERIES''' tab. 1. 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. 1. Click '''ADD'''. ''Control'' should appear in the series window. 1. 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. 1. 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. 1. Doubleclick on one of the data points (means) and we can proceed as with the bar chart. 1. Click on the tab called '''Y ERROR BARS''' in the resultant '''FORMAT DATA SERIES''' Window. 1. Click on the display named '''BOTH''' and choose '''CUSTOM'''. 1. 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. 1. 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. 1. 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 [[FAQ/linebar07| here.]] This gives the following [[attachment:errbars.xlsx|graph.]]