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;
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.
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?
That's the only way I can think of doing it using ODS. Perhaps there's some options on SURVEYSELECT or something?
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.
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.