楼主: 3232442590
1417 3

SAS的一个高大上问题 [推广有奖]

  • 0关注
  • 0粉丝

硕士生

17%

还不是VIP/贵宾

-

威望
0
论坛币
43 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1205 点
帖子
80
精华
0
在线时间
126 小时
注册时间
2015-9-18
最后登录
2019-1-29

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
大家好,我现在有以下两段代码:第一张是原始代码,第二张是整理后的代码,我现在要做的是写出一段代码,可以由第一张转换成第二张的内容(比如怎样可以一下子把所有行的[ 模式: 1 ] => 1.0 去掉,这样不用手动一个一个改,怎样可以同时把if then do同时在每行都加上,并可以把大写字母替换成中文),我想写出一段代码可以由原始的转化成整理后的,因为手动一个一个改动太麻烦,谢谢!

1.
SCOR <= 468.500 [ 模式: 1 ]
SCOR <= 400 [ 模式: 1 ] => 1.0
SCOR > 400 [ 模式: 1 ]
A <= 100,000 [ 模式: 1 ]
B <= 6770.800 [ 模式: 1 ]
C <= 6,000 [ 模式: 1 ] => 1.0
C > 6,000 [ 模式: 1 ]
D <= 35 [ 模式: 1 ]
E<= 15 [ 模式: 1 ]
F <= 2 [ 模式: 1 ]
G<= 29.500 [ 模式: 1 ] => 1.0
G> 29.500 [ 模式: 1 ] => 1.0
F > 2 [ 模式: 1 ] => 1.0
E > 15 [ 模式: 1 ] => 1.0
D > 35 [ 模式: 1 ] => 1.0
B> 6770.800 [ 模式: 1 ] => 1.0
A> 100,000 [ 模式: 1 ] => 1.0

2.
if SCOR <= 468.500 then do;                                                                               
        if SCOR <= 400 then do;end;                                                                       
        if SCOR > 400 then do;                                                                        
                if A <= 100,000 then do;                                                               
                        if B<= 6770.800 then do;                                                        
                                if C <= 6,000 then do;end;                                               
                                if C > 6,000 then do;                                               
                                        if D <= 35 then do;                                       
                                                if E<= 15 then do;                               
                                                        if F <= 2 then do;                       
                                                                if G<= 29.500 then do;end;                
                                                                if G> 29.500 then do;end;                
                                                        end;                       
                                                        if F > 2 then do;end;                       
                                                end;                               
                                                if E> 15 then do;end;                               
                                        end;                                       
                                        if D > 35 then do;end;                                       
                                end;                                               
                        end;                                                       
                        if B> 6770.800 then do;end;                                                       
                end;                                                               
                if A > 100,000 then do;                                                               
        end;                                                                       
end;                                                       
二维码

扫码加我 拉你入群

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

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

关键词:sas的 SCOR Then cor SCO 中文 字母

沙发
kunkunred 发表于 2016-2-21 08:48:15 |只看作者 |坛友微信交流群
你这些节点是怎么产生的呢?看起来像决策树。EM应该有产生编码的功能吧。

使用道具

藤椅
3232442590 发表于 2016-2-21 11:15:08 |只看作者 |坛友微信交流群
kunkunred 发表于 2016-2-21 08:48
你这些节点是怎么产生的呢?看起来像决策树。EM应该有产生编码的功能吧。
这是决策树自动生成的,我现在就是想通过一段代码由1变为2(把[ 模式: 1 ] => 1.0 这些没用的字段都去掉,再加上if then do),可是好难写啊

使用道具

板凳
kunkunred 发表于 2016-2-23 04:38:13 |只看作者 |坛友微信交流群
3232442590 发表于 2016-2-21 11:15
这是决策树自动生成的,我现在就是想通过一段代码由1变为2(把[ 模式: 1 ] => 1.0 这些没用的字段都去掉, ...
I haven't used EM for a long time, but I remember that after you grow the tree, you can create a piece of code that can be run in base SAS as mentioned in the following link, which should be what you wanted.

17. Examine the Score Code. From the main menu, select View  [arrow]  Scoring . You will notice these entries:
    SAS Code, also known as Publish Score Code, is the SAS score code that you can use to score data in applications that run outside the Enterprise Miner environment.
http://support.sas.com/documenta ... .htm#a003124480.htm

使用道具

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

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-1 23:23