楼主: orderwsad
19963 11

[其他] 如何绘制面板数据散点图 [推广有奖]

11
数据分析师3K 发表于 2012-7-5 11:36:32
基于分组语句,各省份的散点图都能够独立显示了。例如,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;


已有 1 人评分经验 学术水平 热心指数 信用等级 收起 理由
orderwsad + 20 + 1 + 1 + 1 热心帮助其他会员

总评分: 经验 + 20  学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

12
orderwsad 在职认证  发表于 2012-7-5 12:04:28
数据分析师3K 发表于 2012-7-5 11:36
基于分组语句,各省份的散点图都能够独立显示了。例如,SAS语句分组绘制的代码如下
options nodate pageno ...
非常感谢!!

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-30 20:09