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?
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"
The ODS statement needs to come before the proc, not after.
RUN is a step boundary, nothing after RUN will affect the PROC before.
What does the log say then?
Try getting it working without a macro first and then you can convert your code to macro logic.
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?
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"
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
What does the log say in this case?
The issue resolves if a ref statement is specified in the class statement
@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:
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.