SAS forest

 

displaysecondary = (ticks) 副坐标轴显示哪些元素

linearopts = (thresholdmax = 1) 就是在坐标轴的末尾,再把坐标轴延长多少。

 

type = log

logopts = (

base = 2 坐标轴的刻度以基于 底数为2的对数,而不是根据数据刻画坐标轴刻度。

tickintervalstyle  = 以何种方式显示刻度值

      这几个选项比较重要,可以 以相同的刻度间隔合理表示大|小数据

)

 

SAS forest

 

 

/*--Fig_5_5_3 Most Frequend AE--*/
data GTL_GS_AE;
  input ae $1-30 a b low mean high;
  label a='Percent';
  label b='Percent';
  datalines;
ARTHRALGIA                    1   3    1    7     48
NAUSIA                        4   18   2    4     8  
ANOREXIA                      2   3    0.9  3.8   16
HEMATURIA                     2   4    0.8  3.2   15
INSOMNIA                      3   5.5  1.1  3.0   7
VOMITING                      3.5 6    1.2  2.5   6
DYSPEPSIA                     4   10   1.1  2.4   4.5
HEADACHE                      7   10   0.8  1.1   2
BACK PAIN                     5   6    0.8  1.04  2
COUGHING                      8   8    0.5  1.0   2
MYALGEA                       4   4    0.4  1.0   1.9
MELENA                        4.5 4    0.4  0.9   2.2
RHINITIS                      7   6    0.4  0.9   1.9
BRONCHITIS                    5   3.5  0.3  0.7   2
CHEST PAIN                    6   4    0.3  0.8   1.8
DYSPNEA                       7   2.5  0.13 0.3   0.7
;
run;

proc sort data=GTL_GS_AE out=GTL_GS_AE;
  by mean;
  run;

data GTL_GS_AE_Ref;
  set GTL_GS_AE;
  if mod(_n_, 2) ne 0 then refae=ae;
run;

      

ods html;

proc template;
define statgraph _datalattice;
    begingraph / designwidth = 8in designheight = 4in;
        layout lattice / columns = 2 rowdatarange = union;
            rowaxes;
                rowaxis / display = (ticks tickvalues line)
                          tickvalueattrs = (size = 7);
            endrowaxes;

            layout overlay / xaxisopts = (displaysecondary = (ticks)
                            tickvalueattrs = (size = 7) linearopts = (thresholdmax = 1));
                referenceline y = refae / lineattrs = (thickness = 14) datatransparency = 0.8;
                scatterplot x = a y = ae / name = "a" legendlabel = "Drug A" 
                                            markerattrs = graphdata1(symbol = circlefilled size = 10);
                scatterplot x = b y = ae / name = "b" legendlabel = "Drug B" 
                                            markerattrs = graphdata1(symbol = trianglefilled size = 5);
                discretelegend "a" "b" / border = false valueattrs = (size = 5);
            endlayout;

            layout overlay / xaxisopts = (label = "Relative Risk with 95% CL" displaysecondary = (ticks)
                                            tickvalueattrs = (size = 7) type = log logopts = (base = 2 viewmin = 0.125 viewmax = 64
                                            tickintervalstyle = logexpand));
                referenceline y = refae / lineattrs = (thickness = 16) datatransparency = 0.8;
                scatterplot x = mean  y = ae / xerrorlower = low xerrorupper = high markerattrs = (symbol = circlefilled size = 10);
                referenceline x = 1 / lineattrs = graphdatadefault(pattern = shortdash); 
            endlayout;
        endlayout;
    endgraph;
end;
run;

proc sgrender data = GTL_GS_AE_Ref(obs = 10) template = _datalattice;
run;

 

上一篇:.Net中模拟上传文件动态显示进度的事件示例


下一篇:基于Forest实践|如何更优雅的统一处理请求签名