由买买提看人间百态

topics

全部话题 - 话题: hcc2
(共0页)
t*******s
发帖数: 289
1
来自主题: Statistics版 - NEED HELP: write do loop in SAS for a project
table 1
ID HCC1 HCC2 HCC3
a 0 1 1
b 1 1 1
c 1 1 0
d 1 0 0
e 0 0 0
f 0 0 0
g 1 1 0
h 1 1 0
i 1 1 1
j 0 1 1
k 0 0 1
l 0 0 0
m 1 0 0
n 1 0 0
o 1 0 0
p 0 0 1
q 0 1 1
r 0 1 1
s 0 1 0
t 0 0 0
table 2
ID HCC1 HCC2 HCC3
a 1 0 1
b 1 0 1
c 1 0 1
d 0 0 1
e 0 0 0
f ... 阅读全帖
l****u
发帖数: 529
2
来自主题: Statistics版 - NEED HELP: write do loop in SAS for a project
I did not check.
data t3;
merge t1 t2(rename=(hcc1=hcc4 hcc2=hcc5 hcc3=hcc6));
by id;
array new1 [3] hcc1 hcc2 hcc3;
array new2 [3] hcc4 hcc5 hcc6;
do i=1 to 3;
if new1[i]-new2[i]=1 then hcc=vname(new1[i]);
end;
run;
(共0页)