0% found this document useful (0 votes)
87 views3 pages

SAS Programming by Example (12) : Chapter 12 Proc Chart Charting Your Data

The document discusses examples of using PROC CHART in SAS to create different types of charts from data. It provides 13 examples demonstrating how to create vertical and horizontal bar charts, bar charts displaying percentages or sums and means, bar charts representing multiple variables on one axis, and three-dimensional block charts. The examples showcase different chart types, options like MIDPOINTS, SUBGROUP, and SUMVAR, and how to chart both categorical and continuous variables.

Uploaded by

mihirhota
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views3 pages

SAS Programming by Example (12) : Chapter 12 Proc Chart Charting Your Data

The document discusses examples of using PROC CHART in SAS to create different types of charts from data. It provides 13 examples demonstrating how to create vertical and horizontal bar charts, bar charts displaying percentages or sums and means, bar charts representing multiple variables on one axis, and three-dimensional block charts. The examples showcase different chart types, options like MIDPOINTS, SUBGROUP, and SUMVAR, and how to chart both categorical and continuous variables.

Uploaded by

mihirhota
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

SAS Programming by Example [12]

Chapter 12 PROC CHART Charting Your Data

Example 1 Creating a Vertical Bar Chart Features: PROC CHART, VBAR Statement . Create REGION vs Frequency . Data set SALES PO_NUM ITEM REGION PRICE QUANTITY 1456 HAMMER NORTH 10 5 ... PROC CHART DATA=SALES; TITLE "Vertical Bar Chart"; VBAR REGION; RUN; Example 2 Creating a Horizontal Bar Chart with Statistics Features: PROC CHART, HBAR Statement PROC CHART DATA=SALES; TITLE "Horizontal Bar Chart"; HBAR REGION; RUN; Example 3 Creating a Horizontal Bar Chart without Statistics Features: PROC CHART, HBAR Statement PROC CHART DATA=SALES; TITLE "Horizontal Bar Chart without Statistics"; HBAR REGION / NOSTAT; RUN; Example 4 Creating a Bar Chart That Display Percentages Features: PROC CHART, VBAR Statement, TYPE= and PERCENT Options PROC CHART DATA=SALES; TITLE "Vertical Bar Chart Showing Percents"; VBAR REGION / TYPE=PERCENT; RUN;

Example 5 Creating a Bar Chart for a Continuous Variable (System-Chosen Midpoints) Features: PROC CHART, VBAR Statement PROC CHART DATA=SALES; TITLE "Vertical Bar Chart for a Continuous Variable"; VBAR PRICE; RUN; Example 6 Creating a Bar Chart for a Continuous Variable (User-Chosen Midpoints by Range) Features: PROC CHART, VBAR Statement, MIDPOINTS=Option PROC CHART DATA=SALES; TITLE "Vertical Bar Chart Demonstrating MIDPOINTS Option"; VBAR PRICE / MIDPOINTS=8 to 20 by 4; RUN; Example 7 Creating a Bar Chart for a Continuous Variable (without DISCRETE Option) Features: PROC CHART, VBAR Statement PROC CHART DATA=OSCAR; TITLE "Vertical Chart without DISCRETE Option"; VBAR DAY; RUN; Example 8 Creating a Bar Chart for a Continuous Variable (with DISCRETE Option) Features: PROC CHART, VBAR Statement, DISCRETE Option PROC CHART DATA=OSCAR; TITLE "Vertical Chart with DISCRETE Option"; VBAR DAY / DISCRETE; RUN; Example 9 Plotting Sums and Means of Numeric Variables Features: PROC CHART, VBAR STATEMENT, SUMVAR= and TYPE= Options PROC CHART DATA=SALES; TITLE "Adding Options SUMVAR= and TYPE="; VBAR REGION / SUMVAR=QUANTITY TYPE=SUM; RUN;

Example 10 Representing Two Variables on One Axis Features: PROC CHART, VBAR Statement, GROUP= Option PROC CHART DATA=SALES; TITLE "Vertical Bar Chart with GROUP= Option"; VBAR ITEM / GROUP=REGION; RUN; Example 11 Displaying Groups within a Bar -- Character Variable Features: PROC CHART, VBAR Statement, SUBGROUP= Option PROC CHART DATA=SALES; TITLE "Vertical Bar Chart with SUBGROUP= Option"; VBAR REGION / SUBGROUP=ITEM; RUN; Example 12 Displaying Groups within a Bar -- Numeric Variable Features: PROC CHART, VBAR Statement, SUBGROUP= Option PROC CHART DATA=SALES; TITLE "Another Vertical Bar Chart with SUBGROUP= Option"; VBAR REGION / SUBGROUP=PRICE; RUN; Example 13 Creating Three-Dimensional Block Charts Features: PROC CHART, BLOCK statement DATA BLOCKEG; SET CLINICAL (KEEP=DATE ROUTINE SBP); YEAR=YEAR(DATE); RUN; PROC CHART DATA=BLOCKEG; TITLE "Example of a BLOCK CHART"; BLOCK YEAR / GROUP=ROUTINE DISCRETE; BLOCK YEAR / GROUP=ROUTINE SUMVAR=SBP TYPE=MEAN DISCRETE; FORMAT SBP 5; RUN;

You might also like