BookmarkSubscribeRSS Feed
rajd1
Quartz | Level 8

Hello all,

I looked around  the community and did not find how to automatically extract p-values from running statistical procedures, especially when there are several tests.

Here is my sample code.  

DATA check;
INPUT X1 X2 X3 X4 categories $;
CARDS;
27 10 30 19 1
35 68 94 34 1
37 1 89 26 1
19 36 15 48 1
40 46 19 43 1
16 86 81 42 2
32 48 81 56 2
77 74 86 36 2
53 95 28 74 3
76 52 95 42 3
22 45 6 24 3
;

PROC ANOVA DATA=check;
CLASS Categories;
MODEL X1=Categories;
RUN;
quit;

PROC ANOVA DATA=iron;
CLASS WISH;
MODEL MODEL X1=Categories;
RUN;
quit;

 1 2 3
NNMissMeanMediansdp-valueNNMissMeanMediansdp-valueNNMissMeanMediansdp-value
X1                  
X2                  
X3                  
X4                  

Here is the table i am trying to achieve. I can get the descriptive statistics with PROC TABULATE. I just need to attach the p-values from any statistical tests such as Kruskal Wallis, t-test, Chi-square, repeated measures etc. Are there any macros or anyone has any codes to achieve this? I have also tried the new %tablen macro and it does not achieve this. 

Any help is much appreciated!

Thanks

 

4 REPLIES 4
Reeza
Super User

Here's some instructions and explanations on how to capture output that is shown.
https://blogs.sas.com/content/sastraining/2017/03/31/capturing-output-from-any-procedure-with-an-ods...

 

You'll need to collect the data from the procedures as needed.

Note that this is where Enterprise Miner automated analytical tools comes into play.

rajd1
Quartz | Level 8
Thank you for this! Is there a way to capture such formatted outputs for a number of variables and store it in the same file? Thanks again!
Reeza
Super User

Look into the PERSIST option. There's some general examples in this post as well, towards the bottom. 

https://documentation.sas.com/?docsetId=odsug&docsetTarget=p0oxrbinw6fjuwn1x23qam6dntyd.htm&docsetVe...

rajd1
Quartz | Level 8
This is helpful! i will try this out. Thanks.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 967 views
  • 3 likes
  • 2 in conversation