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
- /
- Multiple T-Tests

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

02-28-2012 02:35 PM

Hello,

I have a data set with 14 different groupings of test/control records, and I need to run t-tests on all. So I have one variable titled, "Test_ID" and the values run A1, A2, A3... A14 (test) and Z1, Z2 .... Z14 (control). I want to test for the difference in the variable, "Revenue." Is there a simple statement I am overlooking on the white papers which will let me do this, or do I just need to write a macro do loop and let that run through?

Thanks!

--Russell

Accepted Solutions

Solution

02-28-2012
03:22 PM

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

02-28-2012 03:22 PM

I think that the following describes what you are trying to do. I'm presuming that these are all independent tests, except that all of the data exists in one file. Also realize, I am not a statistician, thus check the results to see if it is actually doing what you want to do:

data have;

input testid $ revenue;

cards;

A1 10

A1 12

Z1 3

Z1 14

A2 9

A2 6

A2 5

Z2 14

Z2 15

;

data need;

set have;

testgroup=substr(testid,2);

run;

proc ttest data=need;

class testid;

by testgroup;

run;

All Replies

Solution

02-28-2012
03:22 PM

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

02-28-2012 03:22 PM

I think that the following describes what you are trying to do. I'm presuming that these are all independent tests, except that all of the data exists in one file. Also realize, I am not a statistician, thus check the results to see if it is actually doing what you want to do:

data have;

input testid $ revenue;

cards;

A1 10

A1 12

Z1 3

Z1 14

A2 9

A2 6

A2 5

Z2 14

Z2 15

;

data need;

set have;

testgroup=substr(testid,2);

run;

proc ttest data=need;

class testid;

by testgroup;

run;

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

02-28-2012 03:33 PM

Doh! I knew it was that easy! How did I not pick up on this on all the whitepapers I read...

Thanks!