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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 3 replies
  • 1403 views
  • 1 like
  • 3 in conversation