AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Add tag to xline stata9/10/2023 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
Read More
Leave a Reply. |