Creating a half error bar using Graph Template Language

Many statistical ODS graphics in SAS® 9.2 are generated by the Graph Template Language (GTL) using the predefined graph templates in the SAS® 9.2. With GTL, we can also create our own graph template. The half error bar (mean ± standard error) is a popular plot in displaying statistics. However, the major problems in creating a standalone half bar are to dynamically change the direction of the half bar to avoid overlay, display the number of subjects over time at the bottom of the plot, and minimize user inputs. In this paper, we show how to use GTL to create a standalone half error bar plot. We created a macro called Halfbar(). The user provides the Halfbar() macro with the data set name, group, x, y, and graph parameters such as axis labels and ticks, etc. The macro will output a nice-looking half bar plot. We also show if you specify a customized ODS style such as the journal style and call the macro, you can easily generate a high-quality plot for publication.