全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
5221 3
2014-04-15
新手刚学sas,一直弄不懂sas中by语句的分组与class语句的分类到底有什么区别。求各位大神指点一二,谢谢!
二维码

扫码加我 拉你入群

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

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

全部回复
2014-4-15 23:28:10
我记得by分类的话,结果是每组分开,没有样本整体分析。如果你有软件的话,运行一下,会发现结果的输出形式不一样。

找到了一个官方解释,看一下:
Comparison of the BY and CLASS Statements

Using the BY statement is similar to using the CLASS statement and the NWAY option in that PROC MEANS summarizes each BY group as an independent subset of the input data. Therefore, no overall summarization of the input data is available. However, unlike the CLASS statement, the BY statement requires that you previously sort BY variables.

When you use the NWAY option, PROC MEANS might encounter insufficient memory for the summarization of all the class variables. You can move some class variables to the BY statement. For maximum benefit, move class variables to the BY statement that are already sorted or that have the greatest number of unique values.

You can use the CLASS and BY statements together to analyze the data by the levels of class variables within BY groups.

http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146731.htm#a000091561
二维码

扫码加我 拉你入群

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

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

2014-4-15 23:33:41
二维码

扫码加我 拉你入群

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

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

2014-4-16 12:57:20
mingfeng07 发表于 2014-4-15 23:33
看这个帖子:https://bbs.pinggu.org/thread-2671959-1-1.html
受教了。谢谢~~~
二维码

扫码加我 拉你入群

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

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

栏目导航
热门文章
推荐文章

说点什么

分享

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