统计211

标题: 关于第二讲的一个问题 [打印本页]

作者: ☆回头是岸★    时间: 2013-8-9 09:40
标题: 关于第二讲的一个问题
第二讲中,冯老师讲到 “nouniquekey” 选项,

proc sort nouniquekey out=bb;
by id;
.......


个人在SAS9.2中练习,该语句错误,无法运行,求各位同学帮忙:

1) 有同学运行处这个程序吗?

2)还是SAS9.2 和9.3的区别?

备注:noduplicate 选项可以运行。
作者: 吕小布韦    时间: 2013-8-9 13:10
把log的提示贴出来看看
作者: henryyhl    时间: 2013-8-9 16:58
本帖最后由 henryyhl 于 2013-8-9 17:01 编辑

刚才看了一下,是9.3新加的选择项。详见:http://support.sas.com/documenta ... #procwhatsnew93.htm
但是这个选项是什么具体作用?求教
作者: henryyhl    时间: 2013-8-9 17:16
henryyhl 发表于 2013-8-9 16:58
刚才看了一下,是9.3新加的选择项。详见:http://support.sas.com/documentation/cdl/en/whatsnew/64209/HT ...

在网站http://support.sas.com/documenta ... 4n1b6l00ftdnxge.htm
看到这个:
NOUNIQUEKEY
checks for and eliminates observations from the output data set that have a unique sort key. A sort key is unique when the observation containing the key is the only observation within a BY group. An observation has a unique sort key when it is the only observation within a BY group.
Note: Unlike NODUPKEY, which writes one observation of a BY group to the output data set and discards all other observations from the BY group, the NOUNIQUEKEY maintains BY group integrity. Either all observations of a BY group are written to the output data set when the BY group consists of two or more observations, or all observations of the BY group are discarded when the BY group consists of a single observation.
Alias:NOUNIKEY | NOUNIKEYS | NOUNIQUEKEYS
大概就是说如果by变量的某个值只有一个观测的话就删除,如果该by变量的值有多个观测则保留这些观测。
这是9.3上新加的,本人用的还是9.2,没法测试啊。
作者: 国双    时间: 2013-8-9 20:37
henryyhl 发表于 2013-8-9 17:16
在网站http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#p02bhn81rn4u6 ...

可能是我课上没讲清楚?这个的作用就是保留重复的观测,是sas9.3新加的
作者: henryyhl    时间: 2013-8-9 21:18
国双 发表于 2013-8-9 20:37
可能是我课上没讲清楚?这个的作用就是保留重复的观测,是sas9.3新加的

可能是我们当时听得不仔细,有些东西还是回来自己跑程序出问题 了才知道。
多向冯老师学习。
作者: ☆回头是岸★    时间: 2013-8-9 21:19
国双 发表于 2013-8-9 20:37
可能是我课上没讲清楚?这个的作用就是保留重复的观测,是sas9.3新加的

谢谢冯老师,呵呵,我说SAS9.2怎么运行不了呢?看来软件该更新了。。。。
作者: ☆回头是岸★    时间: 2013-8-9 21:19
henryyhl 发表于 2013-8-9 17:16
在网站http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#p02bhn81rn4u6 ...

谢谢海亮啊,哈哈。。。
作者: ぺ蘖莎い    时间: 2013-8-10 19:42
☆回头是岸★ 发表于 2013-8-9 21:19
谢谢海亮啊,哈哈。。。

原来如此~~你们谁有9.3啊
作者: henryyhl    时间: 2013-8-11 09:12
ぺ蘖莎い 发表于 2013-8-10 19:42
原来如此~~你们谁有9.3啊

可以在人大论坛或百度上搜一下,但是我的一个老师装了9.3之后好像还没有9.2的快呢。不知道什么原因,然后他就换回9.2了
作者: henryyhl    时间: 2013-8-11 09:13
ぺ蘖莎い 发表于 2013-8-10 19:42
原来如此~~你们谁有9.3啊

可以在人大论坛或百度上搜一下,但是我的一个老师装了9.3之后好像还没有9.2的快呢。不知道什么原因,然后他就换回9.2了
作者: ぺ蘖莎い    时间: 2013-8-11 19:44
henryyhl 发表于 2013-8-11 09:12
可以在人大论坛或百度上搜一下,但是我的一个老师装了9.3之后好像还没有9.2的快呢。不知道什么原因,然后 ...

据说是9.3占的地更大了。。。




欢迎光临 统计211 (http://www.tj211.com/) Powered by Discuz! X3.2