OK, I promise this is the last article on Forest Plots (at least for a while).
In the previous article on Subgrouped Forest Plot with Font Attributes, I discussed how to use bold text for subgroup headings. I mentioned that increasing the font size would not work as it would misalign the subgroup values from the headings.
Clearly, the result shown in the link above is less than ideal, and I have not yet been able to come up with a better way to do this using SAS 9.2. If you have a better solution, I am sure we all would be very interested to hear of it.
But with SAS 9.3, we can do better because we can use the new HighLowPlot statement. This statement supports a LowLabel and/or HighLabel. In this case, the label is drawn starting from the appropriate end of the plot line. So, all the contortions needed for the MarkerCharacter solution with SAS 9.2 above can be avoided.
Forest Plot using SAS 9.3 HighLowPlot. Here is the graph. Click on it for a bigger view:
Note the following improvements in this graph:
- The subgroup heading and values use the same font family as the rest of the columns. It is not necessary to use a non-proportional font.
- The subgroup headings use a bigger font size and bold weight.
- The subgroup values are indented.
- The error bars do not have serifs.
In this graph, we have used the HighLowPlot to draw the subgroup headings and values. The actual drawing of the high low line itself is hidden by using line thickness of zero. The other text strings are still drawn using ScatterPlot (with MarkerCharacter), but that too can be changed to HighLowPlot if we need left or right aligned strings. The error bars for the Hazard Ratio are also drawn using the HighLowPlot.
With SAS9.3, the ScatterPlot itself also has a new option to draw DataLabels with DataLabelPosition of LEFT | RIGHT, etc. So, we could have used that for these labels. But there are some interesting interactions with axis offsets that need to be considered. So, at this time, HighLowPlot is preferred.
GTL code snippet for the subgroup labels:
highlowplot y=obsid low=zero high=zero / highlabel=heading lineattrs=(thickness=0) labelattrs=(size=7 weight=bold); highlowplot y=obsid low=zero high=one / highlabel=subgroup lineattrs=(thickness=0);
Forest Plot without horizontal bands:
Full SAS 9.3 Code: ForestPlot_93