基于分组语句,各省份的散点图都能够独立显示了。例如,SAS语句分组绘制的代码如下
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;


雷达卡

京公网安备 11010802022788号







