![]() ![]() Another application is simply drawing a line that separates one set of categories from another. One application that I can think of is displaying an expected value for a discrete probability distribution. You can also display reference lines on a discrete axis, although it is not common. Refline 120 130 / axis=y label= ( 'Elevated' 'Hypertensive' ) lineattrs=GraphData2 Refline 200 240 / axis= x label= ( 'Borderline' 'High' ) lineattrs=GraphData2 Heatmap x=Cholesterol y=Systolic / colormodel= (CXDEEBF7 CX9ECAE1 CX3182BD ) Title "Clinical Ranges of Systolic Blood Pressure and Cholesterol" The following example adds labels to the previous example. LABELPOS= option to specify whether the label is displayed at the top or bottom (for a vertical reference line) orĪt the left or right (for a horizontal reference line). I like "outside" (the default) because then the line does not interfere with the label. ![]() LABELLOC= option to put the label inside or outside the data area of the graph. You can use the LABEL= option to specify one or more labels. If you might want to add a label to the reference lines, In this example, I used the optional LINEATTRS= option to show how to change the color, line pattern, and thickness of the reference lines. Put REFLINE stmt first if you want it behind the bars */ run Refline 200 240 / axis= x lineattrs= (thickness= 3 color=darkred pattern=dash ) Set sashelp.Heart ( where= (Cholesterol< 400 ) ) You can use reference lines to indicate good, borderline, and high cholesterol. The following histogram shows the distribution of cholesterol values for 5,195 subjects. The Sashelp.Heart data set contains cholesterol and blood pressure information for patients in a heart study. A cholesterol level that is 240 or more is considered high. A "borderline" (or moderately elevated) cholesterol level is between 200 and 240 mg/dL. The reference lines are perpendicular to the axis.Ī simple use of a reference line is to indicate a reference value on a histogram.įor example, a healthy total cholesterol level is less than 200 mg/dL. You then use the AXIS=X or AXIS=Y option to specify which axis the reference lines are for. You can specify one or more values (separated by spaces) or you can specify a variable in the data set that contains the values at which to display the reference lines. The REFLINE statement in PROC SGPLOT is easy to use. Use reference lines for a categorical variable on a discrete axis.Display a reference line at a value such as a mean or median.This article provides multiple "Getting Started" examples that show how to use the REFLINE statement This article discusses the REFLINE statement in PROC SGPLOT in SAS. Sometimes you can let the data "speak for themselves" in an unadorned graphic, but sometimes it is helpful to add reference lines to a graph to emphasize key features of the data. A purpose of data visualization is to convey that story to the reader in a clear and impactful way. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |