BookmarkSubscribeRSS Feed
chuakp
Obsidian | Level 7

Hi - I'm trying to figure out how to prevent SAS from outputting certain results to the RTF file.  I'm running Proc surveyreg on a complex survey that includes a variable for strata called VARSTR, a categorical variable that has 255 values.  I want VARSTR in the model but I don't want SAS to output 255 values in the ParameterEstimates part of the output (each comparing 254 values of VARSTR to the baseline VARSTR value).  The reason is that I end up with an RTF that is 20 pages long!  Anyone know how to do this?

Here's my code.  Thanks.

ods rtf file = 'F:\SAS\output.rtf'';

ods select DataSummary Effects ParameterEstimates;

proc surveyreg data = datafile;

weight perwt;

strata varstr;

cluster varpsu;

class agegroupvariable sex race povcat varstr datayear;

model dependentvariable = agegroupvariable sex race povcat varstr datayear /solution;

run;

ods rtf close;

3 REPLIES 3
Tim_SAS
Barite | Level 11

Use the ODS TRACE (http://support.sas.com/documentation/cdl/en/odsug/61723/HTML/default/viewer.htm#a002233618.htm) statement to determine what output objects PROC SURVEYSELECT creates and which ones you want keep or exclude. Then use ODS SELECT (http://support.sas.com/documentation/cdl/en/odsug/61723/HTML/default/viewer.htm#a002233364.htm) or ODS EXCLUDE (http://support.sas.com/documentation/cdl/en/odsug/61723/HTML/default/viewer.htm#a002233281.htm) to add just your target objects to the RTF file.

chuakp
Obsidian | Level 7

Tim, to clarify - what I am trying to do is exclude certain parts of the object ParameterEstimates.  In my code, I've used an ODS SELECT statement to select only the objects that I want to put into my RTF.  What I'm trying to do is to prevent the 255 VARSTR comparisons from printing.

The only thing I can think of doing is to run the regression and save ParameterEstimates to a dataset using the ODS OUTPUT statement, delete the VARSTR comparisons from this dataset in a data step, then use PROC PRINT to print the dataset (which will then have the parameter estimates, standard errors, p values, etc. that I care about).  But this seems tedious.  Is there any way other way to do it?

Tim_SAS
Barite | Level 11

That's the only way I can think of doing it using ODS. Perhaps there's some options on SURVEYSELECT or something?

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1308 views
  • 0 likes
  • 2 in conversation