我正在尝试使用以下宏编写ods输出:
%let class1=X1 X2
%let &new_var=X3 X4
options mprint mlogic symbolgen;
%macro LogitBoot(data = , dv = , iv = ,class=, n = );
proc sql noprint;
create table logit_result
(iv char(10), prob num format = 6.4,
sig1 num format = 4., sig2 num format = 4.,
sig3 num format = 4., sig4 num format = 4.);
select count(*) into :sample from &data;
quit;
%do i = 1 %to &n;
proc surveyselect data = training method = urs out = &data._tmp n = &sample
noprint;
run;
proc logistic data = &data._tmp desc;
freq numberhits;
class &class;
model &dv = &iv;
ods output type3 = model_tmp;
run;
proc sql;
insert into logit_result
select
upcase(effect) as iv, ProbChiSq as prob,
case when ProbChiSq <= 0.01 then 1 else 0 end as sig1,
case when ProbChiSq > 0.01 and ProbChiSq <= 0.05 then 1 else 0 end as sig2,
case when ProbChiSq > 0.05 and ProbChiSq <= 0.1 then 1 else 0 end as sig3,
case when ProbChiSq > 0.1 then 1 else 0 end as sig4
from model_tmp;
quit;
%end;
proc summary data = logit_result nway;
class iv;
output out = out_table (drop = _type_ rename = (_freq_ = count))
sum(sig1) = sum(sig2) = sum(sig3) = sum(sig4) = ;
run;
%mend LogitBoot;
%LogitBoot(data = training,dv = Target,class =&amp; class1,iv =&amp; new_var,n = 2); 但我一直收到以下警告:
警告:输出&#39; type3&#39;没有创建。确保输出对象名称,标签或路径拼写正确。另外,验证 使用适当的过程选项来生成请求的输出对象。例如,验证 不使用NOPRINT选项。
有人可以帮忙吗?
答案 0 :(得分:2)
在较新版本的SAS中,type3
表已被删除。您可以在最新的文档here中看到它。
尝试ModelANOVA
表。它在文档中描述为
关节或类型3效果测试
我没有旧版本的SAS进行测试,因此无法告诉您表格结构是否相同。如果没有,您将必须适当修改您的代码。