BookmarkSubscribeRSS Feed
ivs
Calcite | Level 5 ivs
Calcite | Level 5

hi all,

i am working on a project that requires to find similarity in measured performance. using  proc ttest works great for the purpose. is there a way to output a matrix of p-values? here is an example of data:

data one;

input a b c d e;

cards;

12 25 41 15 68

25 11 42 56 3

85 24 45 91 97

2 75 98 64 83

84 55 2 87 92

53 67 82 19 17

54 89 13 26 9

28 11 75 61 69

38 49 23 31 33

5 84 37 41 20

;

proc ttest data=one sides=2;

paired (a b c d e)*(a b c d e);

run;

what i want as output is a matrix of p-values (here i put it together manually):

     a       b      c       d      e

a   1.00   0.47  0.67  0.29  0.43

b   0.47  1.00   0.82  0.99  0.99

c   0.67   0.82  1.00  0.80  0.81

d   0.29   0.99   0.80  1.00 1.00

e   1.00   0.99   0.81  1.00  1.00

does anyone know how to output such matrix?

if there is a way to calculate it by a procedure other than ttest, that's fine. 

many thanks in advance for your help!

2 REPLIES 2
Reeza
Super User

Two extra lines can get you closer, I'll assume you can transpose it to the shape required if you really want using proc transpose Smiley Happy

ods select ttests;

ods table ttests=summary1;

proc ttest data=one sides=2;

paired (a b c d e)*(a b c d e);

run;

ivs
Calcite | Level 5 ivs
Calcite | Level 5

thanks Reeza. this does get me closer Smiley Happy

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1379 views
  • 3 likes
  • 2 in conversation