BookmarkSubscribeRSS Feed
SAS93
Quartz | Level 8

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. 

1 REPLY 1
svh
Lapis Lazuli | Level 10 svh
Lapis Lazuli | Level 10

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; 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 508 views
  • 0 likes
  • 2 in conversation