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; 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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