BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Mruizv
Obsidian | Level 7

Trying to run a T test (not paired) but my variable "group" has 3 levels. (A/B/C)

How can I select only 2 without using a print or data step?

My current observations are stacked 10 of each


PROC ttest data=example;
title "T Tests";
class group;
var x y;
RUN;

1 ACCEPTED SOLUTION

Accepted Solutions
Mruizv
Obsidian | Level 7

I have a previously created data step, but in my actual program I am not allowed to create one. So I can read it from the PROC TTEST, wasn't aware I could use the WHERE statement inside.

I have to test group A and B vs X and Y

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

Your description is not at all clear.

If you want to limit the data used by PROC TTEST use a WHERE statement.

For example if GROUP has value A, B, C, D and you want to test A against B then add

where group in ('A' 'B');

To your program.

Mruizv
Obsidian | Level 7

I have a previously created data step, but in my actual program I am not allowed to create one. So I can read it from the PROC TTEST, wasn't aware I could use the WHERE statement inside.

I have to test group A and B vs X and Y

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 711 views
  • 1 like
  • 2 in conversation