全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1659 8
2013-05-14
数据A如下:
x   y
1   0.001
2   -0.002
3   0.0015
4    -0.001
5     0
6    0.0008
7    -0.001
8    0.003
9    -0.0025
10    0
问题是做两幅并排靠在一起的图。左边的一幅图为x从1到7的X与Y的平滑直线图。
右边的一幅图为x从8到10的X与Y的平滑直线图。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2013-5-15 09:25:19
I guess it is the same question compared with you last question.
Don't you have found a solution?
if you have installed SAS9.3,submitting the code as follows.
复制代码
You will findthat drawing a curve in SAS is such a easy thing.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-5-15 10:41:23
zhou.wen 发表于 2013-5-15 09:25
I guess it is the same question compared with you last question.
Don't you have found a solution?
...
这个ODS Graphics Designer确实不错
过去竟然不知道,多谢介绍
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-5-15 10:41:58
用sgpanel应该可以达到目的
lz你在网上搜下
具体怎么写我也不会
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-5-15 10:56:47
可以利用proc sgpanel
但是你在畫圖先要先分group
另外,你的平滑直線圖是regression的估計嗎?
下面的程式再依自己的需求修改吧
data test;
input x   y;
if x<=7 then group="a";
else group="b";
cards;
1   0.001
2   -0.002
3   0.0015
4    -0.001
5     0
6    0.0008
7    -0.001
8    0.003
9    -0.0025
10    0
;
proc sgpanel ;
panelby group;
reg x=x y=y;
run;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-5-15 10:58:34
我用笨办法试了个,不知道行不行:

data one;
                input x y;
                cards;
                1   0.001
                2   -0.002
                3   0.0015
                4    -0.001
                5     0
                6    0.0008
                7    -0.001
                8    0.003
                9    -0.0025
                10    0
                ;
                                                                                        run;


data one;
                set one ;
                if _n_ le 7 then x1 = x;
                else x2 = x;
                                                                                        run;



proc template;
                define statgraph myplot;
                begingraph;
                                entrytitle halign=center 'Test' ;
                                entryfootnote halign=left 'Data Source' ;
                                layout lattice / rowdatarange=data columndatarange=data columns = 2 rowgutter=10 columngutter=10;
                                                layout overlay;
                                                                seriesplot x=x1 y=y / connectorder=xaxis;               
                                                endlayout;
                                                
                                                layout overlay;
                                                                seriesplot x=x2 y=y /  connectorder=xaxis;        
                                                endlayout;
                                endlayout;
                endgraph;
                end;
run;

ods listing close;
ods html style = listing ;
ods graphics / width=1000px;

                proc sgrender data = one
                        template= myplot;
                run;

ods graphics / reset;
ods html close;
ods listing;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群