Plot 在SAS中绘制一维点图

Plot 在SAS中绘制一维点图,plot,graph,sas,Plot,Graph,Sas,你好,我想画一些接近这个的东西,但是 我似乎不明白 我有数据 data table2_1; 输入修改的\u砂浆未修改的\u砂浆; 卡; 16.85 16.62 16.40 16.75 17.21 17.37 16.35 17.12 16.52 16.98 17.04 16.87 16.96 17.34 17.15 17.02 16.59 17.08 16.57 17.27 ; 跑 我试过了 proc freq data=表2\u 1; 表格修改/绘图=频率绘图(类型=点绘图); 未修改的表格

你好,我想画一些接近这个的东西,但是 我似乎不明白

我有数据

data table2_1;
输入修改的\u砂浆未修改的\u砂浆;
卡;
16.85 16.62
16.40 16.75
17.21 17.37
16.35 17.12
16.52 16.98
17.04 16.87
16.96 17.34
17.15 17.02
16.59 17.08
16.57 17.27
;
跑

我试过了

proc freq data=表2\u 1;
表格修改/绘图=频率绘图(类型=点绘图);
未修改的表格/绘图=频率绘图(类型=点绘图);
运行


但是它给了我一个不必要的巨大绘图,它的间距相等,无法按照我的意图比较这两个分布。

我用
sgplot
玩了一会儿,这是我能想到的最接近的。这并不精确,但只要在图像编辑器中稍加修改,你几乎可以得到它


这里有一种在治疗中使用数据的不同方法:反应分类形式。标记的三角形标记用于显示平均值(三角形顶点为平衡点)


这是一个非常好的答案。再仔细考虑一下,也许一个方框图会提供更多的统计信息,并有更广泛的可视化选项。同意。这也是我想到的第一件事。从分布的角度来看,我也会这样做。
data table2_1;
input Modified_Mortar Unmodifided_Mortar;
retain mod_line 0.75 unmod_line 0;
cards;
16.85 16.62
16.40 16.75
17.21 17.37
16.35 17.12
16.52 16.98
17.04 16.87
16.96 17.34
17.15 17.02
16.59 17.08
16.57 17.27
;
run;

proc sgplot data=table2_1;
    label Modified_Mortar = 'Strength (kgf/cm squared)';

    scatter x = Modified_Mortar    y=mod_line   / markerattrs=(symbol=circlefilled color=black size=10);
    scatter x = Unmodifided_Mortar y=unmod_line / markerattrs=(symbol=circlefilled color=bib size=10);

    refline -0.25 / axis=y lineattrs=(color=bib thickness=2) name='mod' legendlabel='Unmodified' ;
    refline 0.5 / axis=y lineattrs=(color=black thickness=2) name='unmod' legendlabel='Modified';

    yaxis display=(nolabel) min=-0.25 max=15;
    xaxis values=(16.24 to 17.50 by 0.14) min=16.30 max=17.40 valueattrs=(size=12) labelattrs=(size=12);

    keylegend 'mod' 'unmod' / location=outside position=bottom valueattrs=(size=12);
run;
data have;
  treatment = 'Modified  '; y=1.13; input response @; output;
  treatment = 'Unmodified'; y=0.13; input response;   output;

  attrib
    response label = "Strength (kgf/cm2)"
  ;

cards;
16.85 16.62
16.40 16.75
17.21 17.37
16.35 17.12
16.52 16.98
17.04 16.87
16.96 17.34
17.15 17.02
16.59 17.08
16.57 17.27
;
run;

proc sql;
  create table plot as 
  select * from have
  outer union corresponding
  select 
    treatment,
    case treatment
      when ('Unmodified') then -0.15
      when ('Modified  ') then  0.85
      else 0
    end as y2,
    mean(response) as mean format=5.2
  from have
  group by treatment;
quit;


ods proclabel "Concrete dot plot";

ods graphics / height=220px width=800px;

proc sgplot data=plot description="Response to treatment";
  title "Concrete strength response to treatment";

  scatter 
    x=response y=y
    / markerattrs=(symbol=circlefilled color=black size=12px)      
  ;

  scatter 
    x=mean y=y2
    / datalabel=mean
      datalabelpos=bottom
      markerattrs=(symbol=triangle color=black size=12px)
  ;

  keylegend
    / exclude = ("y" "y2")
  ;

  yaxis 
    offsetmin = 0.2
    values = ( 0 1 2 )
    valuesdisplay = ( "Unmodified" "Modified" " " )
    display = ( noticks nolabel )
    colorbands = odd 
  ;

  xaxis 
    grid 
  ;

  refline  0.00 ;
  refline  1.00 ;

run;

title;
footnote;