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

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