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 | ||||||||||||||||
N | NMiss | Mean | Median | sd | p-value | N | NMiss | Mean | Median | sd | p-value | N | NMiss | Mean | Median | sd | p-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
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.
Look into the PERSIST option. There's some general examples in this post as well, towards the bottom.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.