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

Hello all,  Thanks in advance for the help here

 

I have this proc anova code that appears to be working properly(validations still to come).  But I need to output the p-values from this to a table based on the by groups.  The ods output system still confuses me and I have been unsuccessful getting what I need.  How do i get that output?

 

 

proc anova data=tmp_seasonal_raw(where=(testType='Anova'));
	class month;
	model total_qty=month;
	by customer gd apg1;
	MEANS month / HOVTEST=BARTLETT;

run;

 

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Or more explicitly: Precede your PROC ANOVA step by 

ods output OverallANOVA=oa;
ods output ModelANOVA=ma;
ods output Bartlett=ba;

and you will find the p-values (together with more information) in datasets OA, MA and BA (or whatever you name them).

View solution in original post

3 REPLIES 3
JohndeKroon
Obsidian | Level 7

Hi,

 

Here is an example for the use of ODS-output:

 

data test;

format id $10.;

input id X;

datalines;

Test1 10

Test2 20

;

ods output summary=means_summary;

proc means data=test;

by id;

run;

 

this creates a table (called "means_summary") in you work-lib with the data of the proc-means summary table. Through this way you can write any output created to a table. The trick is to know the correct name of the output table...

 

To see which table you could use to obtain your p-values check:

http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_anova_sect02...

Reeza
Super User

1. Use ods trace to find the table names. (ODS TRACE ON; ODS TRACE OFF;)

2. Check the log to Find the table name of interest, I didn't figure that out you can replace the pvalues below with the actual table name.

3. Add code to capture said table using ods table or ods output.

 

ODS TRACE ON;
proc
anova data=tmp_seasonal_raw(where=(testType='Anova')); class month; model total_qty=month; by customer gd apg1; MEANS month / HOVTEST=BARTLETT; ods table pvalues=my_output_table; run;
ODS TRACE OFF;

proc print data=my_output_table;
run;

 

FreelanceReinh
Jade | Level 19

Or more explicitly: Precede your PROC ANOVA step by 

ods output OverallANOVA=oa;
ods output ModelANOVA=ma;
ods output Bartlett=ba;

and you will find the p-values (together with more information) in datasets OA, MA and BA (or whatever you name them).

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 5132 views
  • 2 likes
  • 4 in conversation