logit=3; output; 的意思是 把 yy=1 or yy=0 和 logit=3 输出到结果数据集 a
第一个output后,程序在同一条观测上继续运行下面的语句。
下面的 code 说明 为什么每一条观测有三条输出.
data b;
input x y;
datalines;
1 1
2 2
3 3
;
data a;
set b;
yy=(y=3); logit = 3; output;
yy=(y=2); logit = 2; output;
yy=(y=1); logit = 1; output;
run;
下面的 code 与上面的 code 得到相同的结果
data c;
set b;
if y = 3 then yy=1;
else yy=0;
logit = 3;
output;
if y = 2 then yy=1;
else yy=0;
logit = 2;
output;
if y = 1 then yy=1;
else yy = 0;
logit = 1;
output;
run;