turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- paired t-test macro

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-04-2016 07:29 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-04-2016 08:04 PM

I think that's just an ANOVA?

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-04-2016 10:41 PM - edited 10-04-2016 10:43 PM

You could build on:

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

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

PG