Creating a Bar Chart for a Continuous Variable (with DISCRETE Option) - SAS Programming

To tell the program to treat the X axis values as unique categories,you use the DISCRETE option of VBAR or HBAR statements (you should always try to be discrete when dealing with meaningful data.) To correct the previous bar chart,you modify the program as follows:

Example

PROC CHART DATA=OSCAR;
TITLE 'Vertical Chart with DISCRETE Option';
VBAR DAY / DISCRETE;
RUN;

Notice in the following output, that the actual DAY values 1 through 7 are used on the X axis, instead of using system-calculated range midpoints.

Output from Example - Creating a Bar Chart for a Continuous Variable (with DISCRETE Option)

Output from Example - Creating a Bar Chart for a Continuous Variable (with DISCRETE Option)


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

SAS Programming Topics