Programming the statistical procedures from SAS

ODS Output Type 3 proc surveyselect

Accepted Solution Solved
Reply
Contributor
Posts: 41
Accepted Solution

ODS Output Type 3 proc surveyselect

Hi,

 

I am trying to write ods output while using proc surveyselect 

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;
ods output type3 = model_tmp;
%end;
%mend LogitBoot;

 

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?


Accepted Solutions
Solution
‎01-06-2017 09:04 AM
SAS Super FREQ
Posts: 3,306

Re: ODS Output Type 3 proc surveyselect

Here is an article about how to "Find the ODS table names produced by any SAS procedure"

There are (at least) three things wrong with your program.

1. When you use the NOPRINT option, no ODS output is created.

2. The SURVEYSELECT procedure does not create a table named 'Type3';

3. Any ODS statement needs to go before or inside a procedue.

 

There is a bigger problem, however. it appears that you are trying to do bootstrapping by using a macro loop. This is a bad idea. Please read the following article, which describes a better way to bootstrap in SAS:

- "Compute a bootstrap confidence interval in SAS"

 

 

View solution in original post


All Replies
Grand Advisor
Posts: 16,880

Re: ODS Output Type 3 proc surveyselect

The ODS statement needs to come before the proc, not after. 

RUN is a step boundary, nothing after RUN will affect the PROC before. 

Contributor
Posts: 41

Re: ODS Output Type 3 proc surveyselect

Sorry doesn't work !!
Grand Advisor
Posts: 16,880

Re: ODS Output Type 3 proc surveyselect

What does the log say then?

Try getting it working without a macro first and then you can convert your code to macro logic. 

Grand Advisor
Posts: 16,880

Re: ODS Output Type 3 proc surveyselect

Proc surveyselect will not generate any model so using table name type3 makes no sense. What are you trying to do in the ODS statement? 

Solution
‎01-06-2017 09:04 AM
SAS Super FREQ
Posts: 3,306

Re: ODS Output Type 3 proc surveyselect

Here is an article about how to "Find the ODS table names produced by any SAS procedure"

There are (at least) three things wrong with your program.

1. When you use the NOPRINT option, no ODS output is created.

2. The SURVEYSELECT procedure does not create a table named 'Type3';

3. Any ODS statement needs to go before or inside a procedue.

 

There is a bigger problem, however. it appears that you are trying to do bootstrapping by using a macro loop. This is a bad idea. Please read the following article, which describes a better way to bootstrap in SAS:

- "Compute a bootstrap confidence interval in SAS"

 

 
Contributor
Posts: 41

Re: ODS Output Type 3 proc surveyselect

I even tried to do the following :

 

proc logistic data = training_tmp desc;
freq numberhits;
class &class1;
model CancelInd = &new_var;
ODS OUTPUT oddsratios=odds1 type3=type1 fitstatistics =fit1;
run;

But it generates everything else apart from the type3

Grand Advisor
Posts: 16,880

Re: ODS Output Type 3 proc surveyselect

What does the log say in this case?

Contributor
Posts: 41

Re: ODS Output Type 3 proc surveyselect

The issue resolves if a ref statement is specified in the class statement

Grand Advisor
Posts: 16,880

Re: ODS Output Type 3 proc surveyselect


Lopa2016 wrote:

The issue resolves if a ref statement is specified in the class statement


This is incorrect, you must have had some other error. Did you include a CLASS variable, that is required?

 

proc logistic data=sashelp.heart;
class BP_status;
model status = bp_status height weight;
ods output type3=want;
run;

Log - note the message that the table name has changed and this may not work in the future:

 

60
61 proc logistic data=sashelp.heart;
62 class BP_status;
63 model status = bp_status height weight;
64 ods output type3=want;
65 run;
 
NOTE: PROC LOGISTIC is modeling the probability that Status='Alive'. One way to change this to model the probability that
Status='Dead' is to specify the response variable option EVENT='Dead'.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
WARNING: The Logistic output formerly named Type3 is now named ModelANOVA. Please use the new output name in the future; the old syntax might not work in the next release.
 
NOTE: The data set WORK.WANT has 3 observations and 4 variables.
 
NOTE: There were 5209 observations read from the data set SASHELP.HEART.
NOTE: PROCEDURE LOGISTIC used (Total process time):
real time 0.14 seconds
cpu time 0.15 seconds

 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 9 replies
  • 231 views
  • 3 likes
  • 3 in conversation