BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BTAinRVA
Quartz | Level 8

I'm runing the code below to get Cochran-Armitage trend test output for each medical facility. Is there a way to get all test results outputted to a single table? The code below doesn't give me the trend test results.

 

proc freq data = PPIP_new ;

tables Tmt_ID_Name*PPH*CQ / trend out=trend_data;

title 'trend by MTF for each cq';

run ;

 

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Using the ODS tables, as @Reeza has suggested, is always possible. In this specific case, however, I personally would prefer the OUTPUT statement:

proc freq data = PPIP_new;
tables Tmt_ID_Name*PPH*CQ / trend out=trend_data;
output out=catest trend;
title 'trend by MTF for each cq';
run;

(CATEST is just an arbitrary dataset name.)

 

I find the structure of this output dataset more convenient than that of the TrendTest ODS output dataset, which you could create as follows:

ods output TrendTest=tt;
proc freq data = PPIP_new;
tables Tmt_ID_Name*PPH*CQ / trend out=trend_data;
title 'trend by MTF for each cq';
run;

You will see, for example, that CATEST contains variable Tmt_ID_Name, whereas dataset TT (again an arbitrary name) does not.

View solution in original post

3 REPLIES 3
Reeza
Super User
Use the ODS TABLES. This post details how to filter/select your tables and save them to a dataset.

https://communities.sas.com/t5/SAS-Communities-Library/Okay-ODS-just-give-me-what-I-want/ta-p/221750
FreelanceReinh
Jade | Level 19

Using the ODS tables, as @Reeza has suggested, is always possible. In this specific case, however, I personally would prefer the OUTPUT statement:

proc freq data = PPIP_new;
tables Tmt_ID_Name*PPH*CQ / trend out=trend_data;
output out=catest trend;
title 'trend by MTF for each cq';
run;

(CATEST is just an arbitrary dataset name.)

 

I find the structure of this output dataset more convenient than that of the TrendTest ODS output dataset, which you could create as follows:

ods output TrendTest=tt;
proc freq data = PPIP_new;
tables Tmt_ID_Name*PPH*CQ / trend out=trend_data;
title 'trend by MTF for each cq';
run;

You will see, for example, that CATEST contains variable Tmt_ID_Name, whereas dataset TT (again an arbitrary name) does not.

BTAinRVA
Quartz | Level 8

@FreelanceReinh,

 

Yes, the output using the Output statement is more useful. Many Thanks!

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 2087 views
  • 1 like
  • 3 in conversation