全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
10231 10
2013-09-05
在boxplot中怎么将两幅图合并到一张图上,可以更直观的进行对比,谢谢了
二维码

扫码加我 拉你入群

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

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

全部回复
2013-9-5 09:53:49
貌似by,或者graph里的combine
二维码

扫码加我 拉你入群

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

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

2013-9-5 10:18:47
wfldragon 发表于 2013-9-5 09:53
貌似by,或者graph里的combine
能详细点吗,我是新手,谢谢了
二维码

扫码加我 拉你入群

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

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

2013-9-5 11:54:27
dongyfei 发表于 2013-9-5 10:18
能详细点吗,我是新手,谢谢了
把你用的code发出来,完整一点,最好把数据也附过来

用不同的package做法也不太一样,而且具体操作也取决于数据本身。简单地问如何合并感觉有点笼统
二维码

扫码加我 拉你入群

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

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

2013-9-5 12:02:53
给个例子你吧:
sysuse auto.dta, clear

// Graph 1: Price vs. Mileage

gr tw sc price mpg, ///
graphregion(color(white)) ///
title("Price vs. Mileage", ring(1) pos(12) size(*0.8))
gr save "C:/Documents/Statadocs/gr1.gph", replace

// Graph 2: The average mileage of domesic versus foreign cars

gr bar (mean) mpg, over(foreign) ///
legend(lab(1 "Domestic") lab(2 "Foreign") nobox ring(1) pos(3) col(1) symxsize(*0.25) order(2 1)) ///
blabel(bar, position(center) format(%12.1f) color(white) size(*1.025)) ///
title("Average mileage, Domestic vs. Foreign cars", size(*0.9)) ///
ytitle("Percent", size(*0.9)) ///
ylabel(, nogrid) ///
yscale(off) ///
graphregion(color(white))
gr save "C:/Documents/Statadocs/gr2.gph", replace

// Combining graphs horizontally (in one row)

graph combine ///
"C:/Documents/Statadocs/gr1.gph" ///
"C:/Documents/Statadocs/gr2.gph", ///
row(1) graphregion(color(white)) xsize(7) ysize(4)
gr export "C:/Documents/Statadocs/combined_horizontal.emf", replace

// Combining graphs horizontally (in one column)
// Notice how we change the aspect ratio with xsize() and ysize()

graph combine ///
"C:/Documents/Statadocs/gr1.gph" ///
"C:/Documents/Statadocs/gr2.gph", ///
row(2) col(1) graphregion(color(white)) xsize(4) ysize(7)
gr export "C:/Documents/Statadocs/combined_vertical.emf", replace
二维码

扫码加我 拉你入群

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

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

2013-9-5 17:23:08
肉肠 发表于 2013-9-5 11:54
把你用的code发出来,完整一点,最好把数据也附过来

用不同的package做法也不太一样,而且具体操作也取 ...
谢谢了,麻烦了,下面这数据和我要分析的差不多,就是向要比较一般非线性模型和混合模型的拟合效果,d是自变量,h是因变量
data nlin;
input h d;
cards;
7.8 6
6.4 6
4.2 6
5.5 6
9.5 6
8.8 8
9.5 8
5.6 8
7.8 8
8 8
10.8 10
12 10
10.5 10
11 10
15.8 10
11.2 10
;
run;
proc sort data=nlin;
by d;
run;
   proc boxplot data=e.jianyang;
plot h*d;
goptions hsize=4  vsize=4;
run;

data nlmixed;
input h d;
cards;
6.8 6
5.4 6
6.2 6
7.5 6
5.5 6
9.8 8
9.5 8
7.6 8
8.8 8
8.4 8
11.8 10
11.9 10
10.5 10
11 10
15.8 10
11.2 10
;
run;
proc sort data=nlmixed;
by d;
run;
   proc boxplot data=nlmixed;
plot h*d;
goptions hsize=4  vsize=4;
run;
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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