02-16-2012 08:10 AM
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;
class agegroupvariable sex race povcat varstr datayear;
model dependentvariable = agegroupvariable sex race povcat varstr datayear /solution;
ods rtf close;
02-16-2012 08:20 AM
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.
02-16-2012 12:27 PM
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?