作者Torvalds ( )
看板Statistics
标题Re: [问题] 在SAS上设2个dummy variable
时间Wed Mar 19 22:16:40 2008
Data test;
infile 'D:\data-averse(3).csv';
input q1_7 v19 v20 v21 v22 v23 v24 v25 cluster;S
if cluster='1' then do; D1=0; D2=0;end;→不知这样设对嘛?
else if cluster='2' then do; D1=1; D2=0;end;
else if cluster='3' then do; D1=0; D2=1;end;
set test;
x=(v19+v20+v21+v22+v23+v24)*1/6;
y=(q1_7 +v25)*1/2;
xD1=x*D1;
xD2=x*D2;
proc reg;
model y=x D1 D2 xD1 xD2;
run;
-------------------------------------
用分号 加个end再试试呗
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 122.116.38.119
1F:推 mooner:谢谢!!!! 03/19 22:51