0
votes

I am trying to write ods output while using the following macro:

   %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=&class1,iv =&new_var , n = 2); But I keep getting the following warning :

WARNING: Output 'type3' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify that the NOPRINT option is not used.

Can someone help?

1
According to the documentation type3 is not a suitable ods table name (support.sas.com/documentation/cdl/en/statug/63962/HTML/default/…)Andrew Haynes
Sorry my bad I am actually using it for the proc logistic but it still doesn't generateuser6016731
Can you post sample data and working code? Your current code has extra PROC statement at top. Does not have any calls to the macro it defines. Also you need to set the ODS OUTPUT before the proc runs and not after.Tom
Hi Tom I have edited my post can you please take a look now?user6016731

1 Answers

2
votes

In newer versions of SAS, the type3 table has been removed. You can see that in the most up-to-date doc here.

Try the ModelANOVA table. It is described in the documentation as

Joint or Type 3 tests of effects

I don't have an old version of SAS to test against, so I cannot tell you if the table structure is the same. If not, you will have to modify your code appropriately.