楼主: flyloop
13806 22

请sas高手看看这个宏程序的问题。。。坐等解答 [推广有奖]

11
jingju11 发表于 2013-11-24 00:53:07
I read the log. It is not very clear at all.
Can you confirm  that, for example, if ODS works on your sas?
Doing things in macro will give confusing errors sometimes. You should test your code by removing the layer of  macro.
By the way, it is frustrating to solve a problem because of using a 'bad' sas.

JingJu

12
flyloop 发表于 2013-11-24 10:55:36
QQ图片20100310103656.jpg 我换了sas9.3至sas9.2 10.5G完整版,一半欢喜一半优,这次报错的少了 erro.pdf (116.35 KB) 。输出了连续变量地结果如上图,分类变量估计是因为报错的缺少什么频数数据集导致的吧!问题真在版本问题上?我接下来该换哪个版本?有无大侠给点建议







QQ图片20100310103656.jpg (31.2 KB)

QQ图片20100310103656.jpg

QQ图片20100310103656.jpg (31.2 KB)

QQ图片20100310103656.jpg

13
flyloop 发表于 2013-11-24 17:03:39
邓贵大 发表于 2013-11-24 12:33
try to replace
ODS OUTPUT 'One-Way Frequencies' = _FREQ;
with
谢谢您的回复,我觉得确实是ods的问题,我再研究研究ODS怕是很慢了,为什么有的版本可以正常运行,比如像前面那位朋友就能完全跑出来,我的就为什么不行呢

14
flyloop 发表于 2013-11-24 18:09:00
同志们,我发现了一个奇怪的现象!!!我之前的报错是在中文版的sas 9.3 9.2上出现的,我今天下午转念一想,这程序是在国外写的,会不会中文版本会有问题。果不其然,我用英文版完全无报错,不知道这中间到底发生了什么!!!现在的问题是CRELIST选项用来干嘛的,我想是输出以哪一类作为参考的,语法格式应该怎么写,我试了几种写法,都不行
  1. creflist=trt="B"*sex="M"
  2. creflist="B"*"M"
  3. creflist=B*M
  4. creflist=trt=B*sex=M
复制代码

15
flyloop 发表于 2013-11-24 18:11:02
同志们,问题已部分解决,只能用英文版的sas才不报错。中文版的到底里面发生了什么?????再就是creflist选项的格式应该怎么写

16
flyloop 发表于 2013-11-24 18:48:03
jingju11 发表于 2013-11-24 00:53
I read the log. It is not very clear at all.
Can you confirm  that, for example, if ODS works on y ...
问题已经部分解决,换用sas英文系统后就不报错了!!!不知道中文系统里面到底发生了什么!!!再就是creflist选项到底该怎么写,现在还没摸索出来,试了好几种都不行

17
邓贵大 发表于 2013-11-25 01:56:57
Congratulations! You already figured it out by yourself!
try to put this statement
ODS TRACE ON/LABEL;
in your program, you'll see that the label paths (or descriptions) vary by languages, but the paths (or tables names) are always the same.

"class &refvar/order=internal;" appears in the PROC PHREG, so the biggest internal value will always be the reference group, regardless of creflist. So you cannot specify the reference group unless you recode the covariate.

“取乎其上,得乎其中;取乎其中,得乎其下;取乎其下,则无所得矣”。You better off write your own program instead of copying a flawed macro, because the latter costs you more time in the long run!




Be still, my soul: the hour is hastening on
When we shall be forever with the Lord.
When disappointment, grief and fear are gone,
Sorrow forgot, love's purest joys restored.

18
jingju11 发表于 2013-11-25 10:07:00
Glad to know. We can always learn things from the upper floor.
About CLASS statement maybe needs some clarification. Even though I am not very clear why the author used the INTERNAL order rather than default FORMATTED, there is not too much doubt that placing the parameter levels into a certain order won’t hinder how one specifies the method of parameterization for the class variables, say, reference, GLM, etc.
It looks like that in the macro the class variables can be specified in the form of the following:
Creflist = trt(ref ='A')*sex,
In this case, treatment of ‘A’ as the reference level (‘A’ was specified; without specification, instead of ‘B’ as default), but sex of ‘M’ as the reference (M is the larger value, as default).
JingJu

19
heperwong 在职认证  发表于 2013-11-25 10:22:20
flyloop 发表于 2013-11-24 18:48
问题已经部分解决,换用sas英文系统后就不报错了!!!不知道中文系统里面到底发生了什么!!!再就是cre ...
不好意思,是我没说清楚,我不知道你用的是中文版,我以为英文版应该是大家默认的。

20
flyloop 发表于 2013-11-25 11:52:28
邓贵大 发表于 2013-11-25 01:56
Congratulations! You already figured it out by yourself!
try to put this statement
ODS TRACE ON/LA ...
太感谢大神了,这次也学到了很多,个人感觉sas的搜索帮助还有例子什么的不太方便,相比较R。现在sas基础比较薄弱,决定好好研究macro,争取假以时日自己能优化这个macro。

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-30 09:16