I'm using complex survey data to run proc surveyfreq with several table statements, the variables of which are stratified by several demographic variables. I'm also running Chi-square tests on everything.
I want to only print the tables that have Chi-square p-values <0.05--is this possible? I'm not sure how to use ODS to select what I want.
If I understand your question, you want to control the output to HTML, and I'm not sure how to do that. It is possible to use the ODS tables to create output that you could print with other procedures. E.g., the following example will allow you to output the p value for a chi-square test statistic into one table (work.want1), and you could use a DATA step procedure to determine if the table outputted from the TABLES statement (work.crosstab1) should be retained. This example uses PROC FREQ, but ODS TABLE names are available in SURVEYFREQ: PROC SURVEYFREQ: ODS Table Names :: SAS/STAT(R) 9.3 User's Guide
ods tables ChisQ=want1;
proc freq data=sashelp.cars ;
tables type*origin / chisq out=crosstab1;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.