The PLOT Procedure

# Example 8: Plotting BY Groups

Procedure features:

PLOT statement option

 HREF=
Other features:
 BY statement

This example shows BY-group processing in PROC PLOT.

 `options nodate pageno=1 linesize=80 pagesize=35;`
 ```data education; input State \$14. +1 Code \$ DropoutRate Expenditures MathScore Region \$; label dropout='Dropout Percentage - 1989' expend='Expenditure Per Pupil - 1989' math='8th Grade Math Exam - 1990'; datalines; Alabama AL 22.3 3197 252 SE Alaska AK 35.8 7716 . W ...more data lines... New York NY 35.0 . 261 NE North Carolina NC 31.2 3874 250 SE North Dakota ND 12.1 3952 281 MW Ohio OH 24.4 4649 264 MW ;```
 ```proc sort data=education; by region; run;```
 ```proc plot data=education; by region;```
 ` plot expenditures*dropoutrate='*' / href=28.6;`
 ``` title 'Plot of Dropout Rate and Expenditure Per Pupil'; run;```

 ``` Plot of Dropout Rate and Expenditure Per Pupil 1 ---------------------------------- Region=MW ----------------------------------- Plot of Expenditures*DropoutRate. Symbol used is '*'. Expenditures | | 5500 + | | | | | | | | | * 5000 + | | * | | * | | | | * | 4500 + | | * * | | ** * | | | | | 4000 + * | | | | | | | | | 3500 + | | | ---+------------+------------+------------+------------+-- 10 15 20 25 30 Dropout Percentage - 1989 `````` Plot of Dropout Rate and Expenditure Per Pupil 2 ---------------------------------- Region=NE ----------------------------------- Plot of Expenditures*DropoutRate. Symbol used is '*'. Expenditures | | 8000 + | | | | * | | | | | 7000 + | | * | | | | | | | 6000 + *| | * | | | | * | | 5000 + | | * * | | | | | | | 4000 + | | | ---+------------+------------+------------+------------+-- 15 20 25 30 35 Dropout Percentage - 1989 NOTE: 1 obs had missing values.```

 Previous Page | Next Page | Top of Page