由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - SAS code question
相关主题
[合集] SAS data input helpSAS help needed!
SAS question (紧急求助,在线等)sas base 70的两道题
SAS question, the data have been changed (紧急求助,在线等)问大家一个SAS问题(其实我找到答案了,算考考大家吧)
工作中SAS问题 —另一个问题请教!A SAS Data Question
SAS help needed, manual input during Data step.SAS Base 123题中47和112题疑问
求SAS codeinterview questions for health care insurance company?
SAS input format questionsas help
70 题中的第29题答案是不是错了啊?sas question help
相关话题的讨论汇总
话题: data话题: x2话题: x3话题: x1话题: x190
进入Statistics版参与讨论
1 (共1页)
z**l
发帖数: 82
1
Ask for help!!
I have data a:
if x1,x2 or x3 = (b or z) then y=1
else y=0.
I need have a data like data b.
data a;
input x1$ x2 $ x3 $ ......x190 $;
cards;
b 1 2 ........
1 0 1 ........
2 z 2 ........
1 1 b ........
;
run;
data b:
x1 x2 x3 ....x190 y
b a 2 2 1
1 0 1 ........ 0
2 z 2 ........ 1
1 1 b ........ 1
s*********e
发帖数: 1051
2
data a (drop = i);
input x1 $ x2 $ x3 $;
y = 0;
array x{*} _character_;
do i = 1 to dim(x);
if x{i} in ('b', 'z') and y = 0 then y = 1;
else y = y;
end;
cards;
b 1 2
1 0 1
2 z 2
1 1 b
;
run;
z**l
发帖数: 82
3
Thanks you so much!
1 (共1页)
进入Statistics版参与讨论
相关主题
sas question helpSAS help needed, manual input during Data step.
请教SAS问题:这个code有什么办法简化吗?求SAS code
sas help!!SAS input format question
help-SAS 读data 问题70 题中的第29题答案是不是错了啊?
[合集] SAS data input helpSAS help needed!
SAS question (紧急求助,在线等)sas base 70的两道题
SAS question, the data have been changed (紧急求助,在线等)问大家一个SAS问题(其实我找到答案了,算考考大家吧)
工作中SAS问题 —另一个问题请教!A SAS Data Question
相关话题的讨论汇总
话题: data话题: x2话题: x3话题: x1话题: x190