The SGPANEL procedure 过程的使用

SGPANEL过程为一个或多个分类变量的值创建一组图形单元格。 例如,如果数据集包含三个变量(A,B和C),并且您想要比较每个A值的B * C的散点图,则可以使用SGPANEL创建此面板。 SGPANEL过程自动创建一个布局,如有必要,将面板拆分成多个图形。

SGPANEL程序可以创建各种绘图类型,并在面板中的每个图形单元格中叠加多个绘图。 它也可以生成几种类型的布局。 可由SGPANEL过程生成的面板示例包含SGPANEL过程可以创建的面板示例。

proc sgpanel  案例1

 代码:

/*The following code creates a panel of loess curves:*/

title1 "Cholesterol Levels for Age > 60";
proc sgpanel data=sashelp.heart(
    where=(AgeAtStart > 60)) ;
  panelby sex / novarname;
  loess x=weight y=cholesterol / clm;
run;

     title1 "Cholesterol Levels for Age > 60";
      proc sgpanel data=sashelp.heart(where=(AgeAtStart > 60)) ;
      panelby sex / novarname;
       loess x=weight y=cholesterol / clm;
       run;

[loess curves]
/*以下代码创建一个垂直条形图面板:*/
  title1 "Product Sales";
   proc sgpanel data=sashelp.prdsale;
      panelby quarter;
     rowaxis label="Sales";
     vbar product / response=predict stat=mean
                 transparency=0.3;
    vbar product / response=actual stat=mean
                 barwidth=0.5 transparency=0.3;
    run; 
[vertical bar charts]
以下代码创建一个具有直方图和正常密度曲线的单元格面板:
Title1 "Weight Distribution in the Heart Study";
proc sgpanel data=sashelp.heart noautolegend;
  panelby sex / novarname;
  histogram weight;
  density weight;
run;
[histogram and density plots]

/*以下代码在格子布局中创建一个框图:*/
title1 "Distribution of Cholesterol Levels";
proc sgpanel data=sashelp.heart;
  panelby weight_status sex / layout=lattice
                              novarname;
  hbox cholesterol;
run; 
[box plots]

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值