0

As the title, I have a category variable including A,B,C three levels. I want to just select two levels such as A and B, as I know C is none of the business to run two sample t-test.

  proc ttest data=ABC plots(shownull)=interval;
          class var3 ###please add your code here###;
          var var23; 
          title ' two samples t-test A&B';
  run;
Zed Fang
  • 823
  • 2
  • 13
  • 24

1 Answers1

1

You can always filter your dataset to include only two levels.

Where var3 ne 'C';

Usually you would use an ANOVA instead when you have 3 levels and then you could do pairwise comparisons but you need to correct for multiple testing. PROC ANOVA incorporates options for this type of analysis.

Reeza
  • 20,510
  • 4
  • 21
  • 38
  • The WHERE can go anywhere in the proc. It could even be used as a data set option on the DATA statement, as `data=abc (where=(var3 ne 'C')) ` – Reeza Nov 22 '16 at 22:23