Help using Base SAS procedures

Suppressing output from PROC SURVEYREG

Reply
Frequent Contributor
Posts: 82

Suppressing output from PROC SURVEYREG

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;

Super Contributor
Posts: 394

Suppressing output from PROC SURVEYREG

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.

Frequent Contributor
Posts: 82

Suppressing output from PROC SURVEYREG

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?

Super Contributor
Posts: 394

Suppressing output from PROC SURVEYREG

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

Ask a Question
Discussion stats
  • 3 replies
  • 322 views
  • 0 likes
  • 2 in conversation