BookmarkSubscribeRSS Feed
Fluorite | Level 6

Dear all,


I need some help with a macro procedure for paired t-tests in a sample of stocks independently sorted across two variables (please see the top of the attached text file). There are 25 groups that have been formed out of the intersections of the variable rankings (each variable has 5 distinct groups). The means within these groups are of variable DEX. I would like to be able to test the paired t-test for the groups at the outskirts of the rankings; for example the intersection of BM_RK "1" and DEX_RK "1" against the intersection of BM_RK "5" and DEX_RK "1". Following that pattern there would be five test results on the right hand side of the transposed table (see bottom portion of the attached text file) and five test results at the bottom of the table.


I have been able to form individual data sets from the sample to capture the needed intersections of the ranked variables but the effort is not very efficient and I believe that there might be a better technique that I am currently not familiar with.


Thank you for help.

Super User

I think that's just an ANOVA? 

See the examples of multiple comparison. Make sure to adjust for multiple tests.

Opal | Level 21

You could build on:


proc sort data=myData; 
by dex_rk bm_rk; 

proc ttest data=myData(where=(bm_rk in (1, 5)));
by dex_rk;
class bm_rk;
var dex;

Note: that's not what is called a "paired t-test". 



Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.


Register now!

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
  • 2 replies
  • 3 in conversation