We could not leave this chapter without showing you a block chart or two. When one of the authors (RP) was designing "PROC NYASUG;", the newsletter of the New York Area SAS Users Group, he relied on the talents of another founding member, Akos Felsovalyi,to create the group logo as a PROC CHART block chart constructed to be reminiscent of a three dimensional New York City skyline.For the current example you use the CLINICAL database. Suppose you want to see the relationship between the type of visit (ROUTINE = Y or N) and the year in which the data were collected. You could always use PROC FREQ to generate a two-way table, but we all know how many PROC FREQs a picture is worth. And while you're at it, why not also create a block chart showing the mean SBP for each YEAR and value of ROUTINE. Before you create the block chart, you need to create the YEAR variable.This code, along with the PROC CHART statements, is shown next:
The first BLOCK statement 0 places YEAR on the horizontal axis, ROUTINE on the depth axis (into the page),and the number of visits for the given year and value of ROUTINE on the vertical axis.The DISCRETE option is necessary here since you want the actual YEAR values on the horizontal axis.The block chart produced by the first BLOCK statement is shown next:
Output from Example - Creating Three-Dimensional Block Charts - First BLOCK Statement
The second BLOCK statement 2 uses the SUMVAR= and TYPE=MEAN options to give the mean SBP for each combination of YEAR and ROUTINE.You also provide a zero-decimal format for SBP so that you don't have long decimal values in the boxes.This chart is shown next:
Output from Example - Creating Three-Dimensional Block Charts - Second BLOCK Statement
To be honest, we should point out that there are many cases where block charts just don't work. If there are too many levels of the variables on the horizontal or vertical axis, the procedure will not be able to fit the block chart on the page (even with large LINESIZE= and PAGESIZE= options),and you will get an HBAR chart instead.As a matter of fact, we had to try several variables and data sets to find a block chart that we could use here as a demonstration.
PROC CHART can also produce pie and star charts, but we chose not to show examples of them here. For these types of charts, as well as for more refined looking charts of all kinds, we recommend the GCHART procedure which is part of SAS/GRAPH. PROC GCHART can output to true graphics devices unlike PROC CHART, which is designed to produce line-printer style charts.
SAS Programming Related Tutorials
|SASS (Syntactically Awesome Style sheets) Tutorial||R Programming language Tutorial|
SAS Programming Related Interview Questions
|Logistics Interview Questions||SAS Programming,SQL server Interview Questions|
|Clinical SAS Interview Questions||SASS (Syntactically Awesome Style sheets) Interview Questions|
|SQL Server Analysis Services (SSAS) Interview Questions||R Programming language Interview Questions|
|SAS DI Interview Questions||Advanced SAS Interview Questions|
|Base Sas Interview Questions||SAS Macro Interview Questions|
|Clinical Data Management Interview Questions|
Sas Programming Tutorial
Input And Infile
Set, Merge, And Update
Table Lookup Tools
Proc Means And Proc Uimivariate
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.