Help using Base SAS procedures

Proc Freq Trend Test Output

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 126
Accepted Solution

Proc Freq Trend Test Output

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,


Accepted Solutions
Solution
‎01-04-2016 01:38 PM
Trusted Advisor
Posts: 1,117

Re: Proc Freq Trend Test Output

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


All Replies
Super User
Posts: 19,772

Re: Proc Freq Trend Test Output

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
Solution
‎01-04-2016 01:38 PM
Trusted Advisor
Posts: 1,117

Re: Proc Freq Trend Test Output

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.

Frequent Contributor
Posts: 126

Re: Proc Freq Trend Test Output

Posted in reply to FreelanceReinhard

@FreelanceReinhard,

 

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

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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