SAS boxplot

 XAXISOPTS = (TYPE = time timeopts = (interval = month))

 指定使用坐标轴的类型,指定坐标轴的间隔

ods html;

proc template;
define statgraph _boxplot;
    begingraph;
        layout overlay / xaxisopts = (display = (ticks tickvalues)) yaxisopts = (griddisplay = on);
            boxplot  y = cholesterol x= deathcause / orient = horizontal; 
        endlayout;
    endgraph;
end;
run;

proc sgrender data = sashelp.heart template = _boxplot;
run;

 

data GTL_GS_IntervalBoxGroup;
  format Date date6.;
  drop i;
  do Date='01Jan2009'd, '15Jan2009'd,'15Mar2009'd,
          '01May2009'd, '01Aug2009'd; 
    do i=1 to 10;
      Response=rannorm(2); Drug='A'; output;
      Response=ranuni(2);  Drug='A'; output;
      Response=rannorm(2); Drug='B'; output;
      Response=ranuni(2);  Drug='B'; output;
    end;
  end;
run;

ods html;

proc template;
define statgraph _boxplot;
    begingraph;
        layout overlay / xaxisopts = (type = time timeopts = (interval = month) display = (ticks tickvalues)) yaxisopts = (griddisplay = on);
            boxplot  y = response x= date / group = drug groupdisplay = cluster name = "a";
            discretelegend 'a' / location = inside across = 2 halign = right valign = bottom title = "Treatment: ";  
        endlayout;
    endgraph;
end;
run;

proc sgrender data = GTL_GS_IntervalBoxGroup template = _boxplot;
run;

 

posted @ 2021-10-05 15:50  Iving  阅读(176)  评论(0编辑  收藏  举报